Can changing order of two expansions change the result?

50 Views Asked by At

I faced the problem : when expanding a function two times regarding to different variables, order of expansion is important! It seems really odd. How is it possible?

this is the function I wish to expand:

(r12 Cos[th] + G Sin[tp]) (( 6 (z + G Cos[tp] + r12 Sin[th])^2 (2 z + G Cos[tp] + r12 Sin[th]))/((2 z + G Cos[tp] + r12 Sin[th])^2 + (r12 Cos[th] + G Sin[tp])^2)^(5/2) + ( 2 z + G Cos[tp] + r12 Sin[th])/((2 z + G Cos[tp] + r12 Sin[th])^2 + (r12 Cos[th] + G Sin[tp])^2)^( 3/2) - ((z + G Cos[tp] + r12 Sin[th]) (5 (G^2 + r12^2) + 32 z^2 - 3 r12^2 Cos[2 th] + 32 r12 z Sin[th] + 16 G Cos[tp] (2 z + r12 Sin[th]) + G (3 G Cos[2 tp] + 4 r12 Cos[th] Sin[tp])))/((2 z + G Cos[tp] + r12 Sin[th])^2 + (r12 Cos[th] + G Sin[tp])^2)^( 5/2) + (G Cos[tp] + r12 Sin[th])/(G^2 + r12^2 + 2 G r12 Sin[th + tp])^(3/2))

1

There are 1 best solutions below

3
On BEST ANSWER

As one of the comments on the Mathematica question notes, the problem is with your expectations. Suppose you have an expression $\, 1/(x+y). \,$ If you expand it in series centered at infinity in both variables in different order you get two different results. For example, first expand with $x$ and then with $y$ gives $\, 1/(x+y) = 1/x + (-y + O(1/y)^3)/x^2 + O(1/x)^3 \,$ while reversing the order gives $\, 1/(x+y) = 1/y + (-x + O(1/x)^3)/y^2 + O(1/y)^3. \,$ Dropping the $\,O()\,$ terms gives two different rational expressions. This is due to expanding in series of inverse powers gives unexpected results. This situation also happen when expanding power series centered at finite points if there are poles of the function. For example, $\, x y/(x + y) = x - x^2/y + O(x^3) = y - y^2/x + O(y^3). \,$ Dropping the $\,O()\,$ terms again gives two different rational expressions. This is unexpected but correct.