ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 17 Jan 2017 12:20:19 +0100Derivative of O(x^0)https://ask.sagemath.org/question/36301/derivative-of-ox0/Consider a power series
R.<x> = PowerSeries(SR)
f = 1 + O(x^2)
f.derivative()
This gives us `O(x^1)` as we would expect. However, if we do
f = O(x^0)
f.derivative()
we get `O(x^-1)` instead of `O(x^0)` again. Is this a bug or am I missing something?Sun, 15 Jan 2017 15:16:30 +0100https://ask.sagemath.org/question/36301/derivative-of-ox0/Answer by slelievre for <p>Consider a power series</p>
<pre><code>R.<x> = PowerSeries(SR)
f = 1 + O(x^2)
f.derivative()
</code></pre>
<p>This gives us <code>O(x^1)</code> as we would expect. However, if we do</p>
<pre><code>f = O(x^0)
f.derivative()
</code></pre>
<p>we get <code>O(x^-1)</code> instead of <code>O(x^0)</code> again. Is this a bug or am I missing something?</p>
https://ask.sagemath.org/question/36301/derivative-of-ox0/?answer=36323#post-id-36323This is indeed a bug! Thanks for reporting it! What version of Sage were you using?
I can reproduce the bug in Sage 7.4 using `PowerSeriesRing` instead of `PowerSeries`:
sage: R.<x> = PowerSeriesRing(SR)
sage: f = 1 + O(x^2)
sage: f.derivative()
O(x^1)
sage: g = O(x^0)
sage: g.derivative()
O(x^-1)
Tue, 17 Jan 2017 12:20:19 +0100https://ask.sagemath.org/question/36301/derivative-of-ox0/?answer=36323#post-id-36323