Evaluate $I=\int\frac{{\sqrt{\cos{2x}}}}{\sin{x}}dx$




Solution:

\begin{equation*}
I=\int\frac{{\sqrt{\cos{2x}}}}{\sin{x}}dx........(1)
\end{equation*}
to evaluate this,we first use trigonometric identities and then integrate, although there are many ways to integrate this, but i will just use the method i feel is simple for me.
now from our trigonometric identities we know that $\cos{2x}=1-2\sin^2{x}$, now substitute this into the numerator of eqn.(1) which wil yield.
\begin{align*}
&I=\int\frac{{\sqrt{1-2\sin^{2}{x}}}}{\sin{x}}dx\\
&\text{we can rewrite this as}\\
&=\int\sqrt{\frac{1-2\sin^{2}{x}}{\sin^{2}{x}}}dx\\
&=\int\sqrt{\frac{1}{\sin^{2}{x}}-\frac{2\sin^2{x}}{\sin^2{x}}}dx\\
&\int\sqrt{\frac{1}{\sin^2{x}}-2}dx\ \text{note}\ \frac{1}{\sin^2{x}}=\text{cosec}^2{x}\\
&\text{hence}\ I=\int\sqrt{cosec^2{x}-2}dx.......(2)\\
\end{align*}
we are approaching a simpler function but here we are not going to just use the u-substitution method because we might have some uncertainties if we do that,so we use logic to simplify further.
Let $I=\int\sqrt{cosec^2{x}-2}dx$ become a rational function by making $cosec^2{x}-2$ the numerator. this is what i am saying
\begin{equation*}
\int\frac{cosec^2{x}-2}{\sqrt{cosec^2{x}-2}}dx
\end{equation*} this is still the same as $I=\int\sqrt{cosec^2{x}-2}dx$, now we split the newly formed rational function.
\begin{align*}
&\int\frac{cosec^2{x}-2}{\sqrt{cosec^2{x}-2}}dx=\int\frac{cosec^2{x}}{\sqrt{cosec^2{x}-2}}dx-2\int\frac{1}{\sqrt{cosec^2{x}-2}}....(3)\\
&\text{and this allows us to put}\ I=I_1-2I_2...........(4),\text{we first integrate} I_1\\
&I_1=\int\frac{cosec^2{x}}{\sqrt{cosec^2{x}-2}}dx\\
&\text{remember}\ cosec^2{x}=1+\cot^2{x}\\
&\int\frac{cosec^2{x}}{\sqrt{cosec^2{x}-2}}dx=\int\frac{cosec^2{x}}{\sqrt{1+\cot^2{x}-2}}dx\\
&=\int\frac{cosec^2{x}}{\sqrt{cot^2{x}-1}}dx.........(5)\\
&\text{put}\ \cot{x}=t\ \text{and differentiate both sides then substitute dx and}\ cosec^2{x}\ \text{into eqn(5)}\\
&-cosec^2{x}dx=dt\\
&=-\int\frac{dt}{\sqrt{t^2-1}},\text{now use special integration to integrate it}\\
&=-\log|t+\sqrt{t^2-1}|+c_1\\
&I_1=-\log|\cot{x}+\sqrt{\cot^2{x}-1}|+c_1
\end{align*}
and thats the solution to the first part $I_1$.
Now we proceed to $I_2=\int\frac{dx}{\sqrt{cosec^2{x}-2}}dx.......(7)$
this is the same as \begin{align*}
&\int\frac{dx}{\sqrt{\frac{1}{\sin^2{x}}-2}}=\int\frac{dx}{\sqrt{\frac{1-2\sin^2{x}}{\sin^2{x}}}}=\int\sqrt{\frac{\sin^2{x}}{\cos{2x}}}dx\\
&=\int\frac{\sin{x}dx}{\sqrt{2\cos^2{x}-1}}..........(8)\\
&\text{let}\ \cos{x}=y\Rightarrow{-\sin}{x}dx=dy,\ \text{substitute into (8)}.\\
&\Rightarrow -\int\frac{dy}{\sqrt{2y^2-1}}=\frac{-1}{\sqrt{2}}\int\frac{dy}{\sqrt{y^2-(\frac{1}{\sqrt{2}})^2}}\\
&\text{Apply special integration}\\
&=\frac{-1}{\sqrt{2}}\log|y+\sqrt{y^2-\frac{1}{2}}|+c_2\\
&=\frac{-1}{\sqrt{2}}\log|\cos{x}+\sqrt{\cos^2{x}-\frac{1}{2}}|+c_2.............(9)\\
\end{align*}
Hence that concludes $I_2$.
Now $I=I_1-2I_2$ can be written as
\begin{equation*}
\therefore I=-\log|\cot{x}+\sqrt{\cot^2{x}-1}|+\sqrt{2}\log|\cos{x}+\sqrt{\cos^2{x}-\frac{1}{2}}|+c
\end{equation*}
remember that $c=c_1-2c_2$....
done!!!