Finding two different Laurent expansions of a rational function when changing variable order.
Requirements: None
# Define the rings of iterated Laurent Series
A = LaurentSeriesRing(LaurentSeriesRing(QQ,'x'),'y')
B = LaurentSeriesRing(LaurentSeriesRing(QQ,'y'),'x')
print(A)
print(B)
Laurent Series Ring in y over Laurent Series Ring in x over Rational Field Laurent Series Ring in x over Laurent Series Ring in y over Rational Field
print("The expansion of (x+y)^(-1) in Q((x))((y)) is")
print(1/A("x+y").O(10))
The expansion of (x+y)^(-1) in Q((x))((y)) is (x^-1) + (-x^-2)*y + (x^-3)*y^2 + (-x^-4)*y^3 + (x^-5)*y^4 + (-x^-6)*y^5 + (x^-7)*y^6 + (-x^-8)*y^7 + (x^-9)*y^8 + (-x^-10)*y^9 + O(y^10)
print("The expansion of (x+y)^(-1) in Q((y))((x)) is".format(B))
print(1/B("x+y").O(10))
The expansion of (x+y)^(-1) in Q((y))((x)) is (y^-1) + (-y^-2)*x + (y^-3)*x^2 + (-y^-4)*x^3 + (y^-5)*x^4 + (-y^-6)*x^5 + (y^-7)*x^6 + (-y^-8)*x^7 + (y^-9)*x^8 + (-y^-10)*x^9 + O(x^10)