Sage: Ticket #19997: advanced symbolic series of Order any expression
https://trac.sagemath.org/ticket/19997
<pre class="wiki">sage: (x+1).sqrt().series(x,3)
1 + 1/2*x + (-1/8)*x^2 + Order(x^3)
sage: (x+1).sqrt().series(x,3).subs(x=1/x)
1/2/x - 1/8/x^2 + 1
</pre>en-usSagehttps://trac.sagemath.org/chrome/site/logo_sagemath_trac.png
https://trac.sagemath.org/ticket/19997
Trac 1.1.6rwsFri, 05 Feb 2016 09:11:23 GMTtype, summary changed
https://trac.sagemath.org/ticket/19997#comment:1
https://trac.sagemath.org/ticket/19997#comment:1
<ul>
<li><strong>type</strong>
changed from <em>defect</em> to <em>enhancement</em>
</li>
<li><strong>summary</strong>
changed from <em>substitution in symbolic series: losing Order</em> to <em>advanced symbolic series of Order any expression</em>
</li>
</ul>
<p>
The substitution is fine. To support other than power series would be a major enhancement.
</p>
TicketdkrennMon, 08 Feb 2016 09:25:28 GMT
https://trac.sagemath.org/ticket/19997#comment:2
https://trac.sagemath.org/ticket/19997#comment:2
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/19997#comment:1" title="Comment 1">rws</a>:
</p>
<blockquote class="citation">
<p>
The substitution is fine. To support other than power series would be a major enhancement.
</p>
</blockquote>
<p>
I'm not sure if I understand your comment. What I see (as someone having only little idea how power series are done in SR) is that in
</p>
<pre class="wiki">sage: a = 1 + x/2 - x^2/8 + (x^3).Order()
sage: a
-1/8*x^2 + 1/2*x + Order(x^3) + 1
sage: a.subs(x=1/x)
1/2/x - 1/8/x^2 + Order(x^(-3)) + 1
</pre><p>
substitution works (somehow at least), but in the example stated in the ticket not, the O-Term disappears.
</p>
TicketrwsTue, 09 Feb 2016 14:14:19 GMT
https://trac.sagemath.org/ticket/19997#comment:3
https://trac.sagemath.org/ticket/19997#comment:3
<p>
So, until that enhancement is implemented, a second ticket is needed for consistency, which throws an error. But note that the user won't even encounter this inconsistency if she creates symbolic series the way the documentation suggests it:
</p>
<pre class="wiki">sage: (1/(1-x)).series(x,2)
1 + 1*x + Order(x^2)
sage: s=_
sage: s.subs(x==sin(x))
sin(x) + 1
sage: s.subs(x==exp(x))
e^x + 1
sage: s.subs(x==1/x)
1/x + 1
sage: s.subs(x=1/x)
1/x + 1
</pre>
Ticket