Integrate $\frac{x^2-1}{x^2+1}\frac{1}{\sqrt{1+x^4}}dx$ An antiderivative from Spivak 

$$\int \frac{x^2-1}{x^2+1}\frac{1}{\sqrt{1+x^4}}dx$$

The idea I had was to write the first factor as $\left(1-\dfrac{2}{x^2+1}\right)$, but I don't see how that's helping!
 A: $$\int \frac{x^2-1}{x^2+1}\frac{1}{\sqrt{1+x^4}}dx$$
$$=\int\frac{1-\dfrac1{x^2}}{\left(x+\dfrac1x\right)\sqrt{\left(x+\dfrac1x\right)^2-2}}dx$$
Using Trigonometric substitution , set $\displaystyle x+\dfrac1x=\sqrt2\sec\phi$
A: $$
\begin{align}
\int\frac{x^2 - 1}{x^2 + 1}\frac{1}{\sqrt{x^4+1}}\,\mathrm{d}x &=-\int\frac{1-x^2}{1+x^2}\frac{\mathrm{d}x}{\sqrt{\dfrac{\left(1+x^2\right)^2 + \left(1-x^2\right)^2}{2}}}\\
&=-\frac{\sqrt{2}}{2}\int\frac{1-x^2}{1+x^2}\frac{1}{\sqrt{1 + \left(\dfrac{1-x^2}{1+x^2}\right)^2}}\frac{2}{1 + x^2}\,\mathrm{d}x
\end{align}
$$
Now, let's use a "reverse" Weierstrass substitution, setting up $x = \tan\left(\dfrac{\theta}{2}\right) $ and $\dfrac{2}{1+x^2}\,\mathrm{d}x = \mathrm{d}\theta $. Also, we have
$$\cos\theta = \dfrac{1-x^2}{1+x^2}\qquad\qquad\sin\theta=\frac{2x}{x^2+1} $$ Then,
$$\begin{aligned}-\frac{\sqrt{2}}{2}\int\frac{\cos\theta}{\sqrt{1 + \cos^2\theta}}\,\mathrm{d}\theta&=-\frac{\sqrt{2}}{2}\int\frac{\cos\theta}{\sqrt{2 - \sin^2\theta}}\,\mathrm{d}\theta\\
&=-\frac{1}{\sqrt{2}}\arcsin\left(\frac{\sin\theta}{\sqrt{2}}\right) + C\\
&=-\frac{1}{\sqrt{2}}\arcsin\left(\frac{x\sqrt{2}}{x^2 + 1}\right)+C \end{aligned}$$
