Ask Your Question

mistake in a indefinite integral

asked 2012-11-19 05:02:30 -0500

mathematicboy gravatar image


I'm trying to compute the integral:


Sage (with version 5.4 and previous ones) tell that the integral is $-\infty$. But the integral converges, and it is is equal to $\frac{\pi\log(2)}8$.

I think this can be a bug. Maybe it is a Maxima issue, but it should be interesting to find where the bug is, and correct it, if possible.

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted

answered 2012-11-19 05:57:03 -0500

calc314 gravatar image

updated 2012-11-19 05:58:25 -0500



I see that p(0) is

1/2*I*polylog(2, -1/2*I + 1/2) - 1/2*I*polylog(2, 1/2*I + 1/2)

which is approximated using p(0).n() to give


When I ask for limit(p(x),x=pi/4), I get the following error in Sage 5.0:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "", line 10, in <module>
    exec compile(u'open("","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("bGltaXQocCh4KSx4PXBpLzQp"),globals())+"\\n"); execfile(os.path.abspath(""))
  File "", line 1, in <module>

  File "/tmp/tmp607wqe/", line 3, in <module>
    exec compile(u'limit(p(x),x=pi/_sage_const_4 )
  File "", line 1, in <module>

  File "/home/sageserver/sage-5.0.1/local/lib/python2.7/site-packages/sage/calculus/", line 1163, in limit
    l = maxima.sr_limit(ex, v, a)
  File "/home/sageserver/sage-5.0.1/local/lib/python2.7/site-packages/sage/interfaces/", line 859, in sr_limit
    raise error
RuntimeError: ECL says: Error executing code in Maxima: atan2: atan2(0,0) is undefined.

But, executing atan2(0,0) gives 0. So, something is wrong here somewhere.

edit flag offensive delete link more


We changed this more recently. `sage: atan2(0,0)` now gives `RuntimeError: arctan2_eval(): arctan2(0,0) encountered`. Which maybe isn't as helpful as it could be...

kcrisman gravatar imagekcrisman ( 2012-11-20 09:56:20 -0500 )edit

I opened #13733 for this.

kcrisman gravatar imagekcrisman ( 2012-11-20 10:07:09 -0500 )edit

Thank you!

mathematicboy gravatar imagemathematicboy ( 2012-11-23 02:01:29 -0500 )edit

answered 2012-11-20 10:00:40 -0500

kcrisman gravatar image

updated 2012-11-20 10:00:53 -0500

In the most recent Maxima, we have

(%i5) display2d:false;

(%o5) false
(%i6) integrate(log(cot(x)-1),x,0,%pi/4);

Is %pi/8 an ?integer?

Is %pi/4 an ?integer?

Is 2*%pi an ?integer?

(%o6) -(%i*(2*li[2](%i+1)-2*li[2](1-%i))+%pi*log(2))/4

which I guess is an improvement over

(%i2) integrate(log(cot(x)-1),x,0,%pi/4);

defint: integral is divergent

So a Maxima upgrade should get closer to fixing this, though the polylogs aren't necessarily going to be evaluated by us immediately.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-11-19 05:02:30 -0500

Seen: 148 times

Last updated: Nov 20 '12