Improper integral and residues 
Evaluate $\int_0^\infty \frac{dx}{x^4+1}$

By the residue theorem $$\int_{-R}^Rf(x)dx+\int_{C_R}dz=2\pi i\sum Res(f,z_i)$$
but I have problems to evaluate it because
$$z^4+1=0\Rightarrow z^4=-1=e^{i\pi},e^{i3\pi},e^{i5\pi},e^{i7\pi}$$
$$z=e^{\frac{i\pi}{4}},e^{\frac{i3\pi}{4}},e^{\frac{i5\pi}{4}},e^{\frac{i7\pi}{4}}$$
are the four roots, and just $z_0=e^{\frac{i\pi}{4}}$ and $z_1=e^{\frac{i3\pi}{4}}$ are in the upper half plane, I know that $z_0$ and $z_1$ are simple poles, but I don't know how to evaluate the resiudes of them.

Well, I'm learning the subject now, too, we might as well teach each other, no? :)
Note that: $$\int_0^{+\infty} \frac{1}{x^4+1}\,{\rm d}x = \frac{1}{2}\int_{-\infty}^{+\infty}\frac{1}{x^4+1}\,{\rm d}x,$$so we'll compute that second integral. Let $R > 1$, $\gamma_1$ be the line segment joining $-R$ to $R$, and $\gamma_2$ be the semicircle centered at the origin with radius $R$, in the superior semi-plane. Let $\gamma = \gamma_1 \ast \gamma_2$ be the whole thing. Consider the function $1/(z^4+1)$. Granted, we want to find its singularities. Instead, look at the eighth roots of $1$ and give "larger steps":

Our singularities are the gray points. Write $\omega = \sqrt{2}(1+i)/2$. The only singularities that'll come into play are $\omega$ and $-\overline{\omega}$. Do notice that $\omega^4 = (-\overline{\omega})^4=-1$, we'll use that soon. What you need to know is:

If $a$ is a simple pole of $1/f(z)$, then ${\rm Res}(1/f(z),a) = 1/f'(a)$.

With this in hands: $${\rm Res}\left(\frac{1}{z^4+1},\omega\right) = \frac{1}{4\omega^3} = -\frac{\omega}{4}$$and: $${\rm Res}\left(\frac{1}{z^4+1},-\overline{\omega}\right) = \frac{1}{4(-\overline{\omega})^3} = -\frac{1}{4\overline{\omega}^3} = \frac{\overline{\omega}}{4}.$$Now, to the integrals. $$\begin{align} \oint_\gamma \frac{{\rm d}z}{z^4+1} &= \int_{\gamma_1} \frac{{\rm d}z}{z^4+1} + \int_{\gamma_2}\frac{{\rm d}z}{z^4+1} \\ 2\pi i \left(\frac{\overline{\omega}-\omega}{4}\right) &= \int_{-R}^R \frac{{\rm d}x}{x^4+1} + \int_{\gamma_2}\frac{{\rm d}z}{z^4+1} \\ \frac{\pi i}{2}(-2i\,{\rm Im}(\omega))&= \int_{-R}^R \frac{{\rm d}x}{x^4+1} + \int_{\gamma_2}\frac{{\rm d}z}{z^4+1} \\ \frac{\pi\sqrt{2}}{2}&= \int_{-R}^R \frac{{\rm d}x}{x^4+1} + \int_{\gamma_2}\frac{{\rm d}z}{z^4+1}\end{align}$$ If $|z| = R>1$, we have that $|z^4+1| \geq R^4-1 > 0$, and so $1/|z^4+1| \leq 1/(R^4-1)$. Since the lenght of $\gamma_2$ is $\pi R$, we have: $$\left|\int_{\gamma_2}\frac{{\rm d}z}{z^4+1}\right|\leq \frac{\pi R}{R^4-1} \stackrel{R\to+\infty}{\longrightarrow} 0.$$ So make $R \to +\infty$. We get: $$\int_{-\infty}^{+\infty} \frac{{\rm d}x}{x^4+1} = \frac{\pi\sqrt{2}}{2} \implies \int_0^{+\infty}\frac{{\rm d}x}{x^4+1} = \frac{\pi\sqrt{2}}{4}.$$
