Integral $\int_0^{\infty} \frac{x\sin x}{x^{4}+a^{4}}\mathrm{d}x$ using residue theorem Solve with residue theorem $$\int_0^{\infty} \frac{x\sin x\,\mathrm{d}x}{x^{4}+a^4} $$
I am having difficulties calculating the residues,
I realize that the poles $z=ae^{\frac{1}{4}i\pi}$ & $z=ae^{\frac{3}{4}i\pi}$ lie within the contour but it is too tedious to calculate them
 A: Assuming $a>0$, we have
$$ I(a)=\int_{0}^{+\infty}\frac{x\sin x}{x^4+a^4}\,dx \stackrel{x\mapsto a z}{=} \frac{1}{a^2}\int_{0}^{+\infty}\frac{z}{z^4+1}\sin(az)\,dz \tag{1}$$
hence
$$ I(a) = \frac{1}{2a^2}\,\text{Im}\int_{-\infty}^{+\infty}\frac{z e^{iaz}}{z^4+1}\,dz \tag{2}$$
where the function $f(z)=\frac{z e^{iaz}}{z^4+1}$ has simple poles at the primitive eight roots of unity and a rapid decay in the upper half-plane. By setting $\zeta_{\pm}=\frac{i\pm 1}{\sqrt{2}}$ we have:
$$ I(a) = \frac{\pi}{a^2}\left(\text{Res}_{z=\zeta_+}f(z)+\text{Res}_{z=\zeta_-}f(z)\right)=\color{red}{\frac{\pi}{2a^2}\sin\left(\frac{a}{\sqrt{2}}\right)e^{-\frac{a}{\sqrt{2}}}}. \tag{3}$$
A: I would like to expand Jack's answer slightly by showing a trick to compute the integrand's residues at its poles.
 Following Jack's approach, one gets to
$$I(a)=\frac{1}{2a^2}\Im \left (\int_{\mathbb R}\frac{ze^{iaz}}{z^4+1}\mathrm d z\right )$$
Let $z_1,z_2,z_3,z_4$ denote the four fourth roots of $-1$ ordered anticlockwise from $0$. Computations get messy because computing the integrand's residues at the poles in the upper half plane are
$$\text{Res}\left(\frac{ze^{iaz}}{z^4+1};z_1\right)=\frac{z_1e^{iaz_1}}{\prod_{i\neq 1}(z_1-z_i)}$$
$$\text{Res}\left(\frac{ze^{iaz}}{z^4+1};z_2\right)=\frac{z_2e^{iaz_2}}{\prod_{i\neq 2}(z_2-z_i)}$$
Here's a quick way of getting rid of those pesky products. By differentiating,
$$z^4+1=\prod_{i=1}^4(z-z_i)\stackrel{\frac{\mathrm d}{\mathrm dz}}\implies 4z^3=\sum_{j=1}^4\prod_{i\neq j}(z-z_i) $$
Evaluating the identity in $z=z_j$, 
$$4z_j^3=\prod_{i\neq j}(z_j-z_i)$$
$$\stackrel{z_j^4=-1}\implies-\frac{4}{z_j}=\prod_{i\neq j}(z_j-z_i)$$
This makes residue computations much easier. Observing that $z_1^2=i,z_2^2=-i$, one has
$$\text{Res}\left(\frac{ze^{iaz}}{z^4+1};z_1\right)=\frac{z_1e^{iaz_1}}{\prod_{i\neq 1}(z_1-z_i)}=-\frac{1}{4}z_1^2e^{iaz_1}=-\frac{1}{4}ie^{iaz_1}$$
$$\text{Res}\left(\frac{ze^{iaz}}{z^4+1};z_2\right)=\frac{z_2e^{iaz_2}}{\prod_{i\neq 2}(z_2-z_i)}=-\frac{1}{4}z_2^2e^{iaz_2}=\frac{1}{4}ie^{iaz_1}$$
so
$$ 2\pi i \text{Res}\left (\frac{ze^{iaz}}{z^4+1};\mathbb R^2_+ \right )=\frac{\pi}{2} (e^{iaz_1}-e^{iaz_2}) $$
which, by writing out $z_1,z_2$ explictly can be shown to have imaginary part equal to
$$\pi e^{-\frac{a}{\sqrt{2}}}\sin\left (\frac{a}{\sqrt{2}}\right )$$
Jack's result follows.
