How do I integrate $\int_{0}^{\infty}\frac{\cos(ax)-\cos(bx)}{x^2}\text{d}x$, for positive and real $a,b$?
I know the contour that I have to use is a semicircle with a small semicircle cut out near $0$, which leaves me to calculate only the integral along the small cut-out (the bigger circle goes to $0$ as the radius goes to infinity, and the two other contours are equal because cosine is even).
Even with this, I'm still having trouble calculating the integral. I've tried to plug in $\cos(x) = \frac{e^{ix}-e^{-ix}}{2}$ but it doesn't seem to simplify the integral. Does anyone see a better way? Thanks for your help.
We have by parts$$\int_{0}^{\infty}\frac{\cos\left(ax\right)-\cos\left(bx\right)}{x^{2}}dx=-\left.\frac{\cos\left(ax\right)-\cos\left(bx\right)}{x}\right|_{0}^{\infty}+\int_{0}^{\infty}\frac{b\sin\left(bx\right)-a\sin\left(ax\right)}{x}dx.$$ Now split the integral in 2 and put $y=ax$ in the first and $y=bx$ in the second. You have$$\int_{0}^{\infty}\frac{b\sin\left(bx\right)-a\sin\left(ax\right)}{x}dx=\left(b-a\right)\int_{0}^{\infty}\frac{\sin\left(y\right)}{y}dy=\left(b-a\right)\frac{\pi}{2}.$$