How to integrate $x\times \frac{\sin(x)}{x^2+a^2}$ from zero to infinity I am trying to evaluate $\int_0^\infty\frac{x \sin(x)}{x^2+a^2} dx$.  I get $\frac{\pi}{4} \sin(ia)$ 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)}$, which is $\frac{\pi}{4} \sin(ia)$.  Subtracting from this the integral over the semi-circle as its radius R goes to infinity gives $\frac{\pi}{4} \sin(ia)$, by estimation lemma.
Can someone please correct my mistake? 
Thanks in advance
 A: $$\int_0^\infty \frac{x \sin(x)}{x^2+a^2}dx=\frac12\int_{-\infty}^\infty \frac{x \sin(x)}{x^2+a^2}dx=\frac12{\frak{I}}\int_{-\infty}^\infty \frac{x e^{i x}}{x^2+a^2}dx$$
Now consider $\int \frac{x e^{i x}}{x^2+a^2}$ along a countour $C$ along the real line and then a semi-cirle in the upper-half plane. By the residue theorem, (with a suitably large circle radius to include the singularity), we have
$$\int_C \frac{x e^{i x}}{x^2+a^2}dx=2\pi i\lim_{x \to ia}(x-ia)\frac{x e^{i x}}{(x-ia)(x+ia)}=\pi i e^{-a} $$
As you probably determined, as the radius of the upper semicirle arc goes to infinity, the countour along the arc goes to zero. So we have
$$\int_{-\infty}^\infty \frac{x e^{i x}}{x^2+a^2}dx=\pi i e^{-a} $$
Hence
$$\int_0^\infty \frac{x \sin(x)}{x^2+a^2}dx=\frac12{\frak{I}}\int_{-\infty}^\infty \frac{x e^{i x}}{x^2+a^2}dx=\frac\pi2e^{-a}$$
A: It is a so long time I did not use the residue theorem that I should not try to solve the problem that way.
From a standard integration point of view, the integral can be computed using partial fraction decomposition $$\frac{x }{x^2+a^2}=\frac{1}{2}\Big(\frac{1}{x+ia}+\frac{1}{x-ia}\Big) $$and so $$\int\frac{x \sin(x)}{x^2+a^2} dx=\frac{1}{2} (i \sinh (a) (\text{Ci}(x-i a)-\text{Ci}(i a+x))+\cosh (a) (\text{Si}(i
   a+x)-\text{Si}(i a-x)))$$ which is a real valued function. From this, it follows that $$\int_0^\infty\frac{x \sin(x)}{x^2+a^2} dx=\frac{\pi  e^{-a}}{2}$$ I hope and wish that this could help you to some extent.
