rearranging and collecting terms



Mario,

I suggest you look at the format() package.  When I was a Maxima newbie I 
needed to do quite a few things like this, and still do!

load("format")

should load, for 
example,
/share/maxima/5.15.0/share/contrib/format/format.mac

there is documentation format.ps in this directory.  Time spent getting to 
know this package will be repaid.

This won't solve your problem: pulling out an integer factor without 
factoring cos(d1)^3-cos(d2)^3.  I don't know how to do this.

Chris


On Thu, 6 Aug 2009, Mario Maio wrote:

> I hope this is not too much a trivial question, I'm a newbie to Maxima. I'd
> like to rearrange expressions like this
>
> (3*cos(d1)^3-3*cos(d2)^3)*x
>
> or this
>
> (3*a*b1-3*a*b2)*x
>
> into a simpler form with collected terms;
>
> 3*(cos(d1)^3-cos(d2)^3)*x
>
> 3*a*(b1-b2)*x
>
>
> Is there a solution that works in BOTH cases ?
>
> Factor  or  facsum  work for the 2nd expression but lead to unwanted
> trigonometric expansion in the 1st expression.
>
> It seemed to me a very simple rearrangment to do but i could not find a
> solution after a long search.
>
> Thank you very much for your help.
>
> Mario M.
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>