$\int_0^\infty \frac{1}{1+x^4}dx$ using the Residue Theorem I'm trying to evaluate the integral
$$\int_0^\infty \frac{1}{1+x^4}dx $$
using the Residue Theorem.

My approach:
Let's consider
$$\oint_\Gamma f$$
with $f(z)=\frac{1}{1+z^4}$ and $\Gamma = \Gamma_1 + \Gamma_2$, where:

*

*$\Gamma_1:[-R,R]\rightarrow \mathbb{C}$, with $\Gamma_1(t)=t$

*$\Gamma_2:[0, \pi] \rightarrow \mathbb{C}$, with $\Gamma_2(t)=Re^{it}$
So basically $\Gamma$ is the semicircle centers in the origin with imaginary part greater or equal to zero.
First we need to find the isolated singularities $\alpha_i$ of the function $f$. This singularities are the solution of the equation $1 + z^4 = 0$:

Let's call:

*

*$\alpha_1 = \frac{\sqrt{2}}{2} + i \frac{\sqrt{2}}{2}$

*$\alpha_2 = -\frac{\sqrt{2}}{2} + i \frac{\sqrt{2}}{2}$

*$\alpha_3 = -\frac{\sqrt{2}}{2} - i \frac{\sqrt{2}}{2}$

*$\alpha_4 = \frac{\sqrt{2}}{2} - i \frac{\sqrt{2}}{2}$
So now we have:
$$\oint_\Gamma f = 2 \pi i \sum_i \text{Res}(f,\alpha_i) \text{Ind}_\Gamma(\alpha_i)$$
All singularities are poles of order one, with:
$$\text{Res}(f,\alpha_i)=\frac{1}{1+4\alpha_i^3}$$
So we end up with:
$$\oint_\Gamma f = 2 \pi i \sum_i \frac{\text{Ind}_\Gamma(\alpha_i)}{1+4\alpha_i^3} $$
Because of the shape of our curve $\Gamma$ we have that $\text{Ind}_\Gamma(\alpha_3)=\text{Ind}_\Gamma(\alpha_4)=0$
So we end up with:
$$\oint_\Gamma f = 2 \pi i \underbrace{\left( \frac{1}{1+4\alpha_1^3} + \frac{1}{1+4\alpha_2^3} \right)}_{:=\xi} $$
Now we can work on the left side of this expression:
$$\int_{\Gamma_1} f + \int_{\Gamma_2} f = 2 \pi i \xi$$
We have that:
$$\int_{\Gamma_1}f = \int_{-R}^R \frac{1}{1 + t^4} dt$$
And we also know that
$$\begin{align}
\int_{\Gamma_2}f &\leq \int_0^\pi \left|\frac{Rie^{it}}{1 + R^4e^{4it}} \right| dt
\\
\\ &= \int_0^\pi \frac{R}{\left|1 + R^4e^{4it}\right|}  dt
\\
\\ &= \int_0^\pi \frac{1}{\left| \frac{1}{R} + R^3e^{4it}\right|}  dt
\end{align}$$
If we let $R \to \infty$ we have that $\int_{\Gamma_1} f = \int_{-\infty}^\infty \frac{dt}{1 + t^4}$ and $\int_{\Gamma_2} f = 0$ and because $\int_{-\infty}^\infty \frac{dt}{1 + t^4} = 2 \int_{0}^\infty \frac{dt}{1 + t^4}$, we end up with:
$$\int_{0}^\infty \frac{dt}{1 + t^4} = \pi i \xi$$

The thing is that $\pi i \xi$ is a complex number, so what did I do wrong?

The poles lying inside the contour are $\alpha_1=i\pi/4, \alpha_2=i3\pi/4$.
$Res[f(z),\alpha_1]=\frac{1}{4z^3}\rvert_{\alpha_1}=\frac{1}{4}e^{-3i\pi/4}$
$Res[f(z),\alpha_2]=\frac{1}{4z^3}\rvert_{\alpha_2}=\frac{1}{4}e^{-9i\pi/4}$
$ \text{After using the estimation principle to squeeze the integral on upper part to zero}$
$\therefore I=2\pi i\times \left [\frac{1}{4}e^{-3i\pi/4}+\frac{1}{4}e^{-9i\pi/4}\right ]$
$=\pi i/2\times \left (\frac{-1}{\sqrt 2} -i\frac{1}{\sqrt 2}+\frac{1}{\sqrt 2}-i\frac{1}{\sqrt 2}\right )$
$=\frac{\pi }{\sqrt 2}$
Now you can use the symmetry of integrand function to change the limits to $(0,\infty)$ so that the value of required integral is $\frac{\pi}{2\sqrt 2}$
