Complex contour integral Evaluation Use a complex contour integral to evaluate
$$\int_0^\infty \frac{x\sin(x)}{x^2+a^2} \, dx$$
where $a>0$.
 A: $$\int_0^{\infty}\frac{x\sin(x)}{x^2+a^2}dx = \int_0^{\infty}\frac{x\Im\{e^{ix}\}}{x^2+a^2}dx = \Im \Bigg\{ \int_0^{\infty}\frac{xe^{ix}}{x^2+a^2}dx \Bigg\} $$
The singularities of the integrating function : 
$$f(x) = \frac{xe^{ix}}{x^2+a^2}$$
come as : $x^2 + a^2 = 0 \Rightarrow x= \pm i a$ since $a>0$.
But we're integrating over the bounds $0$ and $\infty$, which means we come upon only $x= ia$.
We will integrate the function $f(x)$ with respect to $x$, over the partially smooth curve that is consisted of the half-moon of the upper level of $γ_R$, with $z(θ) = Re^{iθ}$, $0 \geq θ \geq π$ and the line segment $[-R,R]$, where we take $R$ to be big enough, so that the singularity point $x=ia$ is inside $γ_R$.
From the Residue-Theorem we have : 
$$\int_{-R}^{R}\frac{xe^{ix}}{x^2+a^2}dx + \int_{γ_R}\frac{ze^{iz}}{z^2+a^2}dz= 2\pi iRes(f(z),ia)  $$
The function also satisfies Jordan's Lemma, so it is : 
$$\lim_{R\to \infty} \int_{γ_R}\frac{ze^{iz}}{z^2+a^2}dz=0$$
thus : 
$$\int_0^{\infty}\frac{xe^{ix}}{x^2+a^2}dx = \lim_{R\to \infty} \int_{-R}^{R}\frac{xe^{ix}}{x^2+a^2}dx =2πiRes(f(z),ia)$$
and finally :
$$\int_0^{\infty}\frac{x\sin(x)}{x^2+a^2}dx = \Im \Bigg\{ \int_0^{\infty}\frac{xe^{ix}}{x^2+a^2}dx \Bigg\} = \frac{πe^{-a}}{2}$$
I'll leave the calculation of the residue : $Res(f(z),ia)$ to you.
