Integrating $ \int^{\pi}_{0} \frac{\cos^2 x}{a^2 \cos^2 x + b^2 \sin^2 x} \ dx $ I am trying to show that
$$ \int^{\pi}_{0} \frac{\cos^2 x}{a^2 \cos^2 x + b^2 \sin^2 x} \ dx = \frac{\pi}{a(a+b)} $$ where $ a,b > 0$.
I have tried a few things, but none have worked.
For example, one approach was
$$ \int^{\pi}_{0} \frac{\cos^2 x}{a^2 \cos^2 x + b^2 \sin^2 x} \ dx = \int^{\pi}_{0} \frac{\cos^2 x}{(a^2 - b^2)\cos^2 x + b^2} \ dx$$ and then divide by $ a^2 - b^2 $ throughout. However I am not given that $ a \not= b $, so this approach didn't work.
I also tried splitting up the integral, but then was not sure how to proceed:
$$ \int^{\pi}_{0} \frac{\cos^2 x}{a^2 \cos^2 x + b^2 \sin^2 x} \ dx =  \int^{\frac{\pi}{2}}_{0} \frac{\cos^2 x}{a^2 \cos^2 x + b^2 \sin^2 x} \ dx + \int^{\pi}_{\frac{\pi}{2}} \frac{\cos^2 x}{a^2 \cos^2 x + b^2 \sin^2 x} \ dx   $$
Substituting $ x \to x + \frac{\pi}{2} $ followed by $ x \to \frac{\pi}{2} -x $ a in the second integral gives
$$ \int^{\frac{\pi}{2}}_{0} \frac{\cos^2 x}{a^2 \cos^2 x + b^2 \sin^2 x} \ dx $$ 
Hence $$ \int^{\pi}_{0} \frac{\cos^2 x}{a^2 \cos^2 x + b^2 \sin^2 x} \ dx = 2 \int^{\frac{\pi}{2}}_{0} \frac{\cos^2 x}{a^2 \cos^2 x + b^2 \sin^2 x} \ dx $$
Next I thought I could substitute $ u = a^2 \cos^2 x + b^2 \sin^2 x $ which changes my limits from $[0, \frac{\pi}{2}]$ to $[a^2, b^2]$, however I could not complete the substitution as I didn't see how to express $ du = (b^2 - a^2) \sin 2 x \ dx $ or $ \cos^2 x$ in terms of $u$.

If we set $x=\arctan t$ we simply have:
$$I(a,b)=\int_{0}^{\pi}\frac{\cos^2 x}{b^2\sin^2 x+a^2\cos^2 x}\,dx = 2\int_{0}^{+\infty}\frac{dt}{(1+t^2)(a^2+b^2 t^2)}$$
that is straightforward to compute through partial fraction decomposition or through the residue theorem.
