TITLE: Integrating $\int\frac{x^2-1}{(x^2+1)\sqrt{x^4+1}}\,dx$
QUESTION [5 upvotes]: I came across a question today...

Find $$\displaystyle\int\dfrac{x^2-1}{(x^2+1)\sqrt{x^4+1}}\,dx$$

How to do this? I tried to take $x^4+1=u^2$ but no result. Then I tried to take $x^2+1=\frac{1}{u}$, but even that didn't work. Then I manipulated it to $\int \dfrac{1}{\sqrt{1+x^4}}\,dx+\int\dfrac{2}{(x^2+1)\sqrt{1+x^4}}\,dx$, butI have no idea  how to solve it.
Wolframalpha gives some imaginary result...but the answer is $\dfrac{1}{\sqrt2}\arccos\dfrac{x\sqrt2}{x^2+1}+C$

REPLY [4 votes]: With (this seem to be some kind of substitution of the day)
$$
t=\frac{x}{\sqrt{1+x^4}}
$$
you get
$$
\int\frac{1}{1+2t^2}\,dt.
$$
I'm sure you can take it from here.