How to integrate $\int \frac{\cos x}{\sqrt{\sin2x}} \,dx$? 
How to integrate $$\int \frac{\cos x}{\sqrt{\sin2x}} \,dx$$ ?

I have:
$$\int \frac{\cos x}{\sqrt{\sin2x}} \,dx = \int \frac{\cos x}{\sqrt{2\sin x\cos x}} \,dx = \frac{1}{\sqrt2}\int \frac{\cos x}{\sqrt{\sin x}\sqrt{\cos x}} \,dx = \frac{1}{\sqrt2}\int \frac{\sqrt{\cos x}}{\sqrt{\sin x}} \,dx = \frac{1}{\sqrt2}\int \sqrt{\frac{\cos x}{\sin x}} \,dx = \frac{1}{\sqrt2}\int \sqrt{\cot x} \,dx \\
t = \sqrt{\cot x} \implies x = \cot^{-1} t^2 \implies \,dx = -\frac{2t\,dt}{1 + t^4}$$
so I have:
$$-\sqrt2 \int \frac{t^2 \,dt}{1 + t^4}$$
I tried partial integration on that but it just gets more complicated. I also tried the substitution $t = \tan \frac{x}{2}$ on this one: $\frac{1}{\sqrt2}\int \sqrt{\frac{\cos x}{\sin x}} \,dx$
$$= \frac{1}{\sqrt2}\int \sqrt{\frac{\frac{1 - t^2}{1 + t^2}}{\frac{2t}{1+t^2}}} \frac{2\,dt}{1+t^2} = \frac{1}{\sqrt2}\int \sqrt{\frac{1 - t^2}{2t}}  \frac{2\,dt}{1+t^2} = \int \sqrt{\frac{1 - t^2}{t}}  \frac{\,dt}{1+t^2}$$
... which doesn't look very promising.
Any hints are appreciated! 
 A: I have a half answer (exactly as you did).
Put $\sin 2x=2\sin x\cos x$. Then you integral is:
$$\int\dfrac{\cos x}{\sqrt{2\sin x }\sqrt{\cos x}}dx=\int\dfrac{\sqrt{\cos x}}{\sqrt{2\sin x }}dx=\dfrac{\sqrt{2}}{2}\int\sqrt{\cot x}\,dx.$$
For the second half of the answer, see this
A: Having it the form of one polynomial divided by another should suggest one method, ugly though it may be: partial fractions.  We have $1+t^4=1+2t^2+t^4-2t^2=(t^2+1-t\sqrt2)(t^2+1+t\sqrt2)$
A: In fact you have 
$$\frac{x^2}{x^4+1}=\frac{1}{2\sqrt{2}}(
\frac{x+1}{x^2-\sqrt{2}{x+1}}-\frac{x+1}{x^2+\sqrt{2}{x+1}})$$
now you can continue to integrate and get some log and arctan terms.
A: $\newcommand{\+}{^{\dagger}}
 \newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
 \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\down}{\downarrow}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\fermi}{\,{\rm f}}
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\isdiv}{\,\left.\right\vert\,}
 \newcommand{\ket}[1]{\left\vert #1\right\rangle}
 \newcommand{\ol}[1]{\overline{#1}}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\sech}{\,{\rm sech}}
 \newcommand{\sgn}{\,{\rm sgn}}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}
 \newcommand{\wt}[1]{\widetilde{#1}}$
$\ds{}$
\begin{align}
&\int{\cos\pars{x} \over \root{\sin\pars{2x}}}\,\dd x
=\pm\,{1 \over \root{2}}\
\overbrace{\int{\cos^{1/2}\pars{x} \over \sin^{1/2}\pars{x}}\,\dd x}
^{\ds{\mbox{Set}\ t \equiv \sin\pars{x}}}\ =\
\pm\,{\root{2} \over 2}\
\overbrace{\int t^{-1/2}\pars{1 - t^{2}}^{-1/4}\,\dd t}^{\ds{t \equiv y^{1/2}}}
\\[3mm]&=\pm\,{\root{2} \over 4}\int y^{-3/4}\pars{1 - y}^{-1/4}\,\dd y
\\[5mm]&\mbox{which can be related to a Beta Function for some 'nice' limits.}
\end{align}
A: Note $\int \frac{t^2}{t^4+1}dt=\int \frac{1}{t^2+\frac{1}{t^2}}dt$
$=\frac{1}{2}(\int \frac{1-\frac{1}{t^2}}{t^2+\frac{1}{t^2}}dt+\int \frac{1+\frac{1}{t^2}}{t^2+\frac{1}{t^2}}dt)$
Now notice $t^2+\frac{1}{t^2}=(t+\frac{1}{t})^2-2=(t-\frac{1}{t})^2+2$
THus for the firs integral take $v=t+\frac{1}{t}$ and the second $u=t-\frac{1}{t}$
So it becomes
$\frac{1}{2} (\int \frac{dv}{v^2-2}+ \int \frac{du}{u^2+2})$
Which is an ln and arctan
A: $$I=\int \frac{\cos x}{\sqrt{2\sin x\cos x}}dx$$
$$I=\int \frac{\cos x}{\sqrt{(sin x+\cos x)^2-1}}dx=\int \frac{\cos x}{\sqrt{1-(\sin x-\cos x)^2}}dx$$
$$2I=\frac12\left[ \int \frac{\cos x-\sin x}{\sqrt{(sin x+\cos x)^2-1}}dx +\int \frac{\cos x+\sin x}{\sqrt{1-(\sin x-\cos x)^2}}dx\right]$$
$$I=\frac14\left[ \int \frac{d(\sin x+\cos x)}{\sqrt{(sin x+\cos x)^2-1}} +\int \frac{d(\sin x-\cos x)}{\sqrt{1-(\sin x-\cos x)^2}}\right]$$
$$I=\frac14\left[ \cosh^{-1}(\sin x+\cos x)+\sin^{-1}(\sin x-\cos x) \right]$$
A: $\displaystyle\int\frac{cosxdx}{\sqrt{sin2x}}=\frac{1}{\sqrt{2}}\int\sqrt{\frac{cosx}{sinx}}dx=\frac{1}{\sqrt{2}}\int\sqrt{\cot{x}}dx$
$\displaystyle z^{2}=\cot{x}\Rightarrow 2zdz=-(1+z^{2})dx$
$\displaystyle\frac{1}{\sqrt{2}}\int\frac{2z^{2}dz}{1+z^{2}}=\sqrt{2}\int(1-\frac{1}
{1+z^{2}})dz=\sqrt{2}\left( z-\arctan{z} \right)+c$
$\displaystyle\int\frac{cosxdx}{\sqrt{sin2x}}=\sqrt{2}(\sqrt{\cot{x}}-\arctan\sqrt{\cot{x}})+c$
