Converting a (2,3)-diagonal into a main diagonal.
Requirements: None
# We aim to determine a new rational function whose main diagonal is the (2,3)-diagonal of F
var('x,y')
F = 1/(1-x-y)
F
-1/(x + y - 1)
# Create a rational function whose series expansion contains only terms of F with even exponent of x
G = (F(x,y)/2 + F(-x,y)/2).factor()
print("The rational function is {}".format(G))
print("Its series expansion begins {}".format(taylor(G,(x,0),(y,0),5)))
The rational function is (y - 1)/((x + y - 1)*(x - y + 1)) Its series expansion begins 5*x^4*y + 10*x^2*y^3 + y^5 + x^4 + 6*x^2*y^2 + y^4 + 3*x^2*y + y^3 + x^2 + y^2 + y + 1
# Create a rational function whose series expansion contains only terms of F with even exponent of x and exponent of y divisibly by 3
ω = exp(2*pi*I/3)
H = (G(x,y)/3 + G(x,ω*y)/3 + G(x,ω^2*y)/3).simplify_full()
print("Its series expansion begins {}".format(taylor(H,(x,0),(y,0),7)))
Its series expansion begins 35*x^4*y^3 + x^6 + y^6 + 10*x^2*y^3 + x^4 + y^3 + x^2 + 1
# Replacing x^2 = s and y^3 = t gives the desired rational function
var('s,t')
F23 = H.subs(x=s^(1/2),y=t^(1/3))
print("The rational function is {}".format(F23))
print("Its series expansion begins {}".format(taylor(F23,(s,0),(t,0),3)))
The rational function is -(s^2 - (s + 1)*t - 2*s + 1)/(s^3 - 3*s^2 + 2*(3*s + 1)*t - t^2 + 3*s - 1) Its series expansion begins s^3 + 35*s^2*t + 28*s*t^2 + t^3 + s^2 + 10*s*t + t^2 + s + t + 1
# Finally, we verify that the initial (2,3)-diagonal terms of F are the initial (1,1)-diagonal terms of F23
ser = QQ[x,y](taylor(F,(x,0),(y,0),50))
print([ser[2*k,3*k] for k in range(10)])
ser23 = QQ[s,t](taylor(F23,(s,0),(t,0),20))
print([ser23[k,k] for k in range(10)])
[1, 10, 210, 5005, 125970, 3268760, 86493225, 2319959400, 62852101650, 1715884494940] [1, 10, 210, 5005, 125970, 3268760, 86493225, 2319959400, 62852101650, 1715884494940]