= Solution
Integration by parts is legitimate after symmetrically excluding a neighborhood of zero; the boundary terms vanish because $\cos(nx)-\cos(mx)=O(x^2)$ at zero and is bounded at infinity. Hence
$$
\operatorname{PV}\int_{-\infty}^{\infty}
\frac{\cos nx-\cos mx}{x^2} dx
=-n\operatorname{PV}\int_{-\infty}^{\infty}\frac{\sin nx}{x} dx
+m\operatorname{PV}\int_{-\infty}^{\infty}\frac{\sin mx}{x} dx.
$$
The standard <Dirichlet integral>, obtained by closing the contour for $e^{iaz}/z$ in the upper half-plane and indenting above its pole at zero, is
$$
\operatorname{PV}\int_{-\infty}^{\infty}\frac{\sin(ax)}x dx=\pi
\qquad(a>0).
$$
Therefore
$$
\boxed{\operatorname{PV}\int_{-\infty}^{\infty}
\frac{\cos nx-\cos mx}{x^2} dx=\pi(m-n).}
$$
Back to article page