MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

The Virtues of Collect[--]


Appended below is an example of what  Collect[expr, h, Simplify]  just 
did for me.

Thanks to David Park and Andrzej Kozlowski for teaching me about this.

I wish  Collect[--]  was mentioned as one of the "See Also"'s under the 
Series Help message -- and I wonder a bit why Mathematica doesn't do 
this kind of elementary simplification of the Series coefficients 
automatically.

In[30]:=
fS[d_,h_] = Series[ f[d, h], {h,0,2} ] // Normal

Out[30]=
((((2 + d)*(d - d^2))/(-d + d^2) + (1/2)*(-d + d^2)*((4*d)/(-d + d^2)^2 
+  (2*(2 + d))/(-d + d^2)))*h)/(2*d) + 
  (-(((-1 - d)*(((2 + d)*(d - d^2))/(-d + d^2) + (1/2)*(-d + d^2)*
         ((4*d)/(-d + d^2)^2 + (2*(2 + d))/(-d + d^2))))/(2*d^2)) + 
    ((-d + d^2)*((4*(-1 - d))/(-d + d^2)^2 + (2 + d)^2/(-d + d^2)^2 - 
       (1/4)*((4*d)/(-d + d^2)^2 + (2*(2 + d))/(-d + d^2))^2))/(4*d))*h^2

In[32]:=
Collect[ fS[d, h], h, Simplify ]

Out[32]=
(1 / (-d + d^2)) * h  -  ((-1 + d + d^2) / (-1 + d)^3*d^2)) * h^2


  • Prev by Date: RE: Apply and Heads option
  • Next by Date: RE: Apply and Heads option
  • Previous by thread: Help: Problem with an integral
  • Next by thread: Examples using Trig option