I am trying to evaluate $$\int_0^\infty\frac{x \sin(x)}{x^2+a^2} dx$$ I get $\pi\sin(ia)/4$ using residue theorem.
I integrated over the path that goes from -R to R along the real axis and then along a the semi-circle that goes back to -R in the upper half plane. By residue theorem, this is $$2i \pi \lim_{x\to ia} \frac{(x-ia) x \sin(x)}{(x-ia) (x+ia)},\ \mbox{which is}\ \frac{\pi}{4} \sin(ia)$$ Subtracting from this the integral over the semi-circle as its radius R goes to infinity gives $\pi\sin(ia)/4$, by estimation lemma.
Can someone please correct my mistake $?$.
Thanks in advance