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

problems with infinite sum #11894

Closed
sagetrac-tmonteil mannequin opened this issue Oct 4, 2011 · 12 comments
Closed

problems with infinite sum #11894

sagetrac-tmonteil mannequin opened this issue Oct 4, 2011 · 12 comments

Comments

@sagetrac-tmonteil
Copy link
Mannequin

sagetrac-tmonteil mannequin commented Oct 4, 2011

A recent post on the number theory list asked to compute the value of the infinite sum of 1/(m^4 + 2m^3 + 3m^2 + 2m)^2 for m between 1 and infinity.

https://listserv.nodak.edu/cgi-bin/wa.exe?A2=ind1109&L=nmbrthry&T=0&P=1149

Trying it to sage :

sage: var('m')
sage: s = sum(1/(m^4 + 2*m^3 + 3*m^2 + 2*m)^2, m, 1, infinity)
sage: s                                                       
1/12*pi^2 + 9/196*I*sqrt(7)*psi(1/14*(3*sqrt(7) - 7*I)*sqrt(7)) - 
9/196*I*sqrt(7)*psi(1/14*(3*sqrt(7) + 7*I)*sqrt(7)) - 1/28*psi(1, 
-1/2*I*sqrt(7) + 3/2) - 1/28*psi(1, 1/2*I*sqrt(7) + 3/2) - 1

The formula is less elegant than the formulas given by people who answered using two proprietary sfotwares, but does not seem false. Sage is not able to regognize it:

sage: bool(s == (-(19/16) + 1/84 * pi^2 * (7 - 3 * sech((sqrt(7) * 
pi)/2)^2) + ( 9 * pi * tanh((sqrt(7) * pi)/2))/(28 * sqrt(7))))
False
sage: bool(s == -19/16 + 1/28*pi^2*tanh(1/2*pi*7^(1/2))^2 + 
9/196*7^(1/2)*pi*tanh(1/2*pi*7^(1/2)) + 1/21*pi^2)
False

It is also not able to take the real part of a real number:

sage: CC(s)
0.0161011600422853
sage: RR(s)
[...]
TypeError: cannot convert -7*I to real number

Moreover, if we let m start to zero, sage does not provide an error but a value:

sage: var('m')
sage: s = sum(1/(m^4 + 2*m^3 + 3*m^2 + 2*m)^2, m, 0, infinity)
sage: s
1/12*pi^2 + 9/196*I*sqrt(7)*psi(1/14*(sqrt(7) - 7*I)*sqrt(7)) - 
9/196*I*sqrt(7)*psi(1/14*(sqrt(7) + 7*I)*sqrt(7)) - 1/28*psi(1, 
-1/2*I*sqrt(7) + 1/2) - 1/28*psi(1, 1/2*I*sqrt(7) + 1/2)
sage: CC(s)
1.20360116004229

Depends on #13973
Depends on #13712

Upstream: Fixed upstream, in a later stable release.

CC: @sagetrac-tmonteil

Component: calculus

Keywords: infinite sum, maxima

Author: Peter Bruin

Branch/Commit: 1dd0f05

Reviewer: Karl-Dieter Crisman

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

@sagetrac-tmonteil sagetrac-tmonteil mannequin added this to the sage-5.11 milestone Oct 4, 2011
@sagetrac-tmonteil sagetrac-tmonteil mannequin assigned burcin Oct 4, 2011
@kcrisman
Copy link
Member

kcrisman commented Oct 4, 2011

comment:1

Hmm, you have quite a few things here. But which of these are a bug, or should be the main focus of this report?

  1. I'm thankful that Maxima provides this for us at all, though of course summation could be better. I assume it is correct if numerically approximated? (I don't know the answer that this should give.)
  2. False just means "can't prove it's True". For this complicated of an expression, it would be very difficult for bool to prove this. Again, could be enhanced, but not a bug. You may wish to see if some of the Maxima simplifications could help with this?
  3. RR does not take the real part of a number. That said, we should have something that checks this, I think, unless there is an arcane reason (in this huge expression) we can't.
  4. Hmm, this would be a bug in Maxima. We do get the correct error without the infinity.
sage: sage: s = sum(1/(m^4 + 2*m^3 + 3*m^2 + 2*m)^2, m, 0, 3)
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
RuntimeError: ECL says: Error executing code in Maxima: Division by 0
I've logged this [as a Maxima bug](https://sourceforge.net/tracker/?func=detail&aid=3418608&group_id=4933&atid=104933).

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@pjbruin
Copy link
Contributor

pjbruin commented May 17, 2014

Dependencies: #13973

@pjbruin
Copy link
Contributor

pjbruin commented May 17, 2014

Upstream: Fixed upstream, in a later stable release.

@pjbruin
Copy link
Contributor

pjbruin commented May 17, 2014

comment:5

The bug in item 4 is fixed upstream and after #13973 the code does correctly raise an error:

sage: sum(1/(m^4 + 2*m^3 + 3*m^2 + 2*m)^2, m, 0, infinity)
#0: simp_gen_harmonic_number(exp__=1,x__=-1)
#1: ratfun_to_psi(ratfun=1/(m^8+4*m^7+10*m^6+16*m^5+17*m^4+12*m^3+4*m^2),var=m,lo=0,hi=inf)
#2: simplify_sum(expr='sum(1/(m^4+2*m^3+3*m^2+2*m)^2,m,0,inf))
...
RuntimeError: ECL says: Error executing code in Maxima: Zero to negative power computed.

@pjbruin
Copy link
Contributor

pjbruin commented May 29, 2014

comment:6

Here is a doctest. The dependence on #13712 is because the test is inserted directly after the one there.

Points 2 and 3 have in my opinion been answered in comment:1. Point 1 (the result could be simplified more nicely) is something that should be done in Maxima (simplify certain sums of two polygamma functions to trigonometric functions), so I think it shouldn't be an obstacle to closing this ticket.

@pjbruin
Copy link
Contributor

pjbruin commented May 29, 2014

Commit: 1dd0f05

@pjbruin
Copy link
Contributor

pjbruin commented May 29, 2014

Author: Peter Bruin

@pjbruin
Copy link
Contributor

pjbruin commented May 29, 2014

@pjbruin
Copy link
Contributor

pjbruin commented May 29, 2014

Changed dependencies from #13973 to #13973, #13712

@kcrisman
Copy link
Member

comment:7

Points 2 and 3 have in my opinion been answered in comment:1. Point 1 (the result could be simplified more nicely) is something that should be done in Maxima (simplify certain sums of two polygamma functions to trigonometric functions), so I think it shouldn't be an obstacle to closing this ticket.

Yes, that was essentially my point then. In principle that could be another ticket but I'm not worried about it.

@kcrisman
Copy link
Member

Reviewer: Karl-Dieter Crisman

@vbraun
Copy link
Member

vbraun commented Jun 2, 2014

Changed branch from u/pbruin/11894-maxima_sum_zero_division to 1dd0f05

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

5 participants