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
The answer is:
Power Series Ring in x over Symbolic Ring
1/20*u^5 + 1/8*u^4 + 1/6*u^3 + 1/2*u^2 + Order(u^6) + 1
OK, but now delete the transformation ogf_to_egf() in the above code and the answer is -- the same!