$\newcommand{\ángulos}[1]{\left\langle\, nº 1 \,\right\rangle}
\newcommand{\llaves}[1]{\left\lbrace\, nº 1 \,\right\rbrace}
\newcommand{\bracks}[1]{\left\lbrack\, nº 1 \,\right\rbrack}
\newcommand{\ceil}[1]{\,\left\lceil\, nº 1 \,\right\rceil\,}
\newcommand{\dd}{{\rm d}}
\newcommand{\ds}[1]{\displaystyle{#1}}
\newcommand{\dsc}[1]{\displaystyle{\color{red}{#1}}}
\newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
\newcommand{\fermi}{\,{\rm f}}
\newcommand{\piso}[1]{\,\left\lfloor #1 \right\rfloor\,}
\newcommand{\mitad}{{1 \over 2}}
\newcommand{\ic}{{\rm i}}
\newcommand{\iff}{\Longleftrightarrow}
\newcommand{\imp}{\Longrightarrow}
\newcommand{\Li}[1]{\,{\rm Li}_{#1}}
\newcommand{\norm}[1]{\left\vert\left\vert\, nº 1\,\right\vert\right\vert}
\newcommand{\pars}[1]{\left (\, nº 1 \,\right)}
\newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\parcial #3^{#1}}}
\newcommand{\pp}{{\cal P}}
\newcommand{\raíz}[2][]{\,\sqrt[#1]{\vphantom{\large Un}\,#2\,}\,}
\newcommand{\sech}{\,{\rm sech}}
\newcommand{\sgn}{\,{\rm sgn}}
\newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
\newcommand{\ul}[1]{\underline{#1}}
\newcommand{\verts}[1]{\left\vert\, nº 1 \,\right\vert}$
$\ds{a\,,\ b\ >\ 0}$.
\begin{align}&\color{#66f}{\large%
\int_{0}^{\infty}{\cos\pars{bx} - \cos\pars{ax} \over x}\,\dd x}
=\Re\ \overbrace{\int_{0}^{\infty}{\expo{\ic bx} - \expo{\ic ax} \over x}\,\dd x}
^{\ds{\dsc{x}\ =\ \dsc{\ic t}\ \imp\ \dsc{t}\ =\ \dsc{-\ic x}}}
\\[5mm]&=\Re\int_{0}^{-\infty\ic}{\expo{-bt} - \expo{-at} \over \ic t}\,\ic\,\dd t\\[5mm]&=\Re\lim_{R\ \to\ \infty}\braces{%
\left.-\int_{-\pi/2}^{0}{\expo{-bt} - \expo{-at} \over t}\,\dd t\,
\right\vert_{\, t\ =\ R\expo{\ic\theta}}
-\int_{R}^{0}{\expo{-bt} - \expo{-at} \over t}\,\dd t}
\end{align}
De hecho,$\ds{\pars{~\dsc{\tt\mbox{there is a proof at the very end}}~}}$,
$$
\lim_{R\ \para\ \infty}\Re\llaves{\left.-\int_{-\pi/2}^{0}{\expo {bt} - \expo{-al} \over t}\,\dd t\,
\right\vert_ {\t\ =\ R\expo{\ic\theta}}} = 0
$$
tal que
\begin{align}&\color{#66f}{\large%
\int_{0}^{\infty}{\cos\pars{bx} - \cos\pars{ax} \over x}\,\dd x}
=\int_{0}^{\infty}{\expo{-bt} - \expo{-at} \over t}\,\dd t
\\[5mm]&=-\int_{0}^{\infty}\ln\pars{t}\bracks{-b\expo{-bt} + a\expo{-at}}\,\dd t
=\int_{0}^{\infty}\ln\pars{t \over b}\expo{-t}\,\dd t
-\int_{0}^{\infty}\ln\pars{t \over a}\expo{-t}\,\dd t
\\[5mm]&=\ln\pars{a \over b}\int_{0}^{\infty}\expo{-t}\,\dd t
=\color{#66f}{\large\ln\pars{a \over b}}
\end{align}
Tenga en cuenta que
\begin{align}
0&<\verts{%
\Re\braces{\left.-\int_{-\pi/2}^{0}{\expo{-bt} - \expo{-at} \over t}\,\dd t\,
\right\vert_{\, t\ =\ R\expo{\ic\theta}}}}
=\verts{\Re\int_{-\pi/2}^{0}
\pars{\expo{-bR\expo{\ic\theta}} - \expo{-aR\expo{\ic\theta}}}\,\dd\theta}
\\[5mm]&<\int_{-\pi/2}^{0}
\pars{\expo{-bR\cos\pars{\theta}} + \expo{-aR\cos\pars{\theta}}}\,\dd\theta
=\int_{0}^{\pi/2}
\pars{\expo{-bR\sin\pars{\theta}} + \expo{-aR\sin\pars{\theta}}}\,\dd\theta
\\[5mm]&<\int_{0}^{\pi/2}
\pars{\expo{-2bR\theta/\pi} + \expo{-2aR\theta/\pi}}\,\dd\theta
\\[5mm]&={\pi \over 2b}\,{1 - \expo{-bR} \over R}
+{\pi \over 2a}\,{1 - \expo{-aR} \over R}\color{#66f}{\large\ \to\ 0\quad
\mbox{when}\quad R\ \to\ \infty}
\end{align}