What is $\int \sqrt{\cos(2Q)} / {\sin(Q)} \,\mathrm{d}Q$? 
What is
  $$
  \int \frac{\sqrt{\cos(2Q)}}{\sin(Q)} \,\mathrm{d}Q?
$$

I have tried all the method which is possible but could not able to find the solution. Can anyone please tell me the solution of this problem.
 A: First notice that 
\begin{equation}
\cos\left(2x\right)=\cos^2\left(x\right)-\sin^2\left(x\right)
\end{equation}
and
\begin{equation}
 \sin\left(x\right)=\dfrac{\tan\left(x\right)}{\sec\left(x\right)}
\end{equation}
so
\begin{equation}
 {\displaystyle\int}\dfrac{\sqrt{\cos\left(2x\right)}}{\sin\left(x\right)}\,\mathrm{d}x
 ={\displaystyle\int}
 \sec^2(x) \cdot{{\dfrac{\sqrt{1-\tan^2\left(x\right)}}{\tan\left(x\right)\left(\tan^2\left(x\right)+1\right)}}}\,\mathrm{d}x
\end{equation}
Change of variable as 
\begin{equation}
 u = \tan (x)
\end{equation}
we get
\begin{equation}
  {\displaystyle\int}\dfrac{\sqrt{\cos\left(2x\right)}}{\sin\left(x\right)}\,\mathrm{d}x
={\displaystyle\int}\dfrac{\sqrt{1-u^2}}{u\left(u^2+1\right)}\,\mathrm{d}u 
\end{equation}
Another change of variable as 
\begin{equation}
 v = \sqrt{1 - u^2}
\end{equation}
gives us 
\begin{equation}
  {\displaystyle\int}\dfrac{\sqrt{\cos\left(2x\right)}}{\sin\left(x\right)}\,\mathrm{d}x
=-{\displaystyle\int}\dfrac{v^2}{\left(v^2-2\right)\left(v^2-1\right)}\,\mathrm{d}v
\end{equation}
Now let's factor the denominator as 
\begin{equation}
  {\displaystyle\int}\dfrac{\sqrt{\cos\left(2x\right)}}{\sin\left(x\right)}\,\mathrm{d}x
={\displaystyle\int}\dfrac{v^2}{\left(v-1\right)\left(v+1\right)\left(v^2-2\right)}\,\mathrm{d}v
\end{equation}
Then perform partial fraction decomposition
\begin{equation}
{\displaystyle\int}\dfrac{\sqrt{\cos\left(2x\right)}}{\sin\left(x\right)}\,\mathrm{d}x
 ={\displaystyle\int}\left(\dfrac{2}{v^2-2}+\dfrac{1}{2\left(v+1\right)}-\dfrac{1}{2\left(v-1\right)}\right)\mathrm{d}v
 =
 2A + \frac{1}{2}B - \frac{1}{2} C
\end{equation}
Let's do $A$, 
\begin{equation}
 A = {\displaystyle\int}\dfrac{1}{v^2-2}\,\mathrm{d}v
 =
 ={\displaystyle\int}\dfrac{1}{\left(v-\sqrt{2}\right)\left(v+\sqrt{2}\right)}\,\mathrm{d}v
 ={\displaystyle\int}\left(\dfrac{1}{2^\frac{3}{2}\left(v-\sqrt{2}\right)}-\dfrac{1}{2^\frac{3}{2}\left(v+\sqrt{2}\right)}\right)\mathrm{d}v
\end{equation}
which s
\begin{equation}
 A
 =
 =\dfrac{\ln\left(v-\sqrt{2}\right)}{2^\frac{3}{2}}-\dfrac{\ln\left(v+\sqrt{2}\right)}{2^\frac{3}{2}}
\end{equation}
Now, similarly 
\begin{equation}
 B =\ln\left(v+1\right)
\end{equation}
and
\begin{equation}
 C =\ln\left(v-1\right)
\end{equation}
Plugging all $A,B,C$ back we get 
\begin{equation}
{\displaystyle\int}\dfrac{\sqrt{\cos\left(2x\right)}}{\sin\left(x\right)}\,\mathrm{d}x
 =-\dfrac{\ln\left(v+\sqrt{2}\right)}{\sqrt{2}}+\dfrac{\ln\left(v-\sqrt{2}\right)}{\sqrt{2}}+\dfrac{\ln\left(v+1\right)}{2}-\dfrac{\ln\left(v-1\right)}{2}
\end{equation}
Undoing the change of variable $v = \sqrt{1 - u^2}$, we get
\begin{equation}
 {\displaystyle\int}\dfrac{\sqrt{\cos\left(2x\right)}}{\sin\left(x\right)}\,\mathrm{d}x=\dfrac{\ln\left(\sqrt{1-u^2}+\sqrt{2}\right)}{\sqrt{2}}-\dfrac{\ln\left(\sqrt{1-u^2}-\sqrt{2}\right)}{\sqrt{2}}-\dfrac{\ln\left(\sqrt{1-u^2}+1\right)}{2}+\dfrac{\ln\left(\sqrt{1-u^2}-1\right)}{2}
\end{equation}
Undoing the other change of variable $u = \tan (x)$, we get
\begin{equation}
\dfrac{\ln\left(\sqrt{1-\tan^2\left(x\right)}+\sqrt{2}\right)}{\sqrt{2}}-\dfrac{\ln\left(\sqrt{1-\tan^2\left(x\right)}-\sqrt{2}\right)}{\sqrt{2}}-\dfrac{\ln\left(\sqrt{1-\tan^2\left(x\right)}+1\right)}{2}+\dfrac{\ln\left(\sqrt{1-\tan^2\left(x\right)}-1\right)}{2}
\end{equation}
Now, depending where you're integrating, you've got to have absolute values in the arguments of the logarithms.
