Evaluate $\lim_{R\to\infty}\left(\int_0^R\left|\frac{\sin x}{x}\right|dx-\frac{2}{\pi}\log R\right)$ Is there a closed form of 
$$\lim_{R\to\infty}\left(\int_0^R\left|\frac{\sin x}{x}\right|dx-\frac{2}{\pi}\log R\right)$$
I am pretty interested whether we can find out a closed form of this limit. 
We can show that for $R=n\pi,n\in\mathbb{N}$, we have
$$\begin{aligned}
\int_0^R\left|\frac{\sin x}{x}\right|dx&=\sum_{k=0}^{n-1}\int_{k\pi}^{(k+1)\pi}\frac{|\sin x|}{x}dx\\
&=\sum_{k=0}^{n-1}\int_{0}^{\pi}\frac{\sin x}{(k+1)\pi-x}dx\\
&\leq \int_0^\pi\frac{\sin x}{\pi-x}dx+\sum_{k=1}^{n-1}\int_{0}^{\pi}\frac{\sin x}{k\pi}dx\\
&=\int_0^\pi\frac{|\sin(\pi-x)|}{x}dx+\sum_{k=1}^{n-1}\frac{2}{k\pi}dx\\
&=\int_0^\pi\frac{\sin x}{x}dx+\frac{2}{\pi}\sum_{k=1}^{n-1}\frac{1}{k}
\end{aligned}$$
On the other hand we have
$$\begin{aligned}
\int_0^R\left|\frac{\sin x}{x}\right|dx&\geq \sum_{k=0}^{n-1}\int_{0}^{\pi}\frac{\sin x}{(k+1)\pi}dx\\
&=\sum_{k=1}^n\frac{1}{k\pi}\int_0^\pi\sin xdx\\
&=\frac{2}{\pi}\sum_{k=1}^n\frac{1}{k}
\end{aligned}$$
Then I tried to apply the squeeze rule, but this does not lead to anything appetizing. Anybody know any tricks for this problem? 
 A: Getting a closed form seems probably hard, if not impossible. But at least we can show the limit exists. This follows from the following inequality:
$$\left|\int_{k\pi}^{(k+1)\pi}\frac{|\sin(t)|}{t}-\frac2\pi\int_{k\pi}^{(k+1)\pi}\frac1t\right|\le\frac{c}{k^2}.\quad(1)$$
Which you prove by comparing both integrals to $\frac2{k\pi}$. For the first, $$\int_{k\pi}^{(k+1)\pi}\frac{|\sin(t)|}{t}-\frac2{k\pi}
=\int_{k\pi}^{(k+1)\pi}|\sin(t)|\left(\frac1t-\frac1{k\pi}\right).$$Now if $k\pi\le t\le(k+1)\pi$ then $$\left|\frac1t-\frac1{k\pi}\right|=\frac{t-k\pi}{k\pi t}\le\frac{1}{k^2\pi}.$$Inserting this above shows that $$\left|\int_{k\pi}^{(k+1)\pi}\frac{|\sin(t)|}{t}-\frac2{k\pi}\right|\le\frac2{k^2\pi}.\quad(2)$$
Similarly $$\left|\frac2\pi\int_{k\pi}^{(k+1)\pi}\frac1t-\frac2{k\pi}\right|\le\frac c{k^2},\quad(3)$$and then (1) follows from (2) and (3).
A: We have
\begin{align*}
\int_0^{\pi N} {\left| {\frac{{\sin x}}{x}} \right|{\rm d}x} & = \frac{2}{\pi }\sum\limits_{k = 1}^N {\frac{1}{k}}  + \sum\limits_{k = 1}^N {\int_0^\pi  {\left[ {\frac{{\sin x}}{{\pi k - x}} - \frac{{\sin x}}{{\pi k}}} \right]{\rm d}x} } 
\\ & = \frac{2}{\pi }\sum\limits_{k = 1}^N {\frac{1}{k}}  + \sum\limits_{k = 1}^N {\int_0^\pi  {\frac{{x\sin x}}{{\pi k(\pi k - x)}}{\rm d}x} } .
\end{align*}
It is not difficult to show that the second sum converges as $N\to+\infty$ and the error committed by stopping at the $N$th term is $\mathcal{O}(N^{-1})$. Consequently, by using the standard approximation for the harmonic numbers,
\begin{align*}
\int_0^{\pi N} {\left| {\frac{{\sin x}}{x}} \right|{\rm d}x} & = \frac{2}{\pi }\log N + \frac{2}{\pi }\gamma  + \sum\limits_{k = 1}^\infty  {\int_0^\pi  {\frac{{x\sin x}}{{\pi k(\pi k - x)}}{\rm d}x} }  + \mathcal{O}\!\left( {\frac{1}{N}} \right)
\\ & = \frac{2}{\pi }\log N + \frac{2}{\pi }\gamma  + \sum\limits_{k = 1}^\infty  {\int_0^1 {\frac{{x\sin (\pi x)}}{{k(k - x)}}{\rm d}x} }  + \mathcal{O}\!\left( {\frac{1}{N}} \right)
\end{align*}
as $N\to +\infty$ ($\gamma$ being the Euler–Mascheroni constant). It is easy to see that
$$
\int_0^R {\left| {\frac{{\sin x}}{x}} \right|{\rm d}x}  - \int_0^{\pi \left\lfloor {R/\pi } \right\rfloor } {\left| {\frac{{\sin x}}{x}} \right|{\rm d}x}  = \mathcal{O}\!\left( {\frac{1}{R}} \right),
$$
whence
$$\boxed{
\int_0^R {\left| {\frac{{\sin x}}{x}} \right|dx}  = \frac{2}{\pi }\log R + C + \mathcal{O}\!\left( {\frac{1}{R}} \right)}
$$
as $R\to +\infty$, with
$$\boxed{
C = \frac{2}{\pi }(\gamma  - \log \pi ) + \sum\limits_{k = 1}^\infty  {\int_0^1 {\frac{{x\sin (\pi x)}}{{k(k - x)}}{\rm d}x} } .}
$$
We may obtain a some alternative expressions for $C$ as follows. Note that
\begin{align*}
&\sum\limits_{k = 1}^\infty  {\int_0^1 {\frac{{x\sin (\pi x)}}{{k(k - x)}}{\rm d}x} }  = \int_0^1 {\left( {\sum\limits_{k = 1}^\infty  {\frac{x}{{k(k - x)}}} } \right)\sin (\pi x){\rm d}x}\\ &  =  - \int_0^1 {(\gamma  + \psi (1 - x))\sin (\pi x){\rm d}x} 
 =  - \frac{{2\gamma }}{\pi } - \int_0^1 {\psi (1 - x)\sin (\pi x){\rm d}x}  \\ & =  - \frac{{2\gamma }}{\pi } - \int_0^1 {\psi (t)\sin (\pi t){\rm d}t}  =  - \frac{{2\gamma }}{\pi } + \pi \int_0^1 {\log \Gamma (t)\cos (\pi t){\rm d}t} .
\end{align*}
Here $\psi$ and $\Gamma$ are the digamma function and the gamma function, respectively. Consequently,
$$\boxed{
C = - \frac{{2\log \pi }}{\pi } -\int_0^1 {\psi (t)\sin (\pi t){\rm d}t}=  - \frac{{2\log \pi }}{\pi } + \pi \int_0^1 {\log \Gamma (t)\cos (\pi t){\rm d}t} .}
$$
Using the Fourier series of $\log\Gamma(t)$, we find
\begin{align*}
\int_0^1 {\log \Gamma (t)\cos (\pi t){\rm d}t} & = \frac{{2(\gamma  + \log (2\pi ))}}{{\pi ^2 }} + \frac{4}{{\pi ^2 }}\sum\limits_{n = 1}^\infty  {\frac{{\log n}}{{4n^2  - 1}}} 
\\ & = \frac{{2(\gamma  + \log (2\pi ))}}{{\pi ^2 }} + \frac{4}{{\pi ^2 }}\sum\limits_{n = 1}^\infty  {\frac{{\log n}}{{(2n - 1)(2n + 1)}}} 
\\ & = \frac{{2(\gamma  + \log (2\pi ))}}{{\pi ^2 }} - \frac{2}{{\pi ^2 }}\sum\limits_{n = 2}^\infty  {\frac{{\log (1 - 1/n)}}{{2n - 1}}} .
\end{align*}
Hence,
$$\boxed{
C =\frac{2}{\pi }\left[ {\gamma  + \log 2 +2 \sum\limits_{n = 1}^\infty  {\frac{{\log n}}{{4n^2  - 1}}}} \right]= \frac{2}{\pi }\left[ {\gamma  + \log 2 - \sum\limits_{n = 2}^\infty  {\frac{{\log (1 - 1/n)}}{{2n - 1}}} } \right].}
$$
Numerically, $C= 1.1129238102\ldots$. Note that
$$
\int_0^1 {\psi (t)\sin (\pi t){\rm d}t}  = \int_0^1 {\psi (t + 1)\sin (\pi t){\rm d}t}  - \int_0^\pi  {\frac{{\sin t}}{t}{\rm d}t} ,
$$
and the latter is easier to compute numerically.
