Compute $\int_0^{+\infty}\frac{\sin x + \cos x}{x^4+1}dx$ Problem:
Compute
$$\int_0^{+\infty}\frac{\sin x + \cos x}{x^4+1}dx$$
using the Residue Theorem.
My attempt:
We know that
$$\sin x+ \cos x=\sqrt{2} \sin(x + \frac{\pi}{4})$$
Thus we can reduce to compute:
$$\int_0^{+\infty}\frac{e^{ix}}{x^4+1}dx$$
Defining $\alpha_R(t)=t$ for $t \in [0,R]$, $\beta_R(t)=Re^{it}$ for $t \in [0,\theta]$ and finally $\gamma_R(t)=e^{i\theta}tR$ where $\theta$ is an opportune angle to be chosen I would like to use then Residue Theorem but I cannot say anything about:
$$\int_{\gamma_R}f(z)dz$$
where $f(z)=\frac{e^{iz}}{z^4+1}$.
 A: Clearly $z_1=\frac{\sqrt2}2(1+i)$ is the only root of $z^4+1=0$ in the first quadrant.
For $R>1$, defining $\alpha_R(t)=t, \beta_R(t)=it$ for $t \in [0,R]$ and finally $\gamma_R(t)=Re^{i\theta}$ for $\theta\in[0,\frac\pi2]$. Then
$$ \frac{1}{2\pi i}\bigg(\int_{\alpha_R}+\int_{\gamma_R}-\int_{\beta_R}\bigg)\frac{e^z}{z^4+1}dz=\frac{e^{iz_1}}{3z_1}$$
or
$$ \int_0^R\frac{e^{it}}{t^4+1}dt+\int_0^{\pi/2}\frac{e^{iRe^{4i\theta}}}{R^4e^{4i\theta}+1}iRe^{i\theta}d\theta-\int_0^R\frac{e^{-t}}{t^4+1}idt=2\pi i\frac{e^{iz_1}}{3z_1} $$
Letting $R\to\infty$ gives
$$ \int_0^\infty\frac{e^{it}}{t^4+1}dt-\int_0^\infty\frac{e^{-t}}{t^4+1}idt=2\pi i\frac{e^{iz_1}}{3z_1} $$
or
$$ \int_0^\infty\frac{e^{it}}{t^4+1}dt=i\int_0^\infty\frac{e^{-t}}{t^4+1}dt+2\pi i\frac{e^{iz_1}}{3z_1}. \tag1 $$
and so on and on.
Update: 
\begin{eqnarray}
\int_0^\infty\frac{e^{-t}}{t^4+1}dt&=&\int_0^1\frac{e^{-t}}{t^4+1}dt+\int_1^\infty\frac{e^{-t}}{t^4+1}dt\\
&=&\int_0^1\sum_{n=0}^\infty (-1)^n t^{4n}e^{-t}dt+\int_1^\infty\sum_{n=0}^\infty (-1)^n t^{-4n-4}e^{-t}dt\\
&=&\sum_{n=0}^\infty (-1)^n\bigg[\Gamma (4 n+1)+\Gamma (-4 n-3,1)-\Gamma (4 n+1,1)\bigg].
\end{eqnarray}
which seems hard to simplify.
