Evaluation of $\int\frac{\sqrt{\cos 2x}}{\sin x}\,dx$ 
Compute the indefinite integral
  $$
\int\frac{\sqrt{\cos 2x}}{\sin x}\,dx
$$

My Attempt:
$$
\begin{align}
\int\frac{\sqrt{\cos 2x}}{\sin x}\,dx &= \int\frac{\cos 2x}{\sin^2 x\sqrt{\cos 2x}}\sin xdx\\
&= \int\frac{2\cos^2 x-1}{(1-\cos^2 x)\sqrt{2\cos^2 x-1} }\sin x \,dx
\end{align}
$$
Let $\cos x = t$, so that $\sin x\,dx = -dt$. This changes the integral to
$$
\begin{align}
\int\frac{(2t^2-1)}{(t^2-1)\sqrt{2t^2-1}}\,dt &= \int\frac{(2t^2-2)+1}{(t^2-1)\sqrt{2t^2-1}}\,dt\\
&= 2\int\frac{dt}{\sqrt{2t^2-1}}+\int \frac{dt}{(t^2-1)\sqrt{2t^2-1}}
\end{align}
$$
How can I solve the integral from here?

The magic appears when performing the change $u=\dfrac{\cos(x)}{\sqrt{\cos(2x)}}$ due to the fact that there is $\sin(x)$ on denominator.
The integral is changed to $I=\displaystyle\int\dfrac {\mathop{du}}{(u^2-1)(2u^2-1)}\quad$ with not square root anymore.
Now it is just $\dfrac 1{u^2-1}-\dfrac{2}{2u^2-1}$ 
And $$I=\sqrt{2}\operatorname{argth}(\sqrt{2}\,u)-\operatorname{argth}(u)$$
Note: $\operatorname{argth}=\tanh^{-1}$
