# 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!

• The solution seems to be pretty involved and messy: perhaps "doesn't look very promising" is the best you can expect here. – DonAntonio Jun 4 '14 at 1:44

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)$

• I understand that $t^4 - 2t^2 = (t^2 - \sqrt2 t)(t^2 + \sqrt2 t)$ but how do I know that I have to add +1 in both parentheses to get the desired expression? I see that the factorization is correct but I fail to understand how exactly did you do that. It doesn't look you just "guessed" it. Can you give me any advice on how to do such factorizations (I understand that there is no universal algorithm...)? – AltairAC Jun 4 '14 at 16:54
• @Shirohige Typically, when you complete the square, you look at your $x^2$ term and your $x$ term, then calculate what the constant term should be. In this case, I took the $t^4$ term and the constant term and worked out the middle term. I then factored the result as the difference of 2 squares. – Mike Jun 4 '14 at 18:27
• I think I got it, the "middle" step is $... = (t^2 + 1)^2 - (\sqrt 2 t)^2 = ...$ – AltairAC Jun 4 '14 at 22:17

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

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.

• Wolfram-motivated? – chubakueno Jun 4 '14 at 3:29
• Hell no. I dont even know how to use wolfram. I feel there in generally too much reliance on machine integration, its important to understand the general theory. I am interested in formulas I can develop myself. – Rene Schipperus Jun 4 '14 at 3:34
• Well, I was just asking because of that unnatural(?) factorisation. So, what motivated you to fator it like that? Was it that you had seen it previously, or you just tried to put the partial fraction idea forward? – chubakueno Jun 4 '14 at 3:38
• Well I didn't include that in my answer since the other answers gave the factorization. See Mikes answer. – Rene Schipperus Jun 4 '14 at 3:44


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

• Could you yourself possibly continue after these substitutions? – Saad Jun 17 '18 at 3:17
• Note that the Question is some four years old and already has an Accepted Answer. Therefore giving a "hint" for Readers is much less helpful than giving a complete Answer to fulfill if possible Math.SE's goal for curating definitive content. – hardmath Jun 17 '18 at 6:09
• @hardmath if you read my solution closely you will see it is more than a hint, all the remains is a partial fraction and arctan after the u sub – notuserealname Jun 18 '18 at 14:57

$$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]$$