# Piecewise functions and step functions

8 views

### Jennifer

Jan 27, 2003, 3:41:13 PM1/27/03
to
Hi, I'm a high school student currently enrolled in calculus. Can
anyone please tell me how to enter piecewise and step functions on the
HP48GX? I'd really appreciate it.

Also, is there an an way to find the second derivative directly? I've
been finding the first derivative, writing it down on paper (which can
be a pain), then entering it in again to find the second derivative.
As you can see, this leaves lots of room for human error, and it's
already cost me some points on two exams.

Thanks a lot,

Jennifer

### Roman Hartmann

Jan 27, 2003, 4:19:46 PM1/27/03
to
hello,
"Jennifer" <guoje...@hotmail.com> schrieb im Newsbeitrag

> Hi, I'm a high school student currently enrolled in calculus. Can
> anyone please tell me how to enter piecewise and step functions on the
> HP48GX? I'd really appreciate it.

The HP48GX doesn't have the step by step mode. Only the HP49G offers this
functionality. I hardly use it, so I can't comment how useful it is.

> Also, is there an an way to find the second derivative directly? I've
> been finding the first derivative, writing it down on paper (which can
> be a pain), then entering it in again to find the second derivative.
> As you can see, this leaves lots of room for human error, and it's
> already cost me some points on two exams.

Use the stack to do this or write a small program.
Example how to do this on the stack (RAD-mode):

'SIN(X)'
'X'
[r-shift]-[SIN]
gives you the first derivative:
'COS(X)'
put again 'X' on the stack
[r-shift]-[SIN]
gives you the second derivative:
'SIN(X)'

Regards,
Roman

> Thanks a lot,
>
> Jennifer

### Colin Croft

Jan 28, 2003, 2:18:52 AM1/28/03
to
Jennifer wrote:
> Hi, I'm a high school student currently enrolled in calculus. Can
> anyone please tell me how to enter piecewise and step functions on the
> HP48GX? I'd really appreciate it.

You might like to try a trick for the piecwise defined functions that
works well on the 39G. I would think it would also work on the 48 but I
don't have one to test on.
The trick is to divide by the domain of the function.
For example, suppose that the function was:
f(x)= x+5 for x<=-2, 10-x^2 for -2<x<=1 and 5-x for x>1
On the 39G you would enter this as three functions F1(X),F2(X) and F3(X)
as below.
F1(X)=(X+5)/(X<=-2)
F2(X)=(10-X^2)/((X>-2) AND (X<=1))
F3(X)=(5-X)/(X>1)
When you graph this you will, on the 39G at least, get a perfect display
with the discontinous portions of the graph not joined by 'vertical'
lines as they often are with other methods (such as using an IFTE
definition).
The reason why it works is that the domain is a True/False test that
evaluates to 1 within the domain and zero outside it. This means that
within the domain the function is being divided by 1 (no effect) but
outside it is being divided by zero (undefined, so not graphed).
You can see some pictures of the result (on a 39G) if you go to
http://www.hphomeview.com/faqs_40-49.htm#47

### Nick Karagiaouroglou

Jan 28, 2003, 6:36:53 AM1/28/03
to
Hi Jennifer, Hi Roman!

"Roman Hartmann" <rhar...@bluewin.ch> wrote in message news:<3e35a...@news.bluewin.ch>...

> hello,
> "Jennifer" <guoje...@hotmail.com> schrieb im Newsbeitrag
> > Hi, I'm a high school student currently enrolled in calculus. Can
> > anyone please tell me how to enter piecewise and step functions on the
> > HP48GX? I'd really appreciate it.
>
> The HP48GX doesn't have the step by step mode. Only the HP49G offers this
> functionality. I hardly use it, so I can't comment how useful it is.

Roman, I think that Jennifer was talking about the step function and
step-by-step-(un)functionality of the HP49G.

If this was the case, then of course it is possible to make such a
piece wise defined function, which by the way the HP48 will also plot
correctly. (Don#t ask here what the HP49G will plot in such cases ;-))

You can put IFTE in an algebraic, and for example define:
IFTE(X>0,X,SIN(X)).
If you want you can even enter for example F(X)=IFTE(X>0,X,SIN(X)) and
press [DEF] to amke a user defined function.
You proceed similarly with the step function, just use IFTE(X>0,1,0)
or anything else.

> > Also, is there an an way to find the second derivative directly? I've
> > been finding the first derivative, writing it down on paper (which can
> > be a pain), then entering it in again to find the second derivative.
> > As you can see, this leaves lots of room for human error, and it's
> > already cost me some points on two exams.
>
> Use the stack to do this or write a small program.

A small program which would look something like:

<<
-> func var
<<
func var \gd
var \gd
>>
>>

where \gd stands for the curly d of the derivative function.

Greetings,
Nick.