# Determine whether $\lim_{R\to\infty}\int_0^R\frac{|\sin x|}{x}dx-\frac{2}{\pi}\ln R$ exists

Let

$$J(R):=\int_0^R\frac{|\sin x|}{x}dx.$$

(i) Show that $$\lim_{R\to\infty}\frac{J(R)}{\ln R}$$ exists and determine its value

(ii)Does

$$\lim_{R\to\infty}J(R)-\frac{2}{\pi}\ln R$$ exist? If so, find the limit. If not, explain why the limit does not exist.

I have done part (i), and I got

$$\lim_{R\to\infty}\frac{J(R)}{\ln R}=\frac{2}{\pi}$$

Moreover, it can be shown that

$$|J(R)-\frac{2}{\pi}\ln R|<2\pi$$

for sufficiently large $R$.

I am having trouble with part (ii), I think the limit exists, but I don't know how to figure it out.

We may compute the Fourier cosine series of $\left|\sin x\right|$ to get: $$\begin{eqnarray*}\left|\sin x\right|=\frac{2}{\pi}-\frac{4}{\pi}\sum_{n\geq 1}\frac{\cos(2nx)}{4n^2-1}=\frac{8}{\pi}\sum_{n\geq 1}\frac{\sin^2(nx)}{4n^2-1}\end{eqnarray*} \tag{1}$$ and $$\begin{eqnarray*} \int_{0}^{k\pi}\frac{\left|\sin x\right|}{x}\,dx &=& \int_{0}^{\pi}\sin(x)\left(\frac{1}{x}+\frac{1}{x+\pi}+\ldots+\frac{1}{x+(k-1)\pi}\right)\,dx\\&=&\left.(1-\cos x)\left(\frac{1}{x}+\frac{1}{x+\pi}+\ldots+\frac{1}{x+(k-1)\pi}\right)\right|_{0}^{\pi}+\int_{0}^{\pi}\left(1-\cos x\right)\left(\frac{1}{x^2}+\frac{1}{(x+\pi)^2}+\ldots+\frac{1}{(x+(k-1)\pi)^2}\right)\,dx\tag{2}\end{eqnarray*}$$ leads to: $$\int_{0}^{k\pi}\frac{\left|\sin x\right|}{x} = \frac{2H_k}{\pi}+\int_{0}^{\pi}(1-\cos x)\sum_{j=0}^{k-1}\frac{1}{(x+j\pi)^2}\,dx\tag{3}$$ so:
$$\lim_{k\to +\infty}\left(\int_{0}^{k\pi}\frac{\left|\sin x\right| }{x}\,dx-\frac{2 H_k}{\pi}\right) = \frac{1}{\pi^2}\int_{0}^{\pi}(1-\cos x)\,\psi'\!\left(\frac{x}{\pi}\right)\,dx\tag{4}$$
and part $(ii)$ just relies on the evaluation of the last integral, that gives the wanted limit.
The RHS of $(4)$ is:
$$\frac{2}{\pi}\int_{0}^{1}\sin^2\left(\frac{\pi x}{2}\right)\,\psi'(x)\,dx\leq \frac{\pi}{2}\int_{0}^{1}x^2 \psi'(x)\,dx=\frac{\pi}{2}\left(\log(2\pi)-\gamma\right)\leq 2.\tag{5}$$