# Switching Limit and Integral in Improper Integral

I am trying to evaluate the improper integral: $$\int_{0}^{\infty}\frac{\cos(\alpha x)-\cos(\beta x)}{x}\,dx,$$ with $$\alpha,\beta>0$$.

After observing that the integrand is equal to $$\int_{\alpha}^\beta \sin(tx)\,dt$$, I am nearly there. In particular, I need to evaluate the integral: $$\int_{\alpha}^{\beta}\left[\lim_{R\to \infty} \frac{\cos(tR)}{t} \right]\,dt.$$

I would like to make a change of variables and write $$\zeta=tR$$, but I am struggling to be rigorous when it comes to handling the limit operation inside the integral. In particular, I think that I have: $$\int_{\alpha}^{\beta}\left[\lim_{R\to \infty} \frac{\cos(tR)}{t} \right]\,dt=\int_{\alpha R}^{\beta R}\left[\lim_{R \to \infty}\frac{\cos(\zeta)}{\zeta} \right]\,d\zeta,$$ and I would love to write: $$\int_{\alpha R}^{\beta R}\left[\lim_{R \to \infty}\frac{\cos(\zeta)}{\zeta} \right]\,d\zeta=\lim_{R\to \infty}\int_{\alpha R}^{\beta R}\frac{\cos \zeta}{\zeta}\,d\zeta.$$ But I am worried that bringing the limit outside the integral wasn't legal, especially since $$\mathbf{R\to \infty}\implies \mathbf{\zeta \to \infty}$$. If it is legal, then I plan on showing (using Dirichlet's test for improper integrals) that the improper integral $$\int_{a}^\infty \frac{\cos\zeta}{\zeta} \,d\zeta$$ converges for any $$a\geq0$$. Then the integral I want to evaluate (in the indented equation immediately above) must go to zero, since it is the tail end of a convergent improper integral using a Cauchy Criterion related argument.

Is it immediately clear whether or not my interchange of limit and integral was allowed? If not, is there a way I could justify it?

• The limit interchange has a specific regularity issue that pops up all the time in Fourier analysis. But if I may suggest an alternative that may be easier to evaluate, I am writing up the answer now. – Ninad Munshi May 18 '20 at 13:35
• @NinadMunshi, thank you for the suggestion! That is a really cool manipulation that makes the solution a lot simpler. – Will May 18 '20 at 15:57
• @Will: I show below how the Frullani approach still works in this case even though the limit of $\cos x$ does not exist – RRL May 18 '20 at 15:58

Instead let's try to make use of the following manipulation:

$$\int_0^\infty \frac{\cos(\alpha x) - \cos(\beta x)}{x}\:dx = \int_0^\infty \int_0^\infty e^{-yx}\left[\cos(\alpha x) - \cos(\beta x)\right]\:dy\:dx$$

then switch the order of integration (which is more easily justifiable then the limit interchange) to get

$$= \int_0^\infty \frac{y}{\alpha^2+y^2}-\frac{y}{\beta^2+y^2}\:dy = \log\left(\frac{\beta}{\alpha}\right)$$

This can be handled similarly to the Frullani integral even though $$\cos x$$ does not have a limit as $$x \to \infty$$.

It is straightforward to show (see here) that

$$\int_0^1 \frac{\cos(\alpha x)-\cos(\beta x)}{x}\,dx = \log \frac{\beta}{\alpha}- \int_\alpha^\beta \frac{\cos x}{x} \, dx,$$

and with the substitution $$x = Ru$$,

$$\int_0^R \frac{\cos(\alpha x)-\cos(\beta x)}{x}\,dx = \log \frac{\beta}{\alpha}- \int_{\alpha R}^{\beta R} \frac{\cos u}{u} \, du$$

By the second mean value theorem for integrals there exists $$\xi \in (\alpha R, \beta R)$$ such that

$$\left|\int_{\alpha R}^{\beta R} \frac{\cos u}{u} \, du\right| = \left|\frac{1}{\alpha R} \int_{\alpha R}^{\xi} \cos u\, du\right| = \frac{|\sin \xi - \sin( \alpha R)|}{\alpha R} \leqslant \frac{2}{\alpha R}$$

Therefore,

$$\int_0^\infty \frac{\cos(\alpha x)-\cos(\beta x)}{x}\,dx = \log \frac{\beta}{\alpha}-\underbrace{\lim_{R \to \infty}\int_{\alpha R}^{\beta R} \frac{\cos u}{u} \, du}_{= 0} = \log \frac{\beta}{\alpha}$$

• Thank you for taking the time to write that out for me. I had spent quite some time trying to show that the integral went to zero without success, but the second MVT for integrals is a really nice way of solving that problem. – Will May 18 '20 at 18:39
• @Will: You're welcome. The point is you don't need to worry about switching limits and infinite integrals nor switching iterated infinite integrals . – RRL May 18 '20 at 18:43