Ask Your Question
1

mistake in a indefinite integral

asked 2012-11-19 12:02:30 +0200

mathematicboy gravatar image

updated 2019-08-29 18:26:41 +0200

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 17:00:40 +0200

kcrisman gravatar image

updated 2012-11-20 17:00:53 +0200

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 12:57:03 +0200

calc314 gravatar image

updated 2012-11-19 12:58:25 +0200

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 16:56:20 +0200 )edit

I opened #13733 for this.

kcrisman gravatar imagekcrisman ( 2012-11-20 17:07:09 +0200 )edit

Thank you!

mathematicboy gravatar imagemathematicboy ( 2012-11-23 09:01:29 +0200 )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 12:02:30 +0200

Seen: 371 times

Last updated: Nov 20 '12