<s>[INST] Integration of $\int\frac{1}{x^{4}+1}\mathrm dx$ I don't know how to integrate $\displaystyle \int\frac{1}{x^{4}+1}\mathrm dx$. Do I have to use trigonometric substitution?  
 [/INST] Expand $\frac{1}{1+x^{4}}$ into partial fractions. For this purpose you need
to factorize the polynomial in the denominator. You can proceed by writing it as a product of four linear terms
\begin{equation*}
x^{4}+1=(x-x_{1})(x-x_{2})(x-x_{3})(x-x_{4})
\end{equation*}
where $x_{1},x_{2},x_{3},x_{4}$ are its complex roots. Since
\begin{equation*}
x^{4}+1=0\Leftrightarrow x^{4}=-1=\cos \pi +i\sin \pi 
\end{equation*}
the four roots are
\begin{eqnarray*}
x_{1} &=&\cos \left( \frac{\pi }{4}\right) +i\sin \left( \frac{\pi }{4}
\right) =\frac{\sqrt{2}}{2}(1+i) \\
x_{2} &=&\cos \left( \frac{3\pi }{4}\right) +i\sin \left( \frac{3\pi }{4}
\right) =\frac{\sqrt{2}}{2}(-1+i) \\
x_{3} &=&\overline{x}_{2} \\
x_{4} &=&\overline{x}_{1}.
\end{eqnarray*}
Rewrite $x^{4}+1$ as a product of quadratic terms, by grouping the factors $
(x-x_{1}),(x-x_{4})=(x-\overline{x}_{1})$ and $(x-x_{2}),(x-x_{3})=(x-
\overline{x}_{2})$
\begin{eqnarray*}
x^{4}+1 &=&\left[ (x-x_{1})(x-\overline{x}_{1})\right] \left[ (x-x_{2})(x-
\overline{x}_{2})\right]  \\
&=&\left( x^{2}-\sqrt{2}+1\right) \left( x^{2}+\sqrt{2}x+1\right) 
\end{eqnarray*}
Find the constants $A,B,C,D$ such that
\begin{equation*}
\frac{1}{\left( x^{2}-x\sqrt{2}+1\right) \left( x^{2}+x\sqrt{2}+1\right) }=
\frac{A+Bx}{x^{2}-x\sqrt{2}+1}+\frac{C+Dx}{x^{2}+\sqrt{2}x+1}.
\end{equation*}
To evaluate
\begin{equation*}
\int \frac{1}{x^{2}\mp \sqrt{2}x+1}dx
\end{equation*}
complete the square in the denominator (see this answer of mine)
\begin{equation*}
x^{2}\mp \sqrt{2}x+1=\left( x\mp \frac{\sqrt{2}}{2}\right) ^{2}+\left( \frac{\sqrt{
2}}{2}\right) ^{2}
\end{equation*}
and make the substitutions
\begin{equation*}
x\mp \frac{\sqrt{2}}{2}=\frac{\sqrt{2}}{2}t.
\end{equation*}
To compute the remaining integrals rewrite them as
\begin{eqnarray*}
\int \frac{x}{x^{2}\mp \sqrt{2}x+1}dx &=&\frac{1}{2}\int \frac{2x\mp \sqrt{2}}{
x^{2}\mp \sqrt{2}x+1}dx\pm\frac{\sqrt{2}}{2}\int \frac{1}{x^{2}\mp \sqrt{2}x+1}dx. 
\end{eqnarray*}
</s>