# Mathematica's output changes when I change order of series [closed]

The output of below codes are different when I run them. Does any one knows what could be the reason? They should be the same, because it shouldn't depend on order of expansion. Could anyone discover the source of difference? Any answers is highly appreciated.

f2x = Import["https://pastebin.com/RAPC8KpX"];

F1=  Series[
Series[f2x, {r12, Infinity,2}] // Normal, {z, Infinity, 1}] // Normal;

F2=  Series[
Series[f2x, {z, Infinity,1}] // Normal, {r12, Infinity, 2}] // Normal;

• So what is f2x? Clearly we cannot answer this question without this basic information. – David G. Stork Jul 6 '18 at 6:38
• @HolgerMate: Please give us a representative function for f2x. Again, we can't help at all without some function here. – David G. Stork Jul 6 '18 at 12:50
• I also cannot reproduce the problem, neither in version 11.0.1 nor in version 11.3 for macOS. – Henrik Schumacher Jul 6 '18 at 14:48
• No, you should hope somebody else does with this non-explanation. I'm not going to try any more. You make it impossible for me to help you. – rhermans Jul 6 '18 at 15:33
• @HolgerMate Also please delete the comments that have become obsolete. This question will be here forever, try to make it readable for future visitors. – rhermans Jul 6 '18 at 15:34

I get the same result in any case (Mathematica 11.3 Win 7 64). I think you may have a lingering definition, try starting with a clean kernel.

f2x = Import["https://pastebin.com/raw/Q6pW366F"];

ser1 = Series[Series[f2x, {r12, Infinity, 2}] // Normal, {z, Infinity, 1}] // Normal;

ser2 = Series[Series[f2x, {z, Infinity, 1}] // Normal, {r12, Infinity, 2}] // Normal;

ser3 = Normal@Series[f2x, {z, Infinity, 1}, {r12, Infinity, 2}];

FullSimplify[ser1 == ser2 == ser3]
(* True *) • I have used your code for another f2x presented in below link, The output is not true anymore! pastebin.com/RAPC8KpX – Holger Mate Jul 7 '18 at 12:33
• Your code doesn't work in this case :( – Holger Mate Jul 7 '18 at 12:56
• @HolgerMate It is True when I run it on a clean kernel. – rhermans Jul 7 '18 at 13:06
• I am completely confused :(. When I use quit kernel and then run the code I put in the above link, the out put is: some code==0. It doesn't returns True. Do you know why does it happens? – Holger Mate Jul 7 '18 at 13:09
• It returns: (a G H (G + H) (4 G^2 H^2 (G + H)^2 (G (2 Gd + Hd) + H (Gd + 2 Hd)) - 12 a G H (G + H) (G^3 (2 Gd + Hd) + G^2 H (3 Gd + Hd) + H^3 (Gd + 2 Hd) + G H^2 (Gd + 3 Hd)) + 3 a^2 (3 G^5 (2 Gd + Hd) + 3 H^5 (Gd + 2 Hd) + G^3 H^2 (12 Gd + 5 Hd) + G^4 H (15 Gd + 8 Hd) + G^2 H^3 (5 Gd + 12 Hd) + G H^4 (8 Gd + 15 Hd))) Cos[ th] (3 + Cos[2 tp]) (-1 + 3 Cos[2 (th + tp)]))/((-4 G^2 H^2 (G + H)^2 + 4 a G H (G + H) (G^2 + 3 G H + H^2) + 3 a^2 (G^4 - 2 G^3 H - 5 G^2 H^2 - 2 G H^3 + H^4)) r12 z) == 0 – Holger Mate Jul 7 '18 at 13:13