Solution (source code)

= Solution

Jordan's lemma states that if $f$ is holomorphic in the upper half-plane apart from finitely many poles and $|f(z)|\le M/|z|$ on sufficiently large upper semicircles, then for $a>0$ the <integral> of $e^{iaz}f(z)$ over those arcs tends to zero. Indeed, split the arc away from its endpoints, where exponential decay is uniform, and bound the two short endpoint arcs using $|e^{iaRe^{i\theta}}|=e^{-aR\sin\theta}$ and $\sin\theta\ge2\theta/\pi$ on $[0,\pi/2]$.

Apply the upper semicircle to $ze^{iz}/(1+z^2)$. The sole enclosed pole is $i$, with residue $e^{-1}/2$. Therefore the contour <integral> is $\pi i/e$; taking imaginary parts gives
$$
\boxed{\int_{-\infty}^{\infty}\frac{x\sin x}{1+x^2}\,dx=\frac\pi e.}
$$