Wrong indefinte integral

61 views
Skip to first unread message

Johannes Lippmann

unread,
Jul 17, 2015, 5:01:52 AM7/17/15
to sage-s...@googlegroups.com
Hello,

Problem:

Sage 6.7 returns for

integrate(x/(x^2+1),(x,0,infinity))

the result 0. This is obviously wrong, since x/(x^2+1) is positive betwwen 0 and Infinity.

What I found out by now:


I couldn't reproduce the error with any simpler function.


The antiderivate of the function is calculated correctly with

integrate(x/(x^2+1),x)

as 1/2*log(x^2 + 1). Manualy entering the values 0 and Infinity there gives the correct result.





What should I do now?

Dima Pasechnik

unread,
Jul 17, 2015, 5:55:00 AM7/17/15
to sage-s...@googlegroups.com
Wrong subject line:
it's a problem with improper definite integrals, not indefinite integrals...

Ralf Stephan

unread,
Jul 18, 2015, 3:15:39 AM7/18/15
to sage-s...@googlegroups.com
On Friday, July 17, 2015 at 11:01:52 AM UTC+2, Johannes Lippmann wrote:
What should I do now?

If the (default) Maxima subroutine does not satisfy, always try SymPy:

sage: integrate(x/(x^2+1),(x,0,infinity),algorithm='sympy')
+Infinity

Maxima when started without Sage says:

(%i1) integrate(x/(x^2+1),x,0,+inf);
defint
: integral is divergent.

so you found an error in Sage's interface to Maxima.

Dima Pasechnik

unread,
Jul 18, 2015, 3:31:07 AM7/18/15
to sage-s...@googlegroups.com
no, the bug is in the Maxima's version currently bundled with Sage (or in its combination with the Lisp compiler ECL).

$ sage --maxima
;;; Loading #P"/home/dima/software/sage/local/lib/ecl/sb-bsd-sockets.fas"
;;; Loading #P"/home/dima/software/sage/local/lib/ecl/sockets.fas"
;;; Loading #P"/home/dima/software/sage/local/lib/ecl/defsystem.fas"
;;; Loading #P"/home/dima/software/sage/local/lib/ecl/cmp.fas"
Maxima 5.35.1 http://maxima.sourceforge.net
using Lisp ECL 13.5.1
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) integrate(x/(x^2+1),x,0,+inf);
(%o1)                                  0
(%i2)


 

Dima Pasechnik

unread,
Jul 18, 2015, 5:28:48 AM7/18/15
to sage-s...@googlegroups.com
we should upgrade ECL and/or Maxima:

$ maxima
;;; Loading #P"/home/dima/lib/ecl-15.3.7/sb-bsd-sockets.fas"
;;; Loading #P"/home/dima/lib/ecl-15.3.7/sockets.fas"
;;; Loading #P"/home/dima/lib/ecl-15.3.7/defsystem.fas"
;;; Loading #P"/home/dima/lib/ecl-15.3.7/cmp.fas"
Maxima branch_5_36_base_137_gdd4f836_dirty http://maxima.sourceforge.net
using Lisp ECL 15.3.7

Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) integrate(x/(x^2+1),x,0,+inf);

defint: integral is divergent.
 -- an error. To debug this try: debugmode(true);
(%i2)
 

 

Dima Pasechnik

unread,
Jul 18, 2015, 5:54:47 AM7/18/15
to sage-s...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages