Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide missing function expansions of power series #16197

Closed
rwst opened this issue Apr 21, 2014 · 9 comments
Closed

provide missing function expansions of power series #16197

rwst opened this issue Apr 21, 2014 · 9 comments

Comments

@rwst
Copy link

rwst commented Apr 21, 2014

Some functions do not support rings/power-series*:

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

What is missing:

  • acos, acosh, asin, asinh, atan, atanh, cos, cosh, cotanh, dilog, gamma, intformal, lngamma, psi, sin, sinh, tan, tanh

Component: calculus

Keywords: function, series expansion

Issue created by migration from https://trac.sagemath.org/ticket/16197

@rwst rwst added this to the sage-6.2 milestone Apr 21, 2014
@kcrisman
Copy link
Member

comment:1

Similarly to my other comment on this, I don't know if we want n(pi/4) in here or not...

Also, the regular SR one works fine:

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)

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?

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)

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!

@rwst
Copy link
Author

rwst commented Apr 21, 2014

comment:2

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 PowerSeries), so yes, if your last example would work without the 16 this ticket would rather be about my example sin(1+4*x^2)---it should simply work like series() and give back one instead of SR.

The rest of the ticket concerns possibly missing functions and I will move this to another ticket.

@kcrisman
Copy link
Member

comment:3

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 PowerSeries), so yes, if your last example would work without the 16 this ticket would rather be about my example sin(1+4*x^2)---it should simply work like series() and give back one instead of SR.

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.

@rwst

This comment has been minimized.

@rwst
Copy link
Author

rwst commented Apr 22, 2014

comment:4

I wrote earlier:

The rest of the ticket concerns possibly missing functions and I will move this to another ticket.

Nothing missing there except the a.g.m., fortunately.

Replying to @kcrisman:

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.

This is now #16201

What do Mathematica and/or Maple and/or Magma do with this? If there is a standard one could use that.

If I ask for "cosine power series" in Wolfram Alpha I get 1-x<sup>2/2+x</sup>4/24-x<sup>6/720+O(x</sup>7)

@rwst rwst changed the title provide function expansions of power series (from Pari) provide missing function expansions of power series Apr 22, 2014
@rwst
Copy link
Author

rwst commented Apr 22, 2014

comment:5

Edit: my copy of another comment was unrelated so I deleted it

@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@rwst
Copy link
Author

rwst commented Jul 20, 2014

comment:7

Closing as wontfix since all issues mentioned have their own tickets.

@rwst rwst removed this from the sage-6.3 milestone Jul 20, 2014
@kcrisman
Copy link
Member

comment:8

I only see one ticket mentioned. Just for completeness, can you mention them (if there are others)?

@rwst
Copy link
Author

rwst commented Jul 21, 2014

comment:9

Default symbolic expression series precision is #16201, and symbolic agm function is #16202.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants