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?

If in the last integral you substitute $t=\frac{1}{\sqrt{2}}\cosh z$, you end with:
$$ I = \frac{1}{\sqrt{2}}\int\frac{1}{\frac{\cosh^2 z}{2}-1}dz=-\operatorname{arctanh}(\sqrt{2}\tanh z)=-\operatorname{arctanh}\left(\sqrt{2-\frac{1}{t^2}}\right).$$
