<s>[INST] Compute $\int\frac{1}{1+x^4}dx$ I was given the following hint and I can solve the problem by using the following equation. But I'm curious about how one can get the equation. Can someone give me some wikipedia links about it or hints to manipulate the equation?$$\frac{1}{1+x^4}=\frac{x-\sqrt{2}}{2\sqrt{2}(-x^2+\sqrt{2}x-1)}+\frac{x+\sqrt{2}}{2\sqrt{2}(x^2+\sqrt{2}x+1)}$$
BTW, are there any easier method to solve this integral? As seen on the answer, it seems not very possible. ;)
 [/INST] To find this decomposition, we have to factorize $x^4 + 1$. As $x^4 + 1$ does not have real roots, it does not have real linear factors. This gives the ansatz 
$$ x^4 + 1 = (x^2 + ax + b)(x^2 + cx + d) $$
We have
$$
  (x^2 + ax + b)(x^2 + cx + d) = x^4 + (a+c)x^3 + (b + d + ac)x^2 + (bc + ad)x + bd $$
Comparing the coefficients with $x^4+ 1$, we have
\begin{align}
  a + c &= 0\tag 1\\
 b + d + ac &= 0\tag 2\\
  bc + ad &= 0\tag 3\\
   bd &= 1\tag 4
\end{align}
Now $a = -c$ from (1), this gives 
\begin{align}
  a &= -c\\
 b + d - a^2 &= 0\tag 2\\
  a(d - b) &= 0\tag 3\\
   bd &= 1\tag 4
\end{align}
As $a = 0$ is impossible, as then (2) would give $b = -d$, which contradicts (4), we must have $a \ne 0$ and hence $d = b$ from (3), this leaves us with
\begin{align}
  a &= -c\\
 2b - a^2 &= 0\tag 2\\
   d &= b\\
   b^2 &= 1\tag 4
\end{align}
By (2), $b$ is positive, hence $b = 1$ by (4). This gives $d = 1$, and hence $a = \pm \sqrt 2$. Due to symmetry in $a$ and $c$, we may let $a = \sqrt 2$, giving 
$$ x^4 + 1 = (x^2 + \sqrt 2 x + 1)(x^2 - \sqrt 2 x + 1) $$
Now we use partial fraction decomposition, starting with the ansatz 
$$ \frac 1{x^4 + 1} = \frac{\alpha x + \beta}{x^2 + \sqrt 2 x + 1} + \frac{\gamma x + \delta}{x^2 - \sqrt 2 x + 1} $$
Clearing denominators gives 
\begin{align*}
  1 &= (\alpha x + \beta)(x^2 - \sqrt 2 x + 1) + (\gamma x + \delta)(x^2 + \sqrt 2 x + 1)\\
    &= (\alpha + \gamma)x^3 + (\beta -\sqrt 2 \alpha + \delta + \sqrt 2 \gamma)x^2 + (\alpha + \gamma - \sqrt 2\beta + \sqrt 2 \delta)x + \beta + \delta
\end{align*}
Comparing coefficients gives 
\begin{align*}
    \alpha + \gamma &= 0\\
    \beta + \delta + \sqrt 2(\gamma - \alpha) &= 0\\
   \alpha + \gamma + \sqrt 2(\delta - \beta) &= 0\\
   \beta + \delta &= 1 
\end{align*}
From the first, the third equation and the forth equation we have $\beta = \delta = \frac 12$, the second one gives $\gamma - \alpha = \frac 1{\sqrt 2}$, as $\alpha = -\gamma$ by the first equation $\gamma = \frac 1{2\sqrt 2}$, $\alpha = - \frac 1{2\sqrt 2}$, giving 
$$ \frac 1{x^4 + 1} = \frac{- x + \sqrt 2}{2\sqrt 2(x^2 + \sqrt 2 x + 1)} + \frac{x + \sqrt 2}{2\sqrt 2(x^2 - \sqrt 2 x + 1)} 
$$
</s>