Summation bug in Sage? In Maxima?

96 views
Skip to first unread message

John H Palmieri

unread,
Nov 2, 2016, 3:09:13 PM11/2/16
to sage-support
Sage is not computing a particular infinite sum correctly.

sage: sum(1/((n+1)*(2*n-1)), n, 0, 1000).n()
-0.205068171626375
sage: sum(1/((n+1)*(2*n-1)), n, 0, 10000).n()
-0.204618542543703
sage: sum(1/((n+1)*(2*n-1)), n, 0, 100000).n()  # seems to be converging
-0.204573546255870
sage: sum(1/((n+1)*(2*n-1)), n, 0, oo).n()      # but not to this number
-1.09345743518226

sage: sum(1/((n+1)*(2*n-1)), n, 0, oo)
2/3*log(2) - 14/9

I think the answer should be 2/3*log(2) - 2/3 -- that's what Mathematica says, and it is also consistent with the partial sums. (See https://ask.sagemath.org/question/35354/sage-seems-to-be-improperly-computing-an-infinite-sum-and-giving-an-incorrect-answer/.) Is this a bug in Maxima? I don't know enough about Maxima's syntax to evaluate it directly there. Just for kicks, I also installed "giac", since that was listed as an option for the "algorithm" keyword for "sum":

sage: sum(1/((n+1)*(2*n-1)), n, 0, oo, algorithm='giac')
+Infinity

Not an improvement.

--
John

Dima Pasechnik

unread,
Nov 2, 2016, 7:06:45 PM11/2/16
to sage-support
It is a bug in Maxima (I also checked with Maxima compiled with SBCL, another lisp compiler, more popular than ECL we use). I think it does not pay attention
to the 0th term being negative.
Indeed, if you sum from 1, not from 0, it correctly
outputs (2 log(2)+1)/3.

Dima

Dima Pasechnik

unread,
Nov 2, 2016, 7:17:00 PM11/2/16
to sage-support

John H Palmieri

unread,
Nov 2, 2016, 9:14:11 PM11/2/16
to sage-support
Thanks. The Sage trac ticket is https://trac.sagemath.org/ticket/21801 (thanks to kcrisman).

  John
Message has been deleted
Message has been deleted

bernardp...@gmail.com

unread,
Nov 3, 2016, 6:13:45 AM11/3/16
to sage-support
Probably for the same reason as maxima, the singularity n=1/2 inside the summation domain, if you start at 1 the answer is correct. Now fixed in geogebra svn and in xcas offline
http://www-fourier.ujf-grenoble.fr/%7eparisse/xcasen.html#+normal(sum(1/((n+1)*(2*n-1)),n,0,inf)&

Reply all
Reply to author
Forward
0 new messages