Maxima algebraic simplification



Rupert,
Many thanks. You are correct about typo's. I'll be more careful when
explaining problems. I especially like that your example solution gives me a
better understanding of how to treat the results of lists.

Ron


-----Original Message-----
From: Rupert Swarbrick [mailto:rswarbrick at googlemail.com] 
Sent: Saturday, May 10, 2008 2:23 PM
To: Ronald Modesitt
Cc: 'Richard Hennessy'; 'Maxima List'
Subject: Re: [Maxima] Maxima algebraic simplification

"Ronald Modesitt" <rmodesi at msn.com> writes:

> Rich,
> You're right this is really a cool feature. One I'm exploring and one 
> I am confused about. If I have two named expression e.g.
> 	e1:y=-x-3 and
> 	e2:y=3+4x-x^2
> How can I plot them? I've tried
> 	Plot2d([e1,e2], [x,-3-8])
> And get no response. I know this is a newbie issue but I need some 
> help understanding my error. Is there documentation on 'named expressions'
> somewhere?
>
> Ron.

If you imagine substituting in the values of e1, e2 into that, you get

Plot2d( [y=x-3, y=3+4x-x^2], [x,-3,-8] );

So there are several problems. I presume that the capitalisation, "4x"
and "-3,-8" are typos and you actually want

plot2d( [y=x-3, y=3+4*x-x^2], [x,-8,-3] );

But this doesn't work since plot2d wants expressions to evaluate, not
equalities and (since you've already solved for y), you just need the rhs of
each equation:

(%i11) [e1,e2]: [y=x-3, y=3+4*x-x^2];

                                           2
(%o11)                  [y = x - 3, y = - x  + 4 x + 3]
(%i12) map(rhs,[e1,e2]);

                                       2
(%o12)                      [x - 3, - x  + 4 x + 3]
(%i13) plot2d( map(rhs,[e1,e2]), [x,-8,-3] );


Works here.

Rupert


P.S. Is it a bug that plot2d fails silently if given equations? Or is there
a sensible reason? Anyone?