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

maxima sum returns hypergeometric function #9908

Closed
haraldschilly opened this issue Sep 14, 2010 · 12 comments
Closed

maxima sum returns hypergeometric function #9908

haraldschilly opened this issue Sep 14, 2010 · 12 comments

Comments

@haraldschilly
Copy link
Member

The parsing of Maxima's output is not good enough to handle this:

var('n')
sum(((2*I)^n/(n^3+1)*(1/4)^n), n, 0, infinity)

gives an exception

TypeError: unable to make sense of Maxima expression 'f[4,3]([1,1,-(sqrt(3)*I+1)/2,(sqrt(3)*I-1)/2],[2,-(sqrt(3)*I-1)/2,(sqrt(3)*I+1)/2],I/2)' in Sage

which is - i think - a f_43 hypergeometric function.

CC: @eviatarbach

Component: symbolics

Keywords: hypergeometric

Reviewer: Karl-Dieter Crisman, Ralf Stephan

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

@haraldschilly
Copy link
Member Author

comment:1

one additional example by omologos on irc:

var('x n')
f=(-1)^n/((2*n+1)*factorial(2n+1))
sum(f,n,0,oo)

but i get this error:

TypeError: unable to make sense of Maxima expression 'f[1,2]([1/2],[3/2,3/2],-1/4)' in Sage

@kcrisman
Copy link
Member

comment:2

This should be

var('x n')
f=(-1)^n/((2*n+1)*factorial(2*n+1))
sum(f,n,0,oo)

If I'm not mistaken, this might be related to #2516, in the sense that we should be parsing hypergeometric functions correctly and that would be part of that ticket.

@eviatarbach
Copy link

comment:4

This also causes a similar problem in #4102:

sage: f = bessel_J(2, x)
sage: f.integrate(x)
Traceback (most recent call last):
...
TypeError: cannot coerce arguments: no canonical coercion from <type 'list'> to Symbolic Ring

In that case, Maxima is returning hypergeometric([3/2],[5/2,3],-x^2/4).

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@kcrisman
Copy link
Member

comment:6

See also http://ask.sagemath.org/question/3091 for another example.

@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@fchapoton
Copy link
Contributor

Changed keywords from none to hypergeometric

@kcrisman
Copy link
Member

comment:9

And see this sage-support thread for possibly another example.

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

kcrisman commented Jul 8, 2014

comment:11

#2516 has all the examples above in it, with the exception of the ones mentioned in the comments.

  • One would want to be able to do
b=var('b')
integral(1/(x^b+1),x)

without using W|A; apparently 1/(a^b+1) would yield 2F1(1,1/a,1+1/a,-a^x).

  • Apparently
sum(x^(3*k)/factorial(2*k),k,0,oo)

would also be doable with hypergeometrics.

@rwst
Copy link

rwst commented Jul 8, 2014

comment:12

Replying to @kcrisman:

#2516 has all the examples above in it, with the exception of the ones mentioned in the comments.

What I get with #2516 is

sage: integral(1/(x^b+1),x)
integrate(1/(x^b + 1), x)
sage: sum(x^(3*k)/factorial(2*k),k,0,oo)
sqrt(pi)*x^(3/4)*sqrt(1/(pi*x^(3/2)))*cosh(x^(3/2))

@kcrisman
Copy link
Member

kcrisman commented Jul 8, 2014

comment:13

What I get with #2516 is

sage: integral(1/(x^b+1),x)
integrate(1/(x^b + 1), x)

Not really worth keeping open, as even Maxima does this.

sage: sum(x^(3*k)/factorial(2*k),k,0,oo)
sqrt(pi)*x^(3/4)*sqrt(1/(pi*x^(3/2)))*cosh(x^(3/2))

Interestingly, this works in vanilla Sage as well. Maybe there weren't any hg functions to begin with there. I assume it was fixed with #16224 - earlier it gave yet another (wrong) answer.

So I nominate to close this ticket.

@kcrisman
Copy link
Member

kcrisman commented Jul 8, 2014

Reviewer: Karl-Dieter Crisman, Ralf Stephan

@kcrisman
Copy link
Member

kcrisman commented Jul 8, 2014

comment:14
sage: sum(x^(3*k)/factorial(2*k),k,0,oo)
sqrt(pi)*x^(3/4)*sqrt(1/(pi*x^(3/2)))*cosh(x^(3/2))

Interestingly, this works in vanilla Sage as well. Maybe there weren't any hg functions to begin with there. I assume it was fixed with #16224 - earlier it gave yet another (wrong) answer.

Even more interestingly, this is not as simple as just cosh(x^(3/2)) (which is correct) but I'm not going to repurpose this one for that.

@rwst
Copy link

rwst commented Jul 8, 2014

comment:15

Practically a duplicate of #2516

@rwst rwst removed this from the sage-6.3 milestone Jul 8, 2014
@vbraun vbraun closed this as completed Jul 8, 2014
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

8 participants