Ask Your Question
2

Difference between integral(csc(x)) and integral(1/sin(x))?

asked 2018-01-27 16:10:05 +0200

NickBailey gravatar image

integral(csc(x),x) gives -log(cot(x) + csc(x)) as expected. integral(1/sin(x),x) gives -1/2log(cos(x) + 1) + 1/2log(cos(x) - 1). Evaluation of the second log is problematic because cos(x)-1 < 0 for all x except n*2pi. Choosing the sympy or maxima algorithms makes no difference.

Also (and this is less reliable) if I perform a substitution t=tan(x/2) by hand in the first case I get ln(t), again as expected. But in the second ln(-t). That maybe my fault but I can't see what I did wrong.

Is there any fundamental difference between asking that same question in two different ways?

edit retag flag offensive close merge delete

Comments

SageMath version 8.1, Release Date: 2017-12-07

NickBailey gravatar imageNickBailey ( 2018-01-27 16:20:48 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-01-27 17:57:52 +0200

dan_fulea gravatar image

The two integrals differ by a constant,

sage: log(-1)
I*pi

and integration is defined only up to a constant. So there is no problem, seen from this point of view. From the point of view of a Mathematical Olympiad -say - there is some problem, since at that level there is no $\log(-1)$, and such a calculus my get negative points, if things are not explained in full detail. As a rule of thumb for such particular cases, one can replace all terms $\log(\ f(x)\ )$ by the corresponding $\log|\ f(x)\ |$ so tht the computations "remain in the school". In our case, "adding the modulus" changes the sign inside the $\log$ of $\cos x-1$ to get $\log(1-\cos x)$. In our case we can then ask sage for

sage: bool( (cot(x)+csc(x))^2 == (1+cos(x)) / (1-cos(x)) )
True

or even better check it with bare hands by the substitution $t=\tan(x/2)$ s in the post.

edit flag offensive delete link more

Comments

And that also exactly explains the change of sign in my rough working of the second form producing ln(-t). Thanks for the quickly supplied and thorough answer.

NickBailey gravatar imageNickBailey ( 2018-01-27 18:35:16 +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

Stats

Asked: 2018-01-27 16:10:05 +0200

Seen: 504 times

Last updated: Jan 27 '18