Evaluate this $\lim\limits_{n \to \infty}\int\limits_{1/n}^{n}\left(\cos x-\cos(x/2)\right)\frac{\ln x}{x}dx$

definite integralsintegrationlimits

We seeking to evaluate this integral
$$\lim_{n \to \infty}\int_{1/n}^{n}\left(\cos x-\cos(x/2)\right)\frac{\ln x}{x}\mathrm dx$$

using

$\cos a -\cos b=-2\sin[(a+b)/2]\sin[(a-b)/2]$

$$\lim_{n \to \infty}-2\int_{1/n}^{n}\sin\left(\frac{3x}{4}\right)\sin\left(\frac{x}{4}\right)\frac{\ln x}{x}\mathrm dx$$

I stuck, not sure what to do next.


$v=\int \frac{\ln x}{x}=\frac{1}{2}\ln^2 x$

$u^{'}=-\sin x+\frac{1}{2}\sin(x/2)$

$$\int \left(\cos x-\cos(x/2)\right)\frac{\ln x}{x}\mathrm dx=\left[\cos x-\cos(x/2)\right]\frac{\ln^2 x}{2}-\frac{1}{2}\int \left[-\sin x+\frac{1}{2}\sin(x/2)\right]\ln^2 x$$

this integral it getting more complicated due to $\ln^2 x$

Best Answer

By letting $t=x/2$, we have that $$\int_{1/n}^{n}\cos(x/2)\frac{\ln (x)}{x}dx=\int_{1/(2n)}^{n/2}\cos(t)\frac{\ln(t) +\ln(2)}{t}dt$$ Hence $$\begin{align}\int_{1/n}^{n}\left(\cos x-\cos(x/2)\right)\frac{\ln(x)}{x}\,dx&= \int_{n/2}^{n}\frac{\cos(x)}{x}\ln(x)dx-\int_{1/(2n)}^{1/n}\frac{\cos(x)}{x}\ln(x)\,dx \\ &\qquad-\ln(2)\int_{1/(2n)}^{n/2}\frac{\cos(x)}{x}\,dx.\end{align}$$ Now show that $$\begin{align} &\lim_{n\to \infty}\int_{n/2}^{n}\frac{\cos(x)}{x}\ln(x)\,dx=0,\\ &\lim_{n\to \infty}\int_{1/(2n)}^{1/n}\frac{\cos(x)-1}{x}\ln(x)\,dx=0. \end{align}$$ Morever $$\lim_{n\to \infty}\left(\int_{1/(2n)}^{n/2}\frac{\cos(x)}{x}\,dx-\ln(n)\right) =\lim_{n\to \infty} (-\text{Ci}(\frac{1}{2n})-\ln(n))=\ln(2)-\gamma.$$ where $\text{Ci}(x)$ is the cosine integral (recall that $\text{Ci}(x)=\ln(x)+\gamma+o(1)$, as $x\to 0$).

Therefore $$\int_{1/(2n)}^{n/2}\frac{\cos(x)}{x}dx=\ln(n)+\ln(2)-\gamma+o(1),$$ and $$\int_{1/(2n)}^{1/n}\frac{\cos(x)}{x}\ln(x)\,dx =-\ln(2)\ln(n)-\frac{\ln^2(2)}{2}+o(1).$$ Thus we may conclude that $$\lim_{n \to \infty}\int_{1/n}^{n}\left(\cos x-\cos(x/2)\right)\frac{\ln (x)}{x} \, dx=\boxed{\gamma \ln (2)-\frac{\ln^2(2)}{2}}.$$