I am trying to compute
$$\int_{-\infty}^{\infty} \frac{x \sin x}{1+x^4}dx$$
This question has been asked here, but the asker and answerer skip over the calculation of the residues.
Define the curve $\gamma$ to be the semicircle in the top half plane with radius $R$ and straight edge on the real axis from $-R$ to $R$.
Then by the residue theorem and Jordan's lemma, taking $R \to \infty$, I know that
$$\int_{-\infty}^{\infty} \frac{z e^{iz}}{1+z^4}dz = \oint_{\gamma} \frac{ze^{iz}}{1+z^4} dz = 2 \pi i \sum_{\alpha \text{ roots of } 1+z^4, \Im(\alpha)>0} \text{Res}\left(\frac{z e^{iz}}{1+z^4}, \alpha \right)$$
The relevant roots are $\alpha=e^{\frac{\pi i}{4}}, e^{\frac{3 \pi i}{4}}$.
How can I go about calculating these residues? I know that it's the coefficient of $z^{-1}$ the Laurent series at $\alpha$, or also $\frac{1}{2 \pi i} \oint_{\partial D(\alpha, r)} \frac{z e^{iz}}{1+z^4} dz$. I'm struggling to calculate either of these. What do I do?
$z^4+1=(z-w_1)\cdots(z-w_4)$, where $w_j=e^{2\pi ij/4}$, for $j=1, 2,3,4$. You are interested in $w_1$ and $w_3$. Since they are poles of order $1$ you calculate the residues as $$\lim_{z\to w_1}(z-w_1) \frac{ze^{iz}}{1+z^4}, $$ and same for $w_3$.