How to integrate $\int_{1}^{3} {\frac{x^2 - 1}{x^4 + 1}}\, dx$ $$\int_{1}^{3} {\frac{x^2 - 1}{x^4 + 1}}\, dx$$
Well, I can simplify the numerator:
$$\int_{1}^{3} {\frac{(x - 1)(x+1)}{x^4 + 1}}\, dx$$
But I have no idea how to simplify the denumenator:
$$\ x^4+1=? \ $$
How to solve this integral?
 A: We will first compute the integral without bounds. Start off by rewriting the integral using partial fractions:
$$\int \frac{-2\sqrt{2}x - 2}{4(x^2 + \sqrt{2}x + 1)} + \frac{2 - 2\sqrt{2}x}{4(-x^2 + \sqrt{2}x - 1)} \ \mathrm{d}x.$$
Note that we can split this into two integrals to get
$$\int \frac{-2\sqrt{2}x - 2}{4(x^2 + \sqrt{2}x + 1)}\ \mathrm{d}x + \int \frac{2 - 2\sqrt{2}x}{4(-x^2 + \sqrt{2}x - 1)} \ \mathrm{d}x.$$
Factoring out the constants on both sides, we obtain
$$\frac{1}{2\sqrt{2}} \int \frac{\sqrt{2} - 2x}{-x^2 + \sqrt{2}x - 1}\ \mathrm{d}x +
\frac{1}{4} \int \frac{-2\sqrt{2}x - 2}{x^2 + \sqrt{2}x +1} \ \mathrm{d}x.$$
Now, make the change of variable
$$ u = -x^2 + \sqrt{2}x - 1 \qquad \therefore \qquad \mathrm{d}u = (\sqrt{2} - 2x)\mathrm{d}x.$$
Hence, rewriting the integrand, we have
$$\frac{1}{2\sqrt{2}} \int \frac{1}{u}\ \mathrm{d}u +
\frac{1}{4} \int -\frac{\sqrt{2}(2x + \sqrt{2})}{x^2 + \sqrt{2}x +1} \ \mathrm{d}x,$$
which is the same as writing
$$\frac{1}{2\sqrt{2}} \int \frac{1}{u}\ \mathrm{d}u -
\frac{1}{2\sqrt{2}} \int \frac{2x + \sqrt{2}}{x^2 + \sqrt{2}x +1} \ \mathrm{d}x.$$
We can do a similar change of variable here by letting
$$ s = x^2 + \sqrt{2}x + 1 \qquad \therefore \qquad \mathrm{d}s = (\sqrt{2} + 2x)\mathrm{d}x.$$
This gives
$$\frac{1}{2\sqrt{2}} \int \frac{1}{u}\ \mathrm{d}u -
\frac{1}{2\sqrt{2}} \int \frac{1}{s} \ \mathrm{d}s.$$
It is now easy to integrate both sides and substitute $u$ and $s$ back after integration. You should obtain
$$ \int \frac{x^2 - 1}{x^4+1} \ \mathrm{d}x = 
\frac{1}{2\sqrt{2}} \left[\log(-x^2 + \sqrt{2}x - 1) - \log(x^2 + \sqrt{2}x + 1)\right] + C,$$
for some constant $C$. It now remains to integrate from $1$ to $3$, which should be a straightforward task from here.
A: As $x$ is finite & non-zero, 
$${\frac{x^2 - 1}{x^4 + 1}}=\frac{1-\dfrac1{x^2}}{x^2+\dfrac1{x^2}}=\frac{1-\dfrac1{x^2}}{\left(x+\dfrac1x\right)^2-2} $$
Using Trigonometric substitution, set $\displaystyle x+\dfrac1x=\sqrt2\sec u$
A: $$
\begin{align}
\hspace{-1cm}\int_1^3\frac{x^2-1}{x^4+1}\mathrm{d}x
&=\int_1^3\frac{x^2-1}{(x^2+1)^2-2x^2}\mathrm{d}x\tag{1}\\
&=\int_1^3\left[\frac{-1/2+x/\sqrt2}{x^2-\sqrt2x+1}
+\frac{-1/2-x/\sqrt2}{x^2+\sqrt2x+1}\right]\mathrm{d}x\tag{2}\\
&={\Large\int}_1^3\left[\frac{\frac1{\sqrt2}\left(x-\frac1{\sqrt2}\right)}{\left(x-\frac1{\sqrt2}\right)^2+\frac12}
-\frac{\frac1{\sqrt2}\left(x+\frac1{\sqrt2}\right)}{\left(x+\frac1{\sqrt2}\right)^2+\frac12}\right]\mathrm{d}x\tag{3}\\
&=\left[\frac1{2\sqrt2}\log\left(\left(x-\tfrac1{\sqrt2}\right)^2+\tfrac12\right)
-\frac1{2\sqrt2}\log\left(\left(x+\tfrac1{\sqrt2}\right)^2+\tfrac12\right)\right]_1^3\tag{4}\\
&=\left[\frac1{2\sqrt2}\log\left(\frac{x^2-\sqrt2x+1}{x^2+\sqrt2x+1}\right)
\right]_1^3\tag{5}\\
&=\left[\frac1{2\sqrt2}\log\left(\frac{(x^2-\sqrt2x+1)^2}{x^4+1}\right)
\right]_1^3\tag{6}\\
&=\frac1{2\sqrt2}\log\left(\frac{2(10-3\sqrt2)^2}{82(2-\sqrt2)^2}\right)\tag{7}\\
&=\frac1{2\sqrt2}\log\left(\frac{57+28\sqrt2}{41}\right)\tag{8}\\
\end{align}
$$
Explanation:
$(1)$: break the denominator into a difference of squares
$(2)$: using the factorization from $(1)$, do partial fractions
$(3)$: complete the squares in the denominators and adjust the numerators
$(4)$: integrate
$(5)$: expand the squares and combine the logarithms
$(6)$: neaten up the denominator
$(7)$: plug in the limits
$(8)$: simplify the argument to $\log$  
