Finding $\int_0^\infty \frac{\cos(ax)-\cos(bx)}{x}dx$ [duplicate]

Since $\lim\limits_{x\to\infty}\cos(x)$ does not exist, we can't simply apply Frullani Integrals, but we can use the ideas behind them: $$ \begin{align} \int_0^\infty\frac{\cos(ax)-\cos(bx)}{x}\,\mathrm{d}x &=\lim_{\substack{\epsilon\to0^+\\M\to+\infty}}\int_\epsilon^M\frac{\cos(ax)-\cos(bx)}{x}\,\mathrm{d}x\\ &=\lim_{\substack{\epsilon\to0^+\\M\to+\infty}}\left[\int_{a\epsilon}^{aM}\frac{\cos(x)}{x}\,\mathrm{d}x-\int_{b\epsilon}^{bM}\frac{\cos(x)}{x}\,\mathrm{d}x\right]\\ &=\lim_{\substack{\epsilon\to0^+\\M\to+\infty}}\left[\int_{a\epsilon}^{b\epsilon}\frac{\cos(x)}{x}\,\mathrm{d}x-\int_{aM}^{bM}\frac{\cos(x)}{x}\,\mathrm{d}x\right]\\ &=\log(b/a)-\lim_{M\to+\infty}\int_{aM}^{bM}\frac1x\,\mathrm{d}\sin(x)\\ &=\log(b/a)-\lim_{M\to+\infty}\left[\frac{\sin(bM)}{bM}-\frac{\sin(aM)}{aM}+\int_{aM}^{bM}\frac{\sin(x)}{x^2}\,\mathrm{d}x\right]\\[6pt] &=\log(b/a) \end{align} $$


$$ \int_0^\infty\frac{\cos (ax)-\cos (bx)}x dx=\int_0^\infty dx\int_a^b\sin ux du =\int_a^b du \int_0^\infty{\sin u x}\, dx =\int_a^b\frac { du}u=\ln\left|\frac ba\right| $$

where $$ \int_0^\infty{\sin u x}\, dx =\lim_{b\to0}\int_0^\infty{e^{-b x}\sin u x}\, dx=\lim_{b\to0}\frac u {b^2+u^2}=\frac1u $$


Let $Y\geqslant X\geqslant 0$, you have $$ \int_{X}^{Y}{\frac{\cos(ax)-\cos(bx)}{x}dx}=\int_{aX}^{aY}{\frac{\cos(u)}{u}du}-\int_{bX}^{bY}{\frac{\cos(u)}{u}du} $$ Since $\cos$ is even we can suppose $a,b>0$. Hence letting $Y\rightarrow+\infty$ gives $$ \int_{X}^{+\infty}{\frac{\cos(ax)-\cos(bx)}{x}dx}=\int_{aX}^{+\infty}{\frac{\cos(u)}{u}du}-\int_{bX}^{+\infty}{\frac{\cos(u)}{u}du}=\int_{aX}^{bX}{\frac{\cos(u)}{u}du}$$ Letting $X\rightarrow 0$ gives $$ \int_{0}^{+\infty}{\frac{\cos(ax)-\cos(bx)}{x}dx}=\ln\left(\frac{b}{a}\right)$$