Question: How to evaluate this integral using residues$$\int_{0}^{\infty} \frac{x \sin x}{1 + x^2} dx$$

I integrate over the entire real axis and dividing it by 1/2 since the integrand is even, and then I do the thing with the turning it into $$-\mathrm{Im}\bigg(\int f\cdot e^{ix} dx\bigg)$$ and integrate over the upper half plane by finding the residues there, and there's only one, at $i$.

So I put it into the equation $\frac{x e^{iz}}{2x}$ and get $\frac{1}{2e}$, so I get when plugging that in

$$\begin{align}\int_{0}^{\infty} \frac{x \sin x}{1 + x^2} dx &= .5 \int_{-\infty}^{\infty} \frac{x \sin x}{1 + x^2} dx \\&= .5 -\operatorname{Im} \Bigg[2\pi i \cdot \operatorname{Res}\bigg(\frac{x e^{ix}}{ 1 + x^2}; i\bigg)\Bigg]\\&= .5 \cdot \bigg[-\operatorname{Im}\Big(2\pi i\cdot \frac{1}{2e}\Big)\bigg] \\&= -\frac{\pi}{2e}\end{align}$$

But the answer's positive.

What did I mess up on?

  • 4
    $\begingroup$ possible duplicate of Evaluating the integral $\int_0^\infty \frac{x \sin rx }{a^2+x^2} dx$ using only real analysis $\endgroup$
    – Chris
    May 8, 2015 at 13:20
  • $\begingroup$ ...and what does that odd-looking $\;-0\;$ mean in the lower limit of the integral?? $\endgroup$
    – Timbuc
    May 8, 2015 at 13:27
  • $\begingroup$ Sorry, I originally wrote $-\infty$ there but then I remembered the original lower bound was 0 and I guess I forgot to remove the minus sign. $\endgroup$
    – John
    May 8, 2015 at 13:29
  • 1
    $\begingroup$ I dont see how you get the Minus in front of $Im$ in there. $\endgroup$
    – Lukas Betz
    May 8, 2015 at 13:41
  • $\begingroup$ My book says to use $-Im$ for this case? $\endgroup$
    – John
    May 8, 2015 at 13:43

1 Answer 1


First consider $$\int_0^\infty \frac{\cos ax}{1 + x^2} dx $$

with $a\geq 0 $. The function $f(z) = \frac{1}{1+z^2}$ has poles at $\pm i$ then take the contour $C_R$ to be the semicircle of radius $R>1$. Then by the Residue Theorem we have

$$\int_{-R}^R \frac{e^{iax}}{1 + x^2} dx + \int_{C_R}\frac{e^{iaz}}{1 +z^2} dz = 2\pi i\, \mathrm {Res}_{z=i} f(z)e^{iaz}$$

Where $$\mathrm{Res}_{z=i} f(z)e^{iaz} = \frac{e^{iaz}}{z+i} \Bigg|_{z=i} = \frac{e^{-a}}{2i}$$

Thus $$\int_{-R}^R \frac{e^{iax}}{1 + x^2} dx = \pi e^{-a} - \mathfrak {Re} \int_{C_R}\frac{e^{iaz}}{1 +z^2} dz$$

Since $|f(z)| \leq M_R = \frac{1}{R^2 -1 }$ we have that

$$\Bigg|\mathfrak {Re}\int_{C_R}\frac{e^{iaz}}{1 +z^2} dz\Bigg| \leq \Bigg|\int_{C_R}\frac{e^{iaz}}{1 +z^2} dz\Bigg| \leq \frac{\pi R}{R^2-1}$$ Then it follows that $$\int_{-\infty}^\infty \frac{\cos ax}{1 + x^2} dx = \pi e^{-a} \implies \int_{0}^\infty \frac{\cos ax}{1 + x^2} dx = \frac{\pi}{2}e^{-a}$$

From this we take $$I(a) = \int_{0}^\infty \frac{\cos ax}{1 + x^2} dx = \frac{\pi}{2}e^{-a}$$ then

$$I'(a) = -\int_{0}^\infty \frac{x\sin ax}{1 + x^2} dx = -\frac{\pi}{2}e^{-a}$$

Now take $a = 1$ to get $$\int_{0}^\infty \frac{x\sin x}{1 + x^2} dx = \color{red} {\frac{\pi}{2e}}$$


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .