Open
Description
SR
.series will lose the order term when passed to Maxima. Thus only the coefficients may be simplified, and this must be done in all simplify*
functions.
sage: x=var('x')
sage: s=(1/(1-x)).series(x,6)
sage: s.coeffs()
[[x^5 + x^4 + x^3 + x^2 + x + Order(x^6) + 1, 0]]
sage: s.simplify_full().coeffs()
[[Order(x^6) + 1, 0], [1, 1], [1, 2], [1, 3], [1, 4], [1, 5]]
See also the related #17399.
Originally found in http://ask.sagemath.org/question/24968/coefficients-in-polynomial-ring-over-symbolic-ring/
Also, series
should simplify its terms on a per-term basis:
sage: var('x,y')
(x, y)
sage: ex=1/(1-x*y-x^2)
sage: ex.series(x,5)
1 + (y)*x + (y^2 + 1)*x^2 + ((y^2 + 1)*y + y)*x^3 + (((y^2 + 1)*y + y)*y + y^2 + 1)*x^4 + Order(x^5)
Compare with e.g. Pari:
? 1/(1-x*y-x^2) + O(x^5)
%1 = 1 + y*x + (y^2 + 1)*x^2 + (y^3 + 2*y)*x^3 + (y^4 + 3*y^2 + 1)*x^4 + O(x^5)
Both issues can be fixed by writing series simplification methods.
Depends on #17399
Depends on #17659
Component: symbolics
Author: Ralf Stephan
Branch/Commit: u/rws/17400-1 @ 22c947a
Issue created by migration from https://trac.sagemath.org/ticket/17400