Evaluate $ \int \frac{a^2\cos^2x+b^2\sin^2x}{a^4\cos^2x+b^4\sin^2x}\,dx$

calculusindefinite-integralsintegrationsubstitutiontrigonometric-integrals

Evaluate $$ \int \frac{a^2\cos^2x+b^2\sin^2x}{a^4\cos^2x+b^4\sin^2x}\,dx$$

I have tried Weierstrass substitution and tried to split into two integrations, but it gets really messy.

Is there a better way to approach this problem? I feel that complex numbers are the best way out, but I couldn't get anything using that as well.

Best Answer

After substitution $t=\tan{x}$ use $$\frac{a^2+b^2t^2}{(a^4+b^4t^2)(1+t^2)}=\frac{1}{a^2+b^2}\left(\frac{1}{1+t^2}+\frac{a^2b^2}{a^4+b^4t^2}\right).$$