Evaluate $\int \frac{a^2\sin^2 x+b^2\cos^2 x}{a^4\sin^2 x+b^4\cos^2 x}dx$ Evaluate
$$\int \frac{a^2\sin^2 x+b^2\cos^2 x}{a^4\sin^2 x+b^4\cos^2 x}\text dx$$
I would have given my attempt to this question but honestly, I think my attempts to solve this did nothing but only complicated it further.
Any hints or suggestions are welcome.Please verify that your method gives answer:$$\frac 1{a^2+b^2}(x+\tan^{-1} ({\frac {a^2\tan x}{b^2}}))+C$$

Hint:
We have $$I = \int \frac{a^2\sin^2 x + b^2\cos^2 x}{a^4\sin^2 x + b^4\cos^2 x}\, dx = \int \frac{[a^2-b^2]\sin^2 x + b^2}{[a^4-b^4]\sin^2 x + b^4}\, dx $$ $$= (b^2-\frac{(a^2-b^2)b^4}{a^4-b^4})\int \frac{1}{(a^4-b^4)\sin^2 x + b^4}\, dx + \int \frac{a^2-b^2}{a^4-b^4} \, dx$$
The first integral can be easily calculated by using a substitution $u = \tan x$.
