[Math] Integral of $\csc(x)$

calculusintegration

I'm getting a couple of different answers from different sources, so I'd like to verify something.

I misplaced my original notes from my prof, but working from memory I have the following:

\begin{align}
\int\csc(x)\ dx&=\int\csc(x)\left(\frac{\csc(x)-\cot(x)}{\csc(x)-\cot(x)}\right)\ dx\\
&=\int\frac{\csc^{2}(x)-\csc(x)\cot(x)}{\csc(x)-\cot(x)}\ dx\\
&=\int\frac{1}{u}\ du\\
&=\ln|u|+C\\
&=\ln|\csc(x)-\cot(x)|+C
\end{align}

This looks proper when I trace it, but wolfram alpha is saying that the answer should be

$$-\ln|\csc(x)+\cot(x)|+C$$

Sadly, it doesn't provide a step-by-step. It just says that's the answer.

So which is it? Or are they both equivalent? I've never been great with the laws of logarithms.

Best Answer

Start with the identity

$$(\csc x-\cot x)(\csc x+\cot x)=\csc^2x-\cot^2x=1\;;$$

this implies that

$$|\csc x-\cot x|\cdot|\csc x+\cot x|=|\csc^2x-\cot^2x|=1\;.$$

Now use the fact that if $a,b>0$ and $ab=1$, then $\ln a+\ln b=\ln 1=0$, so $\ln a=-\ln b$ to conclude that

$$\ln|\csc x-\cot x|=-\ln|\csc x+\cot x|\;,$$

and the two answers are the same.

Related Question