<s>[INST] Integrating $\int_{-\infty}^\infty \frac{1}{1 + x^4}dx$ with the residue theorem Calculate integral
$$\int\limits_{-\infty}^{\infty}\frac{1}{x^4+1} dx$$
with residue theorem. 
Can I evaluate $\frac 12\int_C  \dfrac{1}{z^4+1} dz$ where $C$ is simple closed contour of the upper half of unit circle like this? 
And find the roots of polynomial $z^4 +1$ which are the fourth roots of $-1$. 
In $C$ there is $z_1 =e^{i\pi/4}=\frac{1}{\sqrt{2}}+\frac{i}{\sqrt{2}}$ and $z_2=e^{3\pi/4}=-\frac{1}{\sqrt{2}}+\frac{i}{\sqrt{2}}$.
So the residuals $B_1$ and $B_2$ for $z_1$ and $z_2$ are simple poles and that
\begin{align}
B_1&=\frac{1}{4 z_1^3}\frac{z_1}{z_1}=-\frac{z_1}{4} \\
B_2&=\frac{1}{4z_2^3}\frac{z_2}{z_2}=-\frac{z_2}{4}
\end{align}
And the sum of residuals is
$$B_1+B_2=-\frac{1}{4}(z_1 + z_2)=-\frac{1}{4}\left(\frac{1}{\sqrt{2}}+\frac{1}{\sqrt{2}} \right)=-\frac{i}{2 \sqrt{2}}$$
So my integral should be
$$\int\limits_{-\infty}^{\infty}\frac{1}{x^4+1} dx =\frac 12 \times 2\pi i (B_1+B_2)=\frac{\pi}{\sqrt{2}}$$
Is this valid?
 [/INST] I thought that it might be instructive to present an alternative and efficient approach.  To do so, we first note that from the even symmetry that 
$$\int_{-\infty}^\infty \frac{1}{1+x^4}\,dx=2\int_{0}^\infty \frac{1}{1+x^4}\,dx \tag 1$$
We proceed to evaluate the integral on the right-hand side of $(1)$.

Next, we move to the complex plane and choose as the integration contour, the quarter circle in the upper-half plane with radius $R$.  Then, we can write  
$$\begin{align}
\oint_C \frac{1}{1+z^4}\,dz&=\int_0^R \frac{1}{1+x^4}\,dx+\int_0^\pi \frac{iRe^{i\phi}}{1+R^4e^{i4\phi}}\,d\phi+\int_R^0 \frac{i}{1+(iy)^4}\,dy\\\\
&=(1-i)\int_0^R\frac {1}{1+x^4}\,dx+\int_0^\pi \frac{iRe^{i\phi}}{1+R^4e^{i4\phi}}\,d\phi \tag 2
\end{align}$$
As $R\to \infty$, the second integral on the right-hand side of $(2)$ approaches $0$ while the first approaches the $1/2$ integral of interest.  Hence, we have

$$\bbox[5px,border:2px solid #C0A000]{\lim_{R\to \infty}\oint_C \frac{1}{1+z^4}\,dz=\frac{1-i}2 \int_{-\infty}^\infty \frac{1}{1+x^4}\,dx} \tag 3$$


Now, since $C$ encloses only the pole at $z=e^{i\pi/4}$, the Residue Theorem guarantees that 

$$\begin{align}\oint_C \frac{1}{1+z^4}\,dz&=2\pi i \text{Res}\left(\frac{1}{1+z^4}, z=e^{i\pi/4}\right)\\\\
&=\frac{2\pi i}{4e^{i3\pi/4}}\\\\
&=\frac{\pi e^{-i\pi/4}}{2}\\\\
&=\bbox[5px,border:2px solid #C0A000]{\frac{\pi(1-i)}{2\sqrt 2}} \tag 4
\end{align}$$


Finally, equating $(3)$ and $(4)$, we find that 

$$\bbox[5px,border:2px solid #C0A000]{\int_{-\infty}^\infty \frac{1}{1+x^4}\,dx=\frac{\pi}{\sqrt{2}}}$$

as expected.
</s>