Nikos,
Try facsum(%,x).
(%i3) display2d:false;
(out3) false
(%i4) m^2*x^2+x^2+2*b*m*x+4*m*x^2-6*x-b-4*b+9;
(out4) m^2*x^2+4*m*x^2+x^2+2*b*m*x-6*x-5*b+9
(%i5) facsum(%,x);
(out5) (m^2+4*m+1)*x^2+2*(b*m-3)*x-5*b+9
my mistake.
Rich
--------------------------------------------------
From: "Nikos Apostolakis" <nikos.ap at gmail.com>
Sent: Sunday, February 21, 2010 10:57 PM
To: <maxima at math.utexas.edu>
Subject: Re: [Maxima] How can we collect terms?
>
> On Sun, Feb 21, 2010 at 10:21:45PM -0500, thus spake Richard Hennessy:
>> You can also use
>>
>> expandwrt(your expression, x).
>>
>
> This doesn't work for me.
>
> Maxima 5.20.1 http://maxima.sourceforge.net
> using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (a.k.a. GCL)
>
> [...]
> 2 2 2 2
> (%o7) m x + x + 2 b m x - 4 m x - 6 x + b - 4 b + 9
> (%i8) expandwrt(%, x);
> 2 2 2 2
> (%o8) m x + x + 2 b m x - 4 m x - 6 x + b - 4 b + 9
>
> Nikos
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>