# Wrong indefinte integral

61 views

### Johannes Lippmann

Jul 17, 2015, 5:01:52 AM7/17/15
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

Jul 17, 2015, 5:55:00 AM7/17/15
Wrong subject line:
it's a problem with improper definite integrals, not indefinite integrals...

### Ralf Stephan

Jul 18, 2015, 3:15:39 AM7/18/15
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

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

\$ sage --maxima
Maxima 5.35.1 http://maxima.sourceforge.net
using Lisp ECL 13.5.1
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

Jul 18, 2015, 5:28:48 AM7/18/15
we should upgrade ECL and/or Maxima:

\$ maxima
Maxima branch_5_36_base_137_gdd4f836_dirty http://maxima.sourceforge.net
using Lisp ECL 15.3.7

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)