Collecting Terms



	I'm a total neophyte so forgive some beginner questions and 
frustrations. I'm using wxMaxima as a front end to Maxsima and I want to 
collect terms, at least that's what I call what I want to do. When I 
look collectterms up in the wxMaxima help index it tells me that this is 
a function for re-arranging forms (whatever they are) that are messed up 
by the facexp package (which does something I cannot decipher). That 
documentation says the arguments are:
collectterms(arg_1,...,arg_n)
	but I was looking for a function with args like:
collectterms(expr,var_1,...,var_n)
	To my surprise, if I assume that collectterms does what I want, it 
sometimes does! By dumb luck I found that if I expand the expression 
first, then collectterms always works! (Well, it has in two cases where 
I needed it). I'm happy now but how come the documentation was no help 
whatsoever and where do I go the next time I want to do something 
different? Here's an example of collecting terms working for me:

((p4-3*p3+3*p2-p1)*T^3+(-p4+4*p3-5*p2+2*p1)*T^2+(p3-p1)*T+2*p2)/2
expand(%)
collectterms(%,p1,p2,p3,p4)
	final output:
p2*((3*T^3)/2-(5*T^2)/2+1)+p4*(T^3/2-T^2/2)+p1*(-T^3/2+T^2-T/2)+p3*(-(3*T^3)/2+2*T^2+T/2)

------------------------------------
Code in haste, debug at leisure