Series Reversion [closed]
I have a rational polynomial f(z) = P(z)/Q(z) which I want to revert (I'm trying to find the inverse of f).
I'll pick a simple example, the function f(z) = (1/z-1)^4
sage: z = var('z')
sage: z = FractionField(PolynomialRing(QQ, 'z')).objgen()
sage: f(z) = (1/z-1)^4
sage: g = f(z).taylor(x,2,4); #I expand f in a Taylor series just to make sure it's a series
sage: f.expand().reversion()
AttributeError: 'sage.symbolic.expression.Expression' object has no attribute 'reversion'
sage: g1 = g.power_series(QQ)
TypeError: denominator must be a unit
sage: g.reversion()
AttributeError: 'sage.symbolic.expression.Expression' object has no attribute 'reversion'
A power series P(z) is not a rational function P(z)/Q(z). That's why the TypeError: denominator must be a unit
appears.
Is it possible that Sage cannot invert rational polynomials? In the Sage help text the computation is passed to pari first, before using Lagrangian inversion.
I thought Sage uses FLINT. Why is it not used for computing the inverse of rational polynomials?
EDIT (after answer by slelievre):
My problem now is how to avoid using the Symbolic Ring. I'm trying to do the following:
I want to invert an approximation formula for the Gamma-function. I am using Spouge's approximation. It has terms in the numerator and the denominator. Ithink I can compute them separetely per se, but what if I wanted to do a Pade approximation of the function
sage: f = (z+13)^(z+1/2)*exp(z)
sage: g = f.pade(5,5)
(it's the term ahead of the sum term in Spouge's approximation)
How do I get separate polynomials for the numerator and the denominator that are defined in the right algebraic structure?
I added a line with what y(x) looks like.
This is not sufficient for me to get the error. Please give all instructions necessary to reproduce the error from a fresh Sage session.
see above for the instructions
Note: (a) using Sage in a terminal will allow you to post your code by an easy copy-paste (where the input will have the `sage: ` prompt and the output will be mixed in with the input). (b) I edited the code in your original question to make it display better. (c) I added your follow-up question as an edit to your main question rather than an answer to your original question.