Evaluating $\int_0^\infty \frac{x\sin x}{1+x^2}$ using contour integration?

I'd like to Evaluate $$\int_0^\infty \frac{x\sin x}{1+x^2}$$ The sine function makes the obvious choice $\dfrac{z \sin z}{1+z^2}$ useless since if we integrate over a semicircle sine can become large. I tried $\dfrac{ze^{iz}}{1+z^2}$ but $x\sin x$ is not the real part or imaginary part of $ze^{iz}$. I'm not sure how to choose a related function that will allow me to recover $\dfrac{x\sin x}{1+x^2}.$

• $x\sin x$ is the imaginary part of $ze^{iz}$ along the real axis. – mrf Dec 5 '14 at 11:50

You can use $$\sin x = \frac{e^{ix} - e^{-ix}}{2i}$$
By the way, you can see that the integrand is an even function, so you can calculate the integral on the whole $\mathbb R$ which is easier since you only need to show that the integral over the semicircle vanishes ;-)
Since for $a,b\in\mathbb{R}^+$ we have : $$\int_{0}^{+\infty}\sin(at)e^{-bt}\,dt = \frac{a}{a^2+b^2},\qquad \int_{0}^{+\infty}\cos(at)e^{-bt}\,dt = \frac{b}{a^2+b^2},$$ it happens that:
$$\int_{0}^{+\infty}\frac{x}{1+x^2}\sin(x)\,dx = \int_{0}^{+\infty}\int_{0}^{+\infty}\cos(t)\sin(x)\,e^{-xt}\,dt\,dx,$$ so: $$\int_{0}^{+\infty}\frac{x}{1+x^2}\sin(x)\,dx = \int_{0}^{+\infty}\frac{\cos t}{1+t^2}\,dt=\frac{\pi}{2e}$$ where the last integral can be evaluated through the residue theorem.