Ask Your Question
1

mistake in a indefinite integral

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

mathematicboy gravatar image

updated 2019-08-29 11:26:41 -0600

FrédéricC gravatar image

Hi,

I'm trying to compute the integral:

integral(log(cot(x)-1),x,0,pi/4)

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
0

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

kcrisman gravatar image

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

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?

n;
Is %pi/4 an ?integer?

n;
Is 2*%pi an ?integer?

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

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
1

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

calc314 gravatar image

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

Using

p(x)=integral(log(cot(x)-1),x)

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

0.643767332889269

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 "_sage_input_12.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("bGltaXQocCh4KSx4PXBpLzQp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>

  File "/tmp/tmp607wqe/___code___.py", 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/calculus.py", 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/maxima_lib.py", 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

Comments

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 -0600 )edit

I opened #13733 for this.

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

Thank you!

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

Your Answer

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

Add Answer

Question Tools

Stats

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

Seen: 180 times

Last updated: Nov 20 '12