<s>[INST] Evaluating $\int \frac{1}{{x^4+1}} dx$ I am trying to evaluate the integral
$$\int \frac{1}{1+x^4} \mathrm dx.$$
The integrand $\frac{1}{1+x^4}$ is a rational function (quotient of two polynomials), so I could solve the integral if I can find the partial fraction of $\frac{1}{1+x^4}$. But I failed to factorize $1+x^4$. 
Any other methods are also wellcome. 
 [/INST] $$I =\int \frac{1}{{x^4+1}} dx$$
If we add and subtract $2x^2$ to $x^4 + 1$, we get:
$$\int \frac{1}{{x^4 + 2x^2 + 1 - 2x^2}}$$
We know $x^4 + 2x^2 + 1 = (x^2 + 1)^2$
$$\int \frac{1}{{(x^2 + 1)^2 - 2x^2}}$$
We know $a^2 - b^2 = (a - b)(a + b)$
Hence, $(x^2 + 1)^2 - 2x^2 = (x^2 + 1 - \sqrt{2}x)(x^2 + 1 + \sqrt{2}x)$
$$\int \frac{1}{{(x^2-\sqrt{2}x+1)(x^2+\sqrt{2}x+1)}}$$
Now using partial fraction decomposition:
$$\frac{1}{(x^2-\sqrt{2}x+1)(x^2+\sqrt{2}x+1)} = \frac{Ax + B}{x^2-\sqrt{2}x+1} + \frac{Cx + D}{x^2+\sqrt{2}x+1}$$
After you have found A, B, C and D, its just a basic $\frac{linear}{quadratic}$ type integral.
</s>