# Revision history [back]

### Coefficients in Polynomial Ring over Symbolic Ring ?

Consider

x = SR.var('x')
gf = exp(x)*(bessel_I(0, 2*x)-bessel_I(1, 2*x))
t = gf.series(x, 6).simplify_full()
print t.coefficients()
Q.<x> = PolynomialRing(SR)
Q(t)


The output is:

[[Order(x^6) + 1, 0], [1/2, 2], [1/6, 3], [1/8, 4], [1/20, 5]]
1/20*x^5 + 1/8*x^4 + 1/6*x^3 + 1/2*x^2 + Order(x^6) + 1


'Order(x^6)' is a coefficient of a polynomial?

### Coefficients in Polynomial Ring over Symbolic Ring ?

Consider

x = SR.var('x')
gf = exp(x)*(bessel_I(0, 2*x)-bessel_I(1, 2*x))
t = gf.series(x, 6).simplify_full()
print t.coefficients()
Q.<x> = PolynomialRing(SR)
Q(t)


The output is:

[[Order(x^6) + 1, 0], [1/2, 2], [1/6, 3], [1/8, 4], [1/20, 5]]
1/20*x^5 + 1/8*x^4 + 1/6*x^3 + 1/2*x^2 + Order(x^6) + 1


'Order(x^6)' is a coefficient of a polynomial?

Solution by kcrisman:

x = SR.var('x')
gf = exp(x)*(bessel_I(0, 2*x)-bessel_I(1, 2*x))
t = gf.series(x, 6).truncate().simplify_full()
print t.coefficients()
Q.<x> = PolynomialRing(SR)
Q(t)


### Coefficients in Polynomial Ring over Symbolic Ring ?

Consider

x = SR.var('x')
gf = exp(x)*(bessel_I(0, 2*x)-bessel_I(1, 2*x))
t = gf.series(x, 6).simplify_full()
print t.coefficients()
Q.<x> = PolynomialRing(SR)
Q(t)


The output is:

[[Order(x^6) + 1, 0], [1/2, 2], [1/6, 3], [1/8, 4], [1/20, 5]]
1/20*x^5 + 1/8*x^4 + 1/6*x^3 + 1/2*x^2 + Order(x^6) + 1


'Order(x^6)' is a coefficient of a polynomial?

Solution by kcrisman:

x = SR.var('x')
gf = exp(x)*(bessel_I(0, 2*x)-bessel_I(1, 2*x))
t = gf.series(x, 6).truncate().simplify_full()
print t.coefficients()
Q.<x> = PolynomialRing(SR)
Q(t)


EDIT

The answer of rws prompts me to note the following:

u = SR.var('u')
gf = exp(u)*(bessel_I(0, 2*u)-bessel_I(1, 2*u))
s = gf.series(u,6).simplify_full()
R.<x> = PowerSeriesRing(SR)
t = R(s).ogf_to_egf()
print t.parent()
print t


Power Series Ring in x over Symbolic Ring