Finding $\int_0^\infty \frac{\cos(ax)-\cos(bx)}{x}dx$ I am practicing calculus section of GRE Math Subject test, and I can't figure out a way to do the following integral:
$$\int_0^\infty \frac{\cos (ax) - \cos (bx)}{x}dx.$$
I absolutely have no clue how to do this. Can someone show me the solution explicitly? Thank you.
 A: 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}
$$
A: $$
\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
$$
A: 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)$$
A: Let $f(x)=e^{-\lambda x}\cos x$ and use the Frullani integral 
https://en.wikipedia.org/wiki/Frullani_integral,
$$\int_0^{\infty}\frac{f(ax)-f(bx)}{x}dx=[f(0)-f(\infty)]\ln\frac ba = \ln \frac ba$$
Thus, 
$$\int_0^\infty \frac{\cos (ax) - \cos (bx)}{x}dx $$
$$= \lim_{\lambda \rightarrow 0}\int_0^{\infty}\frac{e^{-\lambda ax}\cos(ax)-e^{-\lambda bx}\cos(bx)}{x}dx=\ln\frac ba$$
