Problem with plotting function defined condionally
Subject: Problem with plotting function defined condionally
From: Olive
Date: Sat, 07 Jun 2008 23:37:12 +0200
Robert Dodier wrote:
> On 6/7/08, Olive <not0read0765 at yopmail.com> wrote:
>
>> (%i1) croot(x) := if x>0 then x^(1/3) else -(-x)^(1/3) $
>>
>> if I try to plot this function; I obtain only a graph for x>0, the
>> negative part is left blank on the graph:
>>
>> (%i2) plot2d(croot(x),[x,-5,5]);
>
> Olive, here is a work-around:
>
> plot2d (croot, [x, -5, 5]);
>
> i.e. just name the function instead of writing croot(x).
Many thanks for your explanation.
My problem is not really to plot croot but I want to define a function
croot that I can use to define more complex function to be plotted, for
example I want to be able to write plot2d(croot(x^2),[x,-5,-5]). I
always end up with this simplification problem; don't you know a work
around that would force maxima to compute croot without any simplification?
Olive