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

RuntimeError with series #8943

Closed
sagetrac-casamayou mannequin opened this issue May 10, 2010 · 10 comments
Closed

RuntimeError with series #8943

sagetrac-casamayou mannequin opened this issue May 10, 2010 · 10 comments

Comments

@sagetrac-casamayou
Copy link
Mannequin

sagetrac-casamayou mannequin commented May 10, 2010

The function series can not give the power series expansion of f(x)=(1+arctan(x))**(1/x) , while taylor succeeds. Note that the function f can be continuously extended at 0.

sage: taylor((1+arctan(x))**(1/x), x, 0, 3)
1/16*x^3*e + 1/8*x^2*e - 1/2*x*e + e
sage: ((1+arctan(x))**(1/x)).series(x==0, 3)
RuntimeError: power::eval(): division by zero

Subsidiary question: why the functions taylor and series perform similar tasks, but differently?

Depends on #11317

Component: calculus

Keywords: series, taylor

Author: Alexei Sheplyakov, Burcin Erocal

Reviewer: Karl-Dieter Crisman

Merged: sage-4.7.1.alpha1

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

@sagetrac-casamayou sagetrac-casamayou mannequin added this to the sage-4.7 milestone May 10, 2010
@sagetrac-casamayou

This comment has been minimized.

@kcrisman
Copy link
Member

comment:2

Looks like this is in Ginac/Pynac. But maybe it makes sense not to have an answer here? After all, the technical definition would imply that f doesn't have a Taylor series there, if it doesn't even exist. Probably Maxima is more lenient about such things.

@burcin
Copy link

burcin commented May 8, 2011

Author: Alexei Sheplyakov, Burcin Erocal

@burcin
Copy link

burcin commented May 8, 2011

comment:3

Attachment: trac_8943-series.patch.gz

This was fixed upstream in ginac. The changes will be in the next pynac release. Patch with doctest is attached.

@burcin
Copy link

burcin commented May 9, 2011

comment:4

New pynac package with the fix is at #11317.

@burcin
Copy link

burcin commented May 9, 2011

Dependencies: 11317

@kcrisman
Copy link
Member

kcrisman commented May 9, 2011

comment:5

This is nice, and the other examples given by the author also did not work before but now do:

sage: (cos(x)^(sin(x)/x)).series(x==0,9)
1 + (-1/2)*x^2 + 1/8*x^4 + (-1/30)*x^6 + 631/120960*x^8 + Order(x^9)
sage: ((1+x)^(1/x)).series(x==0,9)
(e) + (-1/2*e)*x + (11/24*e)*x^2 + (-7/16*e)*x^3 + (2447/5760*e)*x^4 + (-959/2304*e)*x^5 + (238043/580608*e)*x^6 + (-67223/165888*e)*x^7 + (559440199/1393459200*e)*x^8 + Order(x^9)

Also, the new series does correctly approximate the original function near x=0 :)

@kcrisman
Copy link
Member

kcrisman commented May 9, 2011

Reviewer: Karl-Dieter Crisman

@jdemeyer
Copy link

Changed dependencies from 11317 to #11317

@jdemeyer jdemeyer modified the milestones: sage-4.7, sage-4.7.1 May 10, 2011
@jdemeyer
Copy link

Merged: sage-4.7.1.alpha1

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