Evaluate integral: $\int_0^{+\infty}\frac{\cos{bx}-\cos{ax}}{x}dx$ It seems that $\displaystyle\int_0^{+\infty}\frac{\cos x}{x}$ is divergent,
so how to solve this problem?

$$\int_0^\infty \frac{\cos bx -\cos ax}{x}\, dx\quad,\quad\mbox{where}\,a,b>0$$

It's really a great challenge for me.
If there's any advice of hint I would be grateful!
 A: Denote $$I(y)=\int_0^{+\infty}\frac{\cos bx-\cos ax}{x}e^{-yx}dx, y\in[0,+\infty)$$
Then $$I'(y)=-\int_0^{+\infty}(\cos bx-\cos ax)e^{-yx}dx=\frac{y}{y^2+a^2}-\frac{y}{y^2+b^2}$$ and $$I(+\infty)=0$$
So $$I(0)=-\int_0^{+\infty}(\frac{y}{y^2+a^2}-\frac{y}{y^2+b^2})dy=\ln\frac{a}{b}$$
A: In general, if $f(x)$ is a continuous function over $(0, \infty)$ such that following two limits exist
$$\begin{cases}
f_0 &= \lim\limits_{x\to 0} f(x),\\
f_\infty &= \lim\limits_{x\to\infty} f(x)
\end{cases}$$
then 
$$\int_0^\infty \frac{f(bx) - f(ax)}{x} dx = (f_0 - f_\infty)\log\frac{a}{b}\tag{*1}$$
This is known as Frullani integral.
In your cases $f_0$ exists but $f_\infty$ doesn't. However, there is a generalization which only require the existence of following limit:
$$f_\infty^{alt} = \lim_{L\to\infty}\frac1L\int_1^L f(t) dt$$
For $f(t) = \cos(t)$, $f_0 = 1, f_\infty^{alt} = 0$. $(*1)$ tells us
$$\int_0^\infty \frac{\cos(bx)-\cos(ax)}{x} dx = (1 - 0) \log\frac{a}{b} = \log\frac{a}{b}$$
For a proof of Frullani's theorem, look at answers in this question.
In particular, this answer which cover the generalized version you need.
A: \begin{align}
\int_0^\infty \frac{\cos bx -\cos ax}{x}\, dx&=\int_0^\infty \bigg[\cos bx -\cos ax\bigg]\int_0^\infty e^{-xy}\,dy\,\, dx\\
&=\int_0^\infty\int_0^\infty \bigg[e^{-xy}\cos bx -e^{-xy}\cos ax\bigg] \,dx\, dy\\
&=\lim_{s\to\infty}\int_0^s \bigg[\frac{y}{y^2+b^2} -\frac{y}{y^2+a^2}\bigg] \,dy\\
&=\ln\left(\frac{a}{b}\right)
\end{align}
A: $\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
 \newcommand{\ceil}[1]{\,\left\lceil\, #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{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}
 \newcommand{\half}{{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\, #1\,\right\vert\right\vert}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#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\, #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}

Indeed $\ds{\pars{~\dsc{\tt\mbox{there is a proof at the very end}}~}}$,
  $$
\lim_{R\ \to\ \infty}\Re\braces{\left.-\int_{-\pi/2}^{0}{\expo{-bt} - \expo{-at} \over t}\,\dd t\,
\right\vert_{\, t\ =\ R\expo{\ic\theta}}} = 0
$$
  such that

\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}

Note that

\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}
A: The cosine integral is defined by $$ \text{Ci}(x) = - \int_{x}^{\infty} \frac{\cos t}{t} \ dt. $$
Using this definition, $$ \int_{x}^{\infty} \frac{\cos at}{t} \ dt = \int_{ax}^{\infty} \frac{\cos u}{u} \ du = - \text{Ci}(ax). $$
Therefore,
$$ \begin{align} \int_{0}^{\infty} \frac{\cos bx - \cos ax}{x} \ dx &= \lim_{\epsilon \to 0^{+}} \left( \int_{\epsilon}^{\infty} \frac{\cos bx}{x} \ dx - \int_{\epsilon}^{\infty}\frac{\cos ax}{x} \ dx \right) \\ &= \lim_{\epsilon \to 0^{+}} \left(-\text{Ci}(b \epsilon) + \text{Ci}(a \epsilon) \right) \\ &= \lim_{\epsilon \to 0^{+}} \left( - \ln(b \epsilon) + \ln(a \epsilon) +\mathcal{O}(\epsilon^{2})\right) \tag{1} \\ &= \lim_{\epsilon \to 0^{+}} \left( \ln \left( \frac{a}{b}\right) + \mathcal{O}(\epsilon^{2})\right) \\ &= \ln \left( \frac{a}{b} \right). \end{align}$$
$(1)$ http://en.wikipedia.org/wiki/Trigonometric_integral#Convergent_series
