# Trigonometric integral with square root (residue theorem)

I can't solve this integral: $$\int_0^{\pi/2}\frac{\sqrt{\tan x}}{1+\cos^2x}\,dx$$ I've tried with the definition of $\cos$ and $\sin$ as complex exponential functions but the square root stands in the way! I want to use the residue Theorem but it's difficult to figure out the singularities of this function.

• The substitution $t=\sqrt{\tan{x}}$ helps, but the answer is very ugly. – Michael Rozenberg Feb 8 '18 at 15:10
• I've tried but I obtain: integral of (t^(1/2))/(t^2+1+sqrt(1+t^2)) dt, with t=0 to 1, wich to me it's still problematic to solve – Gitana Feb 8 '18 at 15:18
• @Gitana I think the suggestion of Sonnhard is smart and the resulting integral I am sure is done somewhere else on MSE. The integral is improper (and convergent) but that is no problem – imranfat Feb 8 '18 at 15:20

write your integral in the form $$\int \frac{\sqrt{\tan(x)}\sec^2(x)}{\sec^2(x)+1}dx$$ then Substitute $$u=\tan(x)$$ and we get $$du=\sec^2(x)dx$$ and our integral has the form $$\int \frac{\sqrt{u}}{u^2+2}du$$ now Substitute $$s=\sqrt{u}$$ with $$ds=\frac{1}{2\sqrt{u}}du$$ can you finish? and you will Need that $$a^4+b^4=(a^2+b^2-\sqrt{2}ab)(a^2+b^2+\sqrt{2}ab)$$ and $$2\int\frac{s^2}{s^4+2}ds=\frac{\log \left(\sqrt{2} s^2-2 \sqrt[4]{2} s+2\right)-\log \left(\sqrt{2} s^2+2 \sqrt[4]{2} s+2\right)-2 \tan ^{-1}\left(1-\sqrt[4]{2} s\right)+2 \tan ^{-1}\left(\sqrt[4]{2} s+1\right)}{2\ 2^{3/4}}$$
• You would need the factoring formula $a^4+b^4$ and the following partial fraction decomposition is cumbersome, but doable and I am sure it has been done on MSE before. The top-bottom multiplication of $sec^2x$ is smart...+1 – imranfat Feb 8 '18 at 15:19
There's actually no need for a primitive of $\frac{\sqrt{\tan x}}{1+\cos^2 x}$ in order to compute the given integral, since
$$\int_{0}^{\pi/2}\frac{\sqrt{\tan x}}{1+\cos^2 x}\,dx \stackrel{x\mapsto \arctan u}{=}\int_{0}^{+\infty}\frac{\sqrt{u}}{2+u^2}\,du\stackrel{u\mapsto v^2}{=}\int_{\mathbb{R}}\frac{v^2}{v^4+2}\,dv$$ and the RHS equals $$2^{-1/4}\int_{\mathbb{R}}\frac{z^2}{z^4+1}=2^{3/4}\pi i\left[\operatorname*{Res}_{z=\zeta_8}\frac{z^2}{z^4+1}+\operatorname*{Res}_{z=\zeta_8^3}\frac{z^2}{z^4+1}\right]$$ where $\zeta_8=\frac{1+i}{\sqrt{2}}$, or, by De l'Hopital rule, $$2^{3/4}\pi i\left[\left.\frac{2z^2}{4z^3}\right|_{z=\zeta_8}+\left.\frac{2z^2}{4z^3}\right|_{z=\zeta_8^3}\right]=2^{-1/4}\pi i\left[\frac{1}{\zeta_8}+\frac{1}{\zeta_8^3}\right]=2^{-1/4}\pi i\left[\frac{1}{i}+\frac{1}{i^3}\right]=\color{red}{\pi 2^{-3/4}}.$$