Q:

Evaluate this integral using residue theorem

So we have $\int_{0}^{+\infty}\dfrac{x^2-a^2}{x^2+a^2}\cdot\dfrac{\sin x}{x}dx$. ($a>0$). I considered that we can just calculate the half of the imaginary part of 
$$\int_{-\infty}^{+\infty}\dfrac{x^2-a^2}{x^2+a^2}\cdot\dfrac{e^{ix}}{x}dx$$
I considered taking a contour of big upper half circle with radius $R$, and $[-R,-\epsilon]$,$[\epsilon,R]$, with a small lower half circle with radius $\epsilon$. I estimated that the integral of upper large circle is zero as $R$ tends to $\infty$. However, I can not seem to estimate the integral over the small circle since the rational function part is quite tricky. 
Can anyone help with this? Any hint would be appreciated!

A:

For functions $f$ with a simple pole at $z_0$, if we integrate along an arc $\gamma_{r,\theta}$ with radius $r$ and opening angle $\theta$, we have
$$
\lim_{r\to 0} \int_{\gamma_{r,\theta}} f(z)\,dz = \frac{\theta}{2\pi} \operatorname{Res}(f,z_0).
$$
See for example How to rigorously justify "picking up half a residue"? or Integrating $\frac {e^{iz}}{z}$ over a semicircle around $0$ of radius $\epsilon$ for some details.
In other words, you will pick up half the residue at $z=0$ (as well as the residue at $ia$ in your integral.

