# Integrating $\int\frac{x^2-1}{(x^2+1)\sqrt{x^4+1}}\,dx$

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$

Hint Divide the numerator and denominator by $x^2$, to get: $$\int \frac{(1-\frac{1}{x^2})dx}{(x+\frac{1}{x})(\sqrt {(x+\frac{1}{x})^2-2} )}$$ Then put $x+\frac{1}{x}=t$ $$\int \frac{dt}{t(\sqrt{t^2-2})}$$ Which is easily taken care of by putting $t=\sqrt2 \sec\theta$, $$\int \frac{(\sqrt2 \sec\theta\tan \theta)d\theta}{\sqrt2 \sec\theta \sqrt2 \tan\theta}$$

• Very clever! +1 – zz20s Mar 2 '16 at 15:27
• @zz20s Thanks!, btw someone was editing this, what was it?, I was adding something at that time! – Nikunj Mar 2 '16 at 15:29
• I just removed some unnecessary brackets. If you'd prefer to keep them, that's okay. Either way, great answer. – zz20s Mar 2 '16 at 15:30
• Thanks...today I found out that even WA can be wrong.. :) – manshu Mar 2 '16 at 15:32
• @manshu I take my words back – Nikunj Mar 2 '16 at 15:36

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.