Solution (source code)

= Solution

Integrate $ze^{i\pi z}/(z^2+a^2)$ over the upper semicircle. <Jordan lemma> removes the arc, and the pole at $z=ia$ has residue $e^{-\pi a}/2$. Hence
$$
\int_{-\infty}^{\infty}\frac{x e^{i\pi x}}{x^2+a^2}\,dx
=\pi i e^{-\pi a}.
$$
The cosine contribution is odd, while the sine contribution is even. Therefore
$$
\boxed{\int_0^\infty\frac{x\sin(\pi x)}{x^2+a^2}\,dx
=\frac\pi2e^{-\pi a}.}
$$