2021-11-10 12:31:28 +0200 marked best answer Substituting vars of PowerSeries over RR What is the intended way to substitute variables of PowerSeries (or equivalently LaurentSeries) over RR? The following code does not produce the correct result: sage: P. = PowerSeriesRing(RR) sage: p = x**2+2*x+3 sage: p.subs(x=x**2) 3.00000000000000 + 2.00000000000000*x + 1.00000000000000*x^2  In ZZ, the previous example works correctly: sage: P. = PowerSeriesRing(ZZ) sage: p = x**2+2*x+3 sage: p.subs(x=x**2) 3 + 2*x^2 + x^4  Working with PolynomialRings over RR also seems to work correctly, I do however need to work with negative exponents (i.e., LaurentSeries) and therefore cannot easily convert my expressions to polynomials before substituting. 2021-11-10 12:31:28 +0200 received badge ● Scholar (source) 2021-11-10 12:31:26 +0200 received badge ● Supporter (source) 2021-11-09 16:03:56 +0200 received badge ● Student (source) 2021-11-09 16:00:44 +0200 asked a question Substituting vars of PowerSeries over RR Substituting vars of PowerSeries over RR What is the intended way to substitute variables of PowerSeries (or equivalentl