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?

\begin{align}
\int\frac{\sqrt{\cos 2x}}{\sin x}\ dx&=\int\frac{\sqrt{\cos^2x-\sin^2x}}{\sin x}\ dx\\
&\stackrel{\color{red}{[1]}}=\int\frac{\sqrt{t^4-6t^2+1}}{t^3+t}\ dt\\
&\stackrel{\color{red}{[2]}}=\frac12\int\frac{\sqrt{u^2-6u+1}}{u^2+u}\ du\\
&\stackrel{\color{red}{[3]}}=\int\frac{(y^2-6y+1)^2}{(y-1)(y-3)(y+1)(y^2+2t-7)}\ dy\\
&\stackrel{\color{red}{[4]}}=\int\left[\frac1{y-1}+\frac1{y-3}-\frac1{y+1}-\frac{16}{y^2+2y-7}\right]\ dt\\
&=\int\left[\frac1{y-1}+\frac1{y-3}-\frac1{y+1}-\frac{16}{(y+1)^2-8}\right]\ dt
\end{align}
The rest is yours.

Notes :
$\color{red}{[1]}\;\;\;$Use Weierstrass substitution, $\tan\left(\dfrac{x}{2}\right)=t$.
$\color{red}{[2]}\;\;\;$Use substitution $u=t^2$.
$\color{red}{[3]}\;\;\;$Use Euler substitution, $y-u=\sqrt{u^2-6u+1}\;\color{blue}{\Rightarrow}\;y=\dfrac{u^2-1}{2u-6}$.
$\color{red}{[4]}\;\;\;$Use partial fractions decomposition.
