Contour Integration of $\int_0^\infty \frac{\sin x \, \mathrm dx}{x(a^2 + x^2) }$ I am working through the section on Contour Integration in Mathematical Methods of Physics by Mathews and Walker and there are 2 integrals that I cannot figure out how to do. One of the integrals is 
$$\int_0^\infty \frac{\sin x}{x(a^2 + x^2)} \, \mathrm dx.$$
It's obvious that there are poles at $x = 0$, and $x = \pm ia$, but I'm not sure how to draw the contour. I know the answer is something like $\frac{\pi}{2a^2}\left(1-\exp{\left(-1/\sqrt{\frac{1}{a^2}}\right)}\right)$, but I'm not sure how this is achieved. Any help would be appreciated.
 A: Sketch for the solution: let $f(x):=\frac{\sin x}{x(x+a)^2}$, then note that
$$
\int _0^\infty f(x)\,\mathrm d x=\frac12\int_{-\infty }^{\infty }f(x) \,\mathrm d x=\frac12\lim_{R\to \infty }\int_{-R}^{R}f(x)\,\mathrm d x\tag1
$$
And from the residue theorem we have that
$$
\int_{-R}^{R}f(x)\,\mathrm d x+\int_{\gamma_R }f(z)\,\mathrm d z=2\pi i\sum_{z\in V}\operatorname{Res}(f,z)\tag2
$$
where $\gamma_R $ is the path from $R$ to $-R$ in the upper half of the boundary of the disk $R\Bbb D $ in the complex plane, $\operatorname{Res}(f,z)$ is the residue of $f$ around $z$, and $V:=R\Bbb D\cap\{z\in\Bbb C:\operatorname{Im}(z)> 0\}$. Therefore
$$
\int_{0}^{\infty }f(x)\,\mathrm d x=\frac12\lim_{R\to \infty }\left(2\pi i\sum_{z\in V}\operatorname{Res}(f,z)-\int_{\gamma_R }f(z)\,\mathrm d z\right)\tag3
$$
Now it can be shown that if $\lim_{|z|\to \infty }zf(z)=0$ then $\lim_{R\to \infty }\int_{\gamma _R}f(z)\,\mathrm d z=0$ (see here). Hence for your case
$$
\int_{0}^{\infty }f(x)\,\mathrm d x=\pi i\operatorname{Res}(f,ia)\tag4
$$
A: First realization: the integrand is even, so we have $\displaystyle \int_0^{\infty}\frac{\sin(x)}{x(a^2+x^2)}\,dx=\frac{1}{2}\int_{-\infty}^{\infty}\frac{\sin(x)}{x(a^2+x^2)}\,dx$.
Next, since $\sin(x)=\Im(e^{imx})$, we state $\displaystyle \frac{1}{2}\int_{-\infty}^{\infty}\frac{\sin(x)}{x(a^2+x^2)}\,dx=\frac{1}{2}\int_{-\infty}^{\infty}\frac{e^{imx}}{x(a^2+x^2)}\,dx$.
We let $\displaystyle f(x)=\frac{e^{imx}}{x(a^2+x^2)}\,dx$ for convenience.
Let $[-R,R]=\gamma_1$ and $C_R=\gamma_2$ denote the upper half of the semicircle with radius $R$ centered at $z=0$, with $R>a$, taken counterclockwise. 
By Jordan's Lemma, $\displaystyle \lim_{R \to \infty} \displaystyle \int_{C_R}f(z)\,dz=0$. (Since the bottom of the fraction is a polynomial with degree greater than $1$).
By the Residue Theorem, we obtain $\displaystyle \int_{\gamma_1\gamma_2}f(z)\,dz=2\pi i\,\text{Res}(f;ia)+2\pi i\,\text{Res}(f;-ia)-πi\,\text{Res}(f;0)$. 
Then, we necessarily have $\displaystyle \int_{-\infty}^{\infty}f(z)\,dz=-\int_{\gamma_1\gamma_2}f(z)\,dz$.
Now, find that value, take the imaginary part of it, and divide by $2$.  
