How to evaluate the integral $\int_{0}^{\infty}\frac{\cos {(ax)}-\cos{(b x)}}{x^2 }dx$?

I'm wondering how to integrate the so-called integral using Residue theorem,as it has a pole of second order on the real axis(not simple) so we cannot use $\pi i Res(@ z=0)$.Would you please give me a hint?($a,b>0$)


Solution 1:

Consider the integral

$$\oint_C dz \frac{e^{i a z}-e^{i b z}}{z^2} $$

where $C$ is a semicircle in the upper half plane of radius $R$ with a small semicircular detour at $z=0$ of radius $\epsilon$ into the upper half plane. Then the integral is equal to

$$PV \int_{-R}^R dx \frac{e^{i a x}-e^{i b x}}{x^2} +i R \int_0^{\pi} d\theta \, e^{i \theta} \frac{e^{i a R e^{i \theta}} - e^{i b R e^{i \theta}}}{R^2 e^{i 2 \theta}} + i \epsilon \int_{\pi}^0 d\phi \, e^{i \phi} \frac{e^{i a \epsilon e^{i \phi}} - e^{i b \epsilon e^{i \phi}}}{\epsilon^2 e^{i 2 \phi}}$$

where $PV$ denotes the Cauchy principal value of the integral.

As $R \to \infty$, the second integral vanishes. This is so because the magnitude of the integral is bounded by

$$\frac1{R} \int_0^{\pi} d\theta \, e^{-\min{(a,b)} R \sin{\theta} } \le \frac{2}{R} \int_0^{\pi/2} d\theta \, e^{-2 \min{(a,b)} R \theta/\pi} \le \frac{\pi}{\min{(a,b)} R^2}$$

We now consider the third integral as $\epsilon \to 0$. In this case, we Taylor expand the numerator and find that the integral has a limit:

$$i \epsilon \int_{\pi}^0 d\phi \, e^{i \phi} \frac{i a \epsilon e^{i \phi} - i \epsilon b e^{i \phi}}{\epsilon^2 e^{i 2 \phi}} = -\pi(b-a)$$

By Cauchy's theorem, the contour integral is zero. Thus, in these limits - and taking the real part of both sides - we find that

$$\int_{-\infty}^{\infty} dx \frac{\cos{ax}-\cos{b x}}{x^2} = \pi (b-a) $$

or

$$\int_{0}^{\infty} dx \frac{\cos{ax}-\cos{b x}}{x^2} = \frac{\pi}{2} (b-a) $$

Solution 2:

It can be seen as a limit case of Frullani's theorem, but it also follows from: $$\int_{0}^{+\infty}\left(\frac{\sin x}{x}\right)^2\,dx \stackrel{i.b.p.}{=}\int_{0}^{+\infty}\frac{\sin(2x)}{x}\,dx=\frac{\pi}{2} $$ since: $$ \int_{0}^{+\infty}\frac{1-\cos(ax)}{x^2}\,dx = 2\int_{0}^{+\infty}\left(\frac{\sin\frac{ax}{2}}{x}\right)^2\,dx. $$