The first one should be
y(x):= if x>=-1 and x<=1 then 4-x^2 else 2$
Rich
------------Original Message------------
From: "Ronald Modesitt" <rmodesi at msn.com>
To: maxima at math.utexas.edu
Date: Tue, May-6-2008 10:19 PM
Subject: problem formulation in plot2d function
Hi all,
My function is defined in Maxima as follows
y(x):= if x>=-1 or x<=1 then 4-x^2 else 2$
and is plotted with
plot2d(y(x),[x,-5,5], [y,-1,8])
however the plot is incorrect. It only plots the parabola (4-x^2), even outside the given range, and not the constant (2).
Redefining the function
y(x):= if x<-1 or x>1 then 2 else 4-x^2$
with the same plot2d command as above yields the correct plot.
Can anyone see a problem with my first form?
Thanks
Ron
Ronald F. Modesitt, PE
_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima