Trigonometric integrals. Integrate $\int\frac{1}{\cos^4x-\cos^2x\sin^2x+\sin^4x}\mathrm{d}x$ I tried factoring the denominator but does not seem to suit the factorization of quadratic. Is there another way?
\begin{align*}
 J &amp;= \int \frac{1}{\cos^4 - \cos^2 x \sin^2 x + \sin^4 x} dx \\
   &amp;= \int \frac{\sec^4}{1 - \tan^2 x + \tan^4 x} dx 
\end{align*}

Let $u = \tan x$ and $\sec^2 x = \tan^2 x + 1$

$$ J = \int \frac{(1+\tan^2 x) \sec^2 x}{1- \tan^2 x +\tan^4 x} dx $$

again $ u = \tan x$

$$ J = \int \frac{u^2 + 1}{u^4 - u^2 + 1} du $$

Since $ \int \frac{u^2 + 1}{u^4 - u^2 + 1} du = \arctan(\frac{u}{1-u^2}) + c $

$$ J = -\arctan(2\cot(2x)) + c$$
Yeah from $J=\int\frac{u^2+1}{u^4-u^2+1}\mathrm{d}u$       i manipulated it to get $\int\frac{1+\frac{1}{u^2}}{u^2+\frac{1}{u^2}-1}\mathrm{d}u$  now we can rewrite the the denominator as $u^2+\frac{1}{u^2}=\left(u-\frac{1}{u}\right)^2+2$ now putting it back in give me                           $\int\frac{1+\frac{1}{u^2}}{\left(u-\frac{1}{u}\right)^2+1}\mathrm{d}u$ by doing substitution letting $\left(u-\frac{1}{u}\right)=w$   i got the result $\tan^{-1}\left(\frac{\tan^2x-1}{\tan x}\right)+c$