Ask Your Question

Is this a known bug with integral()

asked 2015-10-17 17:01:02 +0200

Julien gravatar image

I've tried to compute the following integral wth integral() in a SageMathCloud worksheet: $\displaystyle \int_{-\pi/6}^{\pi/6}\frac{\cos x}{1+\sin x}dx$.

The output was an error message (saying the integral is divergent), just like the one I got in SageMathCell (see link):

So I tried with integrate() and with numerical_integral() as well. I was never able to obtain the value of this integral, which turns out to be $\ln(3)$ after an obvious substitution.

Is this a bug?

Note that replacing 1 by 1.1 yields this:

while we get that when replacing 1 by 2:

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2015-10-17 19:46:02 +0200

FrédéricC gravatar image

Maxima is apparently not able to do that, but sympy can:

sage: integral(cos(x)/(1+sin(x)),(x,-pi/6,pi/6),algorithm='sympy')
edit flag offensive delete link more



log(2) + log(3/2)

Karn3003 gravatar imageKarn3003 ( 2020-02-27 17:41:06 +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

1 follower


Asked: 2015-10-17 17:01:02 +0200

Seen: 428 times

Last updated: Oct 17 '15