Ask Your Question
2

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

asked 7 years ago

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?

Preview: (hide)

Comments

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

NickBailey gravatar imageNickBailey ( 7 years ago )

1 Answer

Sort by » oldest newest most voted
1

answered 7 years ago

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 cosx1 to get log(1cosx). 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.

Preview: (hide)
link

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 ( 7 years ago )

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: 7 years ago

Seen: 991 times

Last updated: Jan 27 '18