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

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.

• It is $$\frac{x-\tan ^{-1}\left(\frac{a^2 \cot (x)}{b^2}\right)}{a^2+b^2}$$ – Dr. Sonnhard Graubner May 29 '19 at 15:31

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