Evaluate : $\int^{\frac{\pi}{2}}_0 \frac{\cos^2x\,dx}{\cos^2x+4\sin^2x}$ Evaluate: $$\int^{\frac{\pi}{2}}_0 \frac{\cos^2x\,dx}{\cos^2x+4\sin^2x}$$
First approach : 
$$\int^{\frac{\pi}{2}}_0 \frac{\cos^2x\,dx}{\cos^2x+4(1-\cos^2x)}$$
$$=\int^{\frac{\pi}{2}}_0 \frac{\cos^2xdx}{4 - 3\cos^2x}$$
$$=\int^{\frac{\pi}{2}}_0 \frac{1}{3}\{\frac{4-3\cos^2x-4}{4 - 3\cos^2x}\}\,dx$$
$$=\int^{\frac{\pi}{2}}_0 \frac{1}{3}\{ 1- \frac{4}{4 - 3\cos^2x}\}\,dx$$
$$=\int^{\frac{\pi}{2}}_0 \frac{1}{3} 1\,dx- \int^{\frac{\pi}{2}}_0 \frac{1}{3} \frac{4\sec^2x}{4\sec^2x - 3}\,dx$$
$$=\int^{\frac{\pi}{2}}_0 \frac{1}{3} 1\,dx- \int^{\frac{\pi}{2}}_0 \frac{1}{3} \frac{4
\sec^2x}{4(1+\tan^2x) - 3}\,dx$$
Now I can easily put $\tan x = t$ and I get $\sec^2x \,dx =dt$
Second approach : 
$$\int^{\frac{\pi}{2}}_0 \frac{\cos^2x\,dx}{\cos^2x+4\sin^2x}$$
Dividing numerator and denominator by $\cos^2x$ we get : 
$$=\int^{\frac{\pi}{2}}_0 \frac{dx}{1 +4\tan^2x}$$
$$=\int^{\frac{\pi}{2}}_0 \frac{dx}{(4)\{\frac{1}{4} +\tan^2x\}}$$
$$=\int^{\frac{\pi}{2}}_0 \frac{dx}{(4)\{\{\frac{1}{2}\}^2 +(\tan x)^2\}}$$
Can we apply this formula of integral here : 
$$\int \frac{1}{a^2+x^2}dx = \frac{1}{a}\tan^{-1}\frac{x}{a}$$
I tried but its not working here, I think doing some manipulation we can implement this here.. Please suggest thanks...

Use the fact that
$$3 \int_0^{\pi/2} dx \frac{\cos^2{x}}{\cos^2{x}+4 \sin^2{x}} = 3 \int_0^{\pi/2} dx \frac{\cos^2{x}}{4-3 \cos^2{x}} = 4 \int_0^{\pi/2} \frac{dx}{4-3 \cos^2{x}} - \int_0^{\pi/2} dx$$
So consider the first integral on the RHS:
$$4 \int_0^{\pi/2} \frac{dx}{4-3 \cos^2{x}} = 2 \int_0^{2 \pi} \frac{dy}{5-3 \cos{y}}$$
We may evaluate this latter integral using residue theory.  Let $z=e^{i y}$, $dy = -i dz/z$ so that 
$$2 \int_0^{2 \pi} \frac{dy}{5-3 \cos{y}} = -i 4 \oint_{|z|=1} \frac{dz}{10z-3(z^2+1)}$$
The denominator has zeroes at $z=1/3$ and $z=3$; of these, only $z=1/3$ lies within the unit circle.  Thus the integral is 
$$(i 2 \pi) \frac{-i 4}{10-6 (1/3)} = \pi$$
Then
$$\int_0^{\pi/2} dx \frac{\cos^2{x}}{\cos^2{x}+4 \sin^2{x}} = \frac{\pi-(\pi/2)}{3} = \frac{\pi}{6}$$
ADDENDUM
Alternatively, you may substitute $t=\tan{(y/2)}$, $dy = 2 dt/(1+t^2)$, $\cos{y} = (1-t^2)/(1+t^2)$, and then
$$2 \int_0^{2 \pi} \frac{dy}{5-3 \cos{y}} = \int_0^{\infty} \frac{dt}{(1/4)+t^2} = \frac{\pi}{2} 2 = \pi$$
