How can we collect terms?



You can also use

expandwrt(your expression, x).

Rich

--------------------------------------------------
From: "dlakelan" <dlakelan at street-artists.org>
Sent: Sunday, February 21, 2010 10:03 PM
To: <maxima at math.utexas.edu>
Subject: Re: [Maxima] How can we collect terms?

> On 02/11/2010 07:10 AM, Andrej Vodopivec wrote:
> 
>> I'm sure there are other possibilities, but here are two simple options:
>>
>> (%i1) subst(y = m*x +b, (x-2)^2 + (y-3)^2 = 5), expand;
>> (%o1) m^2*x^2+x^2+2*b*m*x-6*m*x-4*x+b^2-6*b+13=5
>> (%i2) rat(%o1, x);
>> (%o2)/R/ (m^2+1)*x^2+((2*b-6)*m-4)*x+b^2-6*b+13=5
>> (%i3) load(format)$
>> (%i4) format(%o1, %poly(x));
>> (%o4) (m^2+1)*x^2+(2*b*m-6*m-4)*x+b^2-6*b+13=5
> 
> Oh my god! Why was I not informed about this format thing before? :-) 
> That seems super-useful. How well supported is it? There are some 
> various warnings in the README. Sigh, Maxima always has some hidden 
> features somewhere that do just what I want except I don't know about them.
> 
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>