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?
 A: \begin{align*}
 J &= \int \frac{1}{\cos^4 - \cos^2 x \sin^2 x + \sin^4 x} dx \\
   &= \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$$
A: hint
$$\frac {1}{\cos^4x+\cos^2x\sin^2x+\sin^4x}=$$
$$\frac {1}{(\cos^2x+\sin^2x)^2-\cos^2x\sin^2x}=$$
$$\frac {1}{(1+\cos x\sin x)(1-\cos x\sin x)} =$$
$$\frac {1}{2+\sin(2x)}+\frac {1}{2-\sin (2x)}. $$
put $$t =\tan (x)$$
$$\sin (2x)=\frac {2t}{1+t^2} $$
$$dt=(1+t^2)dx $$
 Yes you can finish.
A: 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$
