Re: Graphing piecewise functions?
[Prev][Next][Index][Thread]
Re: Graphing piecewise functions?
On Wed, 14 Oct 1998, Kasper Vibe Grevsen wrote:
> Hi!
> How do I graph
>
> x^2 for x<0
> f(x)={
> sqrt(x) for x>=0
>
> I know you would say y1=(x<0)x^2+(x>=0)sqrt(x) but that does not work
> because sqrt(x) is undefined for negative x values.
>
> I tried graphing y1=(x<0)x^2 and y2=(x>=0)sqrt(x) but it is not very handy
> and it results in some grim line.
>
> Suggestions?
>
> Kasper Vibe Grevsen (remove "remove" when emailing)
>
It is great to have a single expression so that you can easily integrate
from -2 to 2, for example.
Try
y1 = x^2*(x<0) + sqrt(abs(x))*(x>=0)
It works on my TI-85 and I'd guess it would be ok on the others.
Keep having fun!
Charlie
Follow-Ups:
References: