<s>[INST] Evaluate $\int \frac{1-x^2}{(1+x^2)\sqrt {1+x^4}} dx$ $$\int \frac{\frac{1}{x^2}-1}{(x+\frac 1x)\sqrt{\frac{1}{x^2} + x^2}}dx$$
Let $x+\frac 1x = t$
$$-\int \frac{dt}{t\sqrt {t^2-2}}$$
Let $\sqrt{t^2-2} =u$
$$-\int \frac{du}{t^2}$$
$$-\int \frac{du}{u^2+2}$$
$$-\frac{1}{\sqrt 2} \arctan (\frac{u}{\sqrt 2})$$
$$-\frac{1}{\sqrt 2} \arctan (\frac{1}{\sqrt 2} \sqrt { x^2 +\frac{1}{x^2}}$$
But the given answer is$ \frac {1}{\sqrt 2} \arcsin (\frac{\sqrt {2 x}}{x^2+1})$
Where am I going wrong?
 [/INST] You need to take care of the sign in your approach. The result you derived is valid only for $x>0$. The full result valid for all domain is, instead
$$\int \frac{1-x^2}{(1+x^2)\sqrt {1+x^4}} dx
=-\frac{\text{sgn}(x)}{\sqrt 2} \arctan \frac{\sqrt { x^2+\frac{1}{x^2}}}{\sqrt 2} 
=-\frac{1}{\sqrt 2} \arctan \frac{ \sqrt { x^4 +1}}{{\sqrt 2}x}
$$
which, as expected, differs from the given answer by a constant, i.e.
$$-\frac{1}{\sqrt 2} \arctan \frac{ \sqrt { x^4 +1}}{{\sqrt 2}x}- \frac {1}{\sqrt 2} \arcsin \frac{\sqrt {2}x}{x^2+1}=-\frac{\pi}{2\sqrt2}$$
Note
$$-\int \frac{dt}{t\sqrt {t^2-2}}
= \int \frac{d(\frac1t)}{\sqrt {1-\frac2{t^2}}}= \frac1{\sqrt2}\arcsin\frac{\sqrt2}t= \frac {1}{\sqrt 2} \arcsin \frac{\sqrt {2}x}{x^2+1}
$$
</s>