Opened 11 years ago

Closed 8 years ago

## #11894 closed defect (fixed)

# problems with infinite sum

Reported by: | Thierry Monteil | Owned by: | Burcin Erocal |
---|---|---|---|

Priority: | trivial | Milestone: | sage-6.3 |

Component: | calculus | Keywords: | infinite sum, maxima |

Cc: | Thierry Monteil | Merged in: | |

Authors: | Peter Bruin | Reviewers: | Karl-Dieter Crisman |

Report Upstream: | Fixed upstream, in a later stable release. | Work issues: | |

Branch: | 1dd0f05 (Commits, GitHub, GitLab) | Commit: | 1dd0f05a2421b2ecda14066a0c1dbe4b5bd6f38e |

Dependencies: | #13973, #13712 | Stopgaps: |

### Description

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

### Change History (9)

### comment:1 Changed 11 years ago by

### comment:2 Changed 9 years ago by

Milestone: | sage-5.11 → sage-5.12 |
---|

### comment:3 Changed 9 years ago by

Milestone: | sage-6.1 → sage-6.2 |
---|

### comment:4 Changed 8 years ago by

Milestone: | sage-6.2 → sage-6.3 |
---|

### comment:5 Changed 8 years ago by

Dependencies: | → #13973 |
---|---|

Report Upstream: | N/A → Fixed upstream, in a later stable release. |

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.

### comment:6 follow-up: 7 Changed 8 years ago by

Authors: | → Peter Bruin |
---|---|

Branch: | → u/pbruin/11894-maxima_sum_zero_division |

Commit: | → 1dd0f05a2421b2ecda14066a0c1dbe4b5bd6f38e |

Dependencies: | #13973 → #13973, #13712 |

Priority: | major → trivial |

Status: | new → needs_review |

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.

### comment:7 Changed 8 years ago by

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.

### comment:8 Changed 8 years ago by

Reviewers: | → Karl-Dieter Crisman |
---|---|

Status: | needs_review → positive_review |

### comment:9 Changed 8 years ago by

Branch: | u/pbruin/11894-maxima_sum_zero_division → 1dd0f05a2421b2ecda14066a0c1dbe4b5bd6f38e |
---|---|

Resolution: | → fixed |

Status: | positive_review → closed |

**Note:**See TracTickets for help on using tickets.

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

`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?`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.