collecting terms



> I have been unable to find something like maple's or mupad 'scollect ().

Try facsum(expr, var1, var2, ...)

e.g.

   test: expand((a+b+c)^3,a);

   facsum(test,a) => (c+b)^3+3*a*(c+b)^2+3*a^2*(c+b)+a^3

Note that the *order* of the terms is not necessarily increasing in
powers of a, e.g.:

   facsum((a+a*b+b)^2,a) => a^2*(b+1)^2+b^2+2*a*b*(b+1)

Use coeff to extract specific terms, e.g. coeff(...,a,1).

        -s