The problem here is to evaluate $$ \int_0^\infty \frac{x}{(x^2 + a^2) \, \sin(\mu x)} dx $$ for $a,\mu >0.$ Clearly this integral doesn't converge in the usual sense, but we can calculate its Cauchy Principal Value.
My attempt was to integrate the function in the complex domain along a quartercircle-contour in the first quadrant, with little bumps at $z=ia$ and $z = \frac{n \pi}{\mu}, n \in \mathbb{N}_{>0}.$ The infinitely many poles along the positive real axis worry me. The residue at $\frac{n \pi}{\mu}$ is $ \frac{(-1)^n}{ a^2\mu^2 + \pi^2 n^2}$, so we should evaluate $\sum_{n=1}^{\infty} \frac{(-1)^n}{ a^2\mu^2 + \pi^2 n^2}. $
How can we do that? How can we evaluate this integral? I'd really appreciate an approach with contour integration.
Note: The solution is $$ PV \int_0^\infty \frac{x}{(x^2 + a^2) \, \sin(\mu x)} dx = \frac{\pi}{2 \, \sinh(\mu a)},$$ but I want to prove it.