ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 22 Nov 2017 23:38:05 -0600How can I compose 2 power series in one variable with their compositional inverse get a power series in two variables?http://ask.sagemath.org/question/39739/how-can-i-compose-2-power-series-in-one-variable-with-their-compositional-inverse-get-a-power-series-in-two-variables/I would like to compose a power series $\ell$ defined in $x$ to get a power series $\ell^{-1}(\ell(x) + \ell(y))$ as a power series $f(x, y)$ in two variables, $x$ and $y$. In the code below I call l := $\ell$, and e := $\ell^{-1}$.
PREC = 20
R.<x, y> = PowerSeriesRing( QQ, default_prec=PREC )
f = exp( 1/3 * log( 1-x^3 ) )
print f
w = 1/f
l = w.integral(x)
e = l.reverse()
g = e(l(x) + l(y)) ??
I find immediately the following issue, let alone the issue of composing:
e = l.reverse()
AttributeError: 'MPowerSeriesRing_generic_with_category.element_class' object has no attribute 'reverse'
Once I have this two variable power series $f(x, y)$, I would like to output $f(x, (f(x, ..., f(x,x)))$, composed with itself $n$-times for a natural number $n$.masseygirlWed, 22 Nov 2017 23:38:05 -0600http://ask.sagemath.org/question/39739/Series Reversionhttp://ask.sagemath.org/question/23500/series-reversion/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](http://www.sagemath.org/doc/reference/power_series/sage/rings/power_series_poly.html) 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](https://en.wikipedia.org/wiki/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?
jjackSun, 20 Jul 2014 05:43:52 -0500http://ask.sagemath.org/question/23500/