Sage: Ticket #16197: provide missing function expansions of power series
https://trac.sagemath.org/ticket/16197
<p>
Some functions do not support rings/power-series*:
</p>
<pre class="wiki">sage: R.<x> = PowerSeriesRing(ZZ)
sage: sqrt(1-4*x^2)
1 - 2*x^2 - 2*x^4 - 4*x^6 - 10*x^8 - 28*x^10 - 84*x^12 - 264*x^14 - 858*x^16 - 2860*x^18 + O(x^20)
sage: sin(1+4*x^2)
...
TypeError: cannot coerce arguments: no canonical coercion from Power Series Ring in x over Integer Ring to Symbolic Ring
</pre><p>
What is missing:
</p>
<ul><li><code>acos</code>, <code>acosh</code>, <code>asin</code>, <code>asinh</code>, <code>atan</code>, <code>atanh</code>, <code>cos</code>, <code>cosh</code>, <code>cotanh</code>, <code>dilog</code>, <code>gamma</code>, <code>intformal</code>, <code>lngamma</code>, <code>psi</code>, <code>sin</code>, <code>sinh</code>, <code>tan</code>, <code>tanh</code>
</li></ul>en-usSagehttps://trac.sagemath.org/chrome/site/logo_sagemath_trac.png
https://trac.sagemath.org/ticket/16197
Trac 1.1.6kcrismanMon, 21 Apr 2014 15:57:38 GMT
https://trac.sagemath.org/ticket/16197#comment:1
https://trac.sagemath.org/ticket/16197#comment:1
<p>
Similarly to my other comment on this, I don't know if we want <code>n(pi/4)</code> in here or not...
</p>
<p>
Also, the regular <code>SR</code> one works fine:
</p>
<pre class="wiki">sage: ex.series(X,16)
(sin(1)) + (4*cos(1))*X^2 + (-8*sin(1))*X^4 + (-32/3*cos(1))*X^6 + (32/3*sin(1))*X^8 + (128/15*cos(1))*X^10 + (-256/45*sin(1))*X^12 + (-1024/315*cos(1))*X^14 + Order(X^16)
</pre><p>
so I'm not sure why you referenced it, though I agree that the error you get for power series rings is not ideal. Is there a way to either use SR for this (perhaps not "correct" for power series rings though?) or to get Pari to return a symbolic constant term?
</p>
<pre class="wiki">sage: atan(4*X^2+1)
arctan(4*X^2 + 1)
sage: _.series(X,16)
(1/4*pi) + 2*X^2 + (-4)*X^4 + 16/3*X^6 + (-128/5)*X^10 + 256/3*X^12 + (-1024/7)*X^14 + Order(X^16)
</pre><p>
What if the coefficients weren't rationals? Or integers? Note that in your example there is a 16/3 coefficient, which presumably isn't in the power series ring over integers. These may be dumb questions, but I'm just trying to explore what is really the desired behavior - certainly wrapping more Pari stuff is not a bad idea!
</p>
TicketrwsMon, 21 Apr 2014 16:10:14 GMT
https://trac.sagemath.org/ticket/16197#comment:2
https://trac.sagemath.org/ticket/16197#comment:2
<p>
Pari's symblic is not up to this. I'd consider it a bug that there is no default precision to SR series results (like with <code>PowerSeries</code>), so yes, if your last example would work without the <code>16</code> this ticket would rather be about my example <code>sin(1+4*x^2)</code>---it should simply work like <code>series()</code> and give back one instead of SR.
</p>
<p>
The rest of the ticket concerns possibly missing functions and I will move this to another ticket.
</p>
TicketkcrismanTue, 22 Apr 2014 00:21:08 GMT
https://trac.sagemath.org/ticket/16197#comment:3
https://trac.sagemath.org/ticket/16197#comment:3
<blockquote class="citation">
<p>
Pari's symblic is not up to this. I'd consider it a bug that there is no default precision to SR series results (like with <code>PowerSeries</code>), so yes, if your last example would work without the <code>16</code> this ticket would rather be about my example <code>sin(1+4*x^2)</code>---it should simply work like <code>series()</code> and give back one instead of SR.
</p>
</blockquote>
<p>
Hmm, that's an interesting suggestion. One could imagine it's a bug the other way around, but I have no vested interest in this - I think a default for either one could be useful, in principle, and (importantly) wouldn't be backward-incompatible. But what would the default be? It's hard to imagine one non-arbitrary... hmm. What do Mathematica and/or Maple and/or Magma do with this? If there is a standard one could use that.
</p>
TicketrwsTue, 22 Apr 2014 06:48:16 GMTdescription, summary changed
https://trac.sagemath.org/ticket/16197#comment:4
https://trac.sagemath.org/ticket/16197#comment:4
<ul>
<li><strong>description</strong>
modified (<a href="/ticket/16197?action=diff&version=4">diff</a>)
</li>
<li><strong>summary</strong>
changed from <em>provide function expansions of power series (from Pari)</em> to <em>provide missing function expansions of power series</em>
</li>
</ul>
<p>
I wrote earlier:
</p>
<blockquote class="citation">
<p>
The rest of the ticket concerns possibly missing functions and I will move this to another ticket.
</p>
</blockquote>
<p>
Nothing missing there except the a.g.m., fortunately.
</p>
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/16197#comment:3" title="Comment 3">kcrisman</a>:
</p>
<blockquote class="citation">
<p>
Hmm, that's an interesting suggestion. One could imagine it's a bug the other way around, but I have no vested interest in this - I think a default for either one could be useful, in principle, and (importantly) wouldn't be backward-incompatible. But what would the default be? It's hard to imagine one non-arbitrary... hmm.
</p>
</blockquote>
<p>
This is now <a class="closed ticket" href="https://trac.sagemath.org/ticket/16201" title="enhancement: default precision for all series (symbolic, power, Laurent) (closed: fixed)">#16201</a>
</p>
<blockquote class="citation">
<p>
What do Mathematica and/or Maple and/or Magma do with this? If there is a standard one could use that.
</p>
</blockquote>
<p>
If I ask for "cosine power series" in Wolfram Alpha I get <code>1-x^2/2+x^4/24-x^6/720+O(x^7)</code>
</p>
TicketrwsTue, 22 Apr 2014 16:49:28 GMT
https://trac.sagemath.org/ticket/16197#comment:5
https://trac.sagemath.org/ticket/16197#comment:5
<p>
Edit: my copy of another comment was unrelated so I deleted it
</p>
Ticketvbraun_spamTue, 06 May 2014 15:20:58 GMTmilestone changed
https://trac.sagemath.org/ticket/16197#comment:6
https://trac.sagemath.org/ticket/16197#comment:6
<ul>
<li><strong>milestone</strong>
changed from <em>sage-6.2</em> to <em>sage-6.3</em>
</li>
</ul>
TicketrwsSun, 20 Jul 2014 09:01:05 GMTstatus, milestone changed
https://trac.sagemath.org/ticket/16197#comment:7
https://trac.sagemath.org/ticket/16197#comment:7
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>needs_review</em>
</li>
<li><strong>milestone</strong>
changed from <em>sage-6.3</em> to <em>sage-duplicate/invalid/wontfix</em>
</li>
</ul>
<p>
Closing as wontfix since all issues mentioned have their own tickets.
</p>
TicketkcrismanMon, 21 Jul 2014 13:30:48 GMT
https://trac.sagemath.org/ticket/16197#comment:8
https://trac.sagemath.org/ticket/16197#comment:8
<p>
I only see one ticket mentioned. Just for completeness, can you mention them (if there are others)?
</p>
TicketrwsMon, 21 Jul 2014 13:46:16 GMT
https://trac.sagemath.org/ticket/16197#comment:9
https://trac.sagemath.org/ticket/16197#comment:9
<p>
Default symbolic expression series precision is <a class="closed ticket" href="https://trac.sagemath.org/ticket/16201" title="enhancement: default precision for all series (symbolic, power, Laurent) (closed: fixed)">#16201</a>, and symbolic agm function is <a class="new ticket" href="https://trac.sagemath.org/ticket/16202" title="enhancement: implement the agm(x,y) function (new)">#16202</a>.
</p>
TicketkcrismanMon, 21 Jul 2014 13:46:48 GMTstatus changed
https://trac.sagemath.org/ticket/16197#comment:10
https://trac.sagemath.org/ticket/16197#comment:10
<ul>
<li><strong>status</strong>
changed from <em>needs_review</em> to <em>positive_review</em>
</li>
</ul>
TicketvbraunMon, 21 Jul 2014 17:43:50 GMTstatus changed; resolution set
https://trac.sagemath.org/ticket/16197#comment:11
https://trac.sagemath.org/ticket/16197#comment:11
<ul>
<li><strong>status</strong>
changed from <em>positive_review</em> to <em>closed</em>
</li>
<li><strong>resolution</strong>
set to <em>duplicate</em>
</li>
</ul>
Ticket