collect coefficients



If rat(poly,x);   does what you want, then it is probably the way to go. 
It is exponentially faster than format.
you could even do rat(poly,x^b) if you want to collect terms in x^b.

RJF