$\int (x^2+1)/(x^4+1)\ dx$ I have Divided the numerator and Denominator by $x^2$
to get $\dfrac{1+x^{-2}}{x^2+x^{-2}}$ then changed it into $(1+(x^{-2}))/[(x-x^{-1})^2 +2]$ then took $x-(1/x)$ as $u$ and Differentiated it with respect to $x$ to get $dx=du/(1+x^{-2})$  Finally I got this expression:
$$
\int\frac{x^2+1}{x^4+1} \, dx = \int (u^2+2)^{-1} \, du
$$
After this I need help!
 A: Standard tables of integrals say:
$$ \int (1+v^2)^{-1} \, dv = (\arctan v) + \text{constant}. $$
Therefore
\begin{align}
\int (2+u^2)^{-1} \, du & = \frac 1 {2\sqrt 2} \int \left(1 + \left(\frac u {\sqrt 2} \right)^2 \right)^{-1} \, \big( \sqrt 2\, du\big) \\[10pt]
& = \frac 1 {2\sqrt 2} \int (1+v^2)^{-1} \, dv \\[10pt]
& = \frac 1 {2\sqrt 2} \arctan v + C \\[15pt]
& = \frac 1 {2\sqrt 2} \arctan \frac u {\sqrt 2} + C. 
\end{align}
A: Since $x^4+1=x^4+2x^2+1-2x^2=(x^2+\sqrt2x+1)(x^2-\sqrt2x+1)$, we obtain
$$\frac{x^2+1}{x^4+1}=\frac{1}{2}\left(\frac{1}{x^2+\sqrt2x+1}+\frac{1}{x^2-\sqrt2x+1}\right).$$
Now, use $\int\frac{1}{1+x^2}dx=\arctan{x}+C$.
A: Express MichaelRozenberg's denominator, $x^2 + \sqrt{2} x + 1$ in the form $u^2 + 1$ so you can use the $\tan^{-1}$ form.
Specifically:
$x^2 + \sqrt{2} x + 1$
Let $\sqrt{2}x + 1 = u$,
so
$u^2 = 2 x^2 + 2 \sqrt{2} x + 1$
so 
$u^2 + 1 = 2 x^2 + 2 \sqrt{2} x + 2$
or 
${1 \over u^2 + 1} = {1 \over x^2 + \sqrt{2} x + 1}$.
And likewise for the other term with the minus sign.
Now you have the arc tan integral formula, giving:
$$\frac{\tan ^{-1}\left(\sqrt{2} x+1\right)-\tan ^{-1}\left(1-\sqrt{2} x\right)}{\sqrt{2}}$$
