Is there other methods to evaluate $\int_1^{\infty}\frac{\{x\}-\frac{1}{2}}{x}\ \mathrm dx$?
Solution 1:
\begin{align} \int_1^{\infty}\frac{\{x\}-\frac{1}{2}}{x}\ \mathrm dx &=\sum_{n=1}^\infty\int_n^{n+1}\frac{x-n-\frac{1}{2}}{x}\ \mathrm dx\\[9pt] &=\sum_{n=1}^\infty\left[1-\left(n+\frac{1}{2}\right)\ln\left(\frac{n+1}{n}\right)\right]\\[9pt] &=\sum_{n=1}^\infty\left[\ln e+\left(n+\frac{1}{2}\right)\ln\left(\frac{n}{n+1}\right)\right]\\[9pt] &=\sum_{n=1}^\infty \ln\left(e\left(\frac{n}{n+1}\right)^{n}\sqrt{\frac{n}{n+1}}\right)\\ &= \ln\left(\prod_{n=1}^\infty e\left(\frac{n}{n+1}\right)^{n}\sqrt{\frac{n}{n+1}}\right)\\[9pt] &= \ln\left(\frac{\sqrt{2\pi}}{e}\right)\tag{$\spadesuit$}\\[9pt] &=\bbox[8pt,border:3px #FF69B4 solid]{\color{red}{\large\ln\left(\,\sqrt{2\pi}\,\right)-1}} \end{align}
$$(\spadesuit)$$
Solution 2:
Original Approach
Using $\color{#00A000}{\text{telescoping series}}$ and $\color{#C00000}{\text{Stirling's Formula}}$, we get $$ \begin{align} \int_1^\infty\frac{\{x\}-\frac12}{x}\mathrm{d}x &=\sum_{k=1}^\infty\int_0^1\frac{t-\frac12}{k+t}\mathrm{d}t\\ &=\lim_{n\to\infty}\sum_{k=1}^n\left(1\color{#00A000}{-(k+\tfrac12)\log\left(\frac{k+1}{k}\right)}\right)\\ &=\lim_{n\to\infty}\left(n\color{#00A000}{+\sum_{k=1}^n(k+\tfrac12)\log(k)-\sum_{k=2}^{n+1}(k-\tfrac12)\log(k)}\right)\\ &=\lim_{n\to\infty}\left(n+\color{#C00000}{\sum_{k=2}^n\log(k)}-(n+\tfrac12)\log(n+1)\right)\\ &=\lim_{n\to\infty}\left(n+\color{#C00000}{\left[(n+\tfrac12)\log(n)-n+\tfrac12\log(2\pi)\right]}-(n+\tfrac12)\log(n+1)\right)\\ &=\tfrac12\log(2\pi)+\lim_{n\to\infty}\left((n+\tfrac12)\log\left(\frac{n}{n+1}\right)\right)\\[4pt] &=\tfrac12\log(2\pi)-1 \end{align} $$
Another Approach
I just realized that this also relates to the approximation $$ n!\sim\sqrt{2\pi}\,\frac{\left(n+\tfrac12\right)^{n+\frac12}}{e^{n+\frac12}}\tag1 $$ The relative error in $(1)$ is about half that of Stirling's Formula.
Using Riemann-Stieltjes integration,
$$
\begin{align}
\int_1^\infty\frac{\{x\}-\frac12}{x}\mathrm{d}x
&=\lim_{n\to\infty}\int_1^{n+\frac12}\left(\{x\}-\tfrac12\right)\mathrm{d}\log(x)\tag{2a}\\[3pt]
&=\lim_{n\to\infty}\int_1^{n+\frac12}\log(x)\,\mathrm{d}\left(\lfloor x\rfloor-x\right)\tag{2b}\\
&=\lim_{n\to\infty}\left(\log(n!)-\left[x\log(x)-x\vphantom{\int}\right]_1^{n+\frac12}\right)\tag{2c}\\[3pt]
&=-1+\lim_{n\to\infty}\left(\log(n!)-\left(n+\tfrac12\right)\log\left(n+\tfrac12\right)+\left(n+\tfrac12\right)\right)\tag{2d}\\[6pt]
&=-1+\tfrac12\log\left(2\pi\right)\tag{2e}
\end{align}
$$
Explanation:
$\text{(2a)}$: write the improper integral as a limit
$\phantom{\text{(2a):}}$ and prepare to integrate by parts
$\text{(2b)}$: integrate by parts and use
$\phantom{\text{(2b):}}$ $\mathrm{d}\!\left(\{x\}-\frac12\right)=\mathrm{d}\!\left(x-\lfloor x\rfloor\right)$
$\text{(2c)}$: integrate
$\text{(2d)}$: evaluate the integral at its limits
$\text{(2e)}$: apply $(1)$
Solution 3:
$\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle} \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack} \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,} \newcommand{\dd}{{\rm d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\dsc}[1]{\displaystyle{\color{red}{#1}}} \newcommand{\expo}[1]{\,{\rm e}^{#1}\,} \newcommand{\fermi}{\,{\rm f}} \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,} \newcommand{\half}{{1 \over 2}} \newcommand{\ic}{{\rm i}} \newcommand{\iff}{\Longleftrightarrow} \newcommand{\imp}{\Longrightarrow} \newcommand{\Li}[1]{\,{\rm Li}_{#1}} \newcommand{\pars}[1]{\left(\, #1 \,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\pp}{{\cal P}} \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,} \newcommand{\sech}{\,{\rm sech}} \newcommand{\sgn}{\,{\rm sgn}} \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}} \newcommand{\ul}[1]{\underline{#1}} \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$ A 'nice byproduct' of the following evaluation is the identity: $$ \color{#66f}{\large% \int_{1}^{\infty}{\braces{x} - 1/2 \over x}\,\dd x} =\color{#66f}{\large\int_{0}^{1}\ln\pars{\Gamma\pars{x + 1}}\,\dd x} $$
\begin{align}&\color{#66f}{\large% \int_{1}^{\infty}{\braces{x} - 1/2 \over x}\,\dd x} =\int_{1}^{\infty}{x - \floor{x} - 1/2 \over x}\,\dd x \\[5mm]&=\int_{1}^{2}{x - 1 - 1/2 \over x}\,\dd x +\int_{2}^{3}{x - 2 - 1/2 \over x}\,\dd x + \cdots \\[5mm]&=\int_{0}^{1}{x - 1/2 \over x + 1}\,\dd x +\int_{0}^{1}{x - 1/2 \over x + 2}\,\dd x + \cdots =\lim_{N\ \to\ \infty}\int_{0}^{1} \sum_{n\ =\ 0}^{N}{x - 1/2 \over x + n + 1}\,\dd x \\[5mm]&=\lim_{N\ \to\ \infty}\int_{0}^{1}\pars{x - \half} \sum_{n\ =\ 0}^{\infty}\pars{{1 \over n + x + 1} - {1 \over n + x + N + 2}}\,\dd x \\[5mm]&=\lim_{N\ \to\ \infty}\int_{0}^{1}\pars{x - \half}\bracks{% \Psi\pars{x + N + 2} - \Psi\pars{x + 1}}\,\dd x \end{align} where $\ds{\Psi\pars{z} \equiv \totald{\ln\pars{\Gamma\pars{z}}}{z}}$ is the Digamma Function .
Then, \begin{align}&\color{#66f}{\large% \int_{1}^{\infty}{\braces{x} - 1/2 \over x}\,\dd x} =\lim_{N\ \to\ \infty}\int_{0}^{1}\pars{x - \half} \bracks{\ln\pars{x + N + 2} - \Psi\pars{x + 1}}\,\dd x \\[5mm]&=\ \overbrace{% \lim_{N\ \to\ \infty}\int_{0}^{1}\pars{x - \half}\ln\pars{x + N + 2}\,\dd x} ^{\ds{=}\ \dsc{0}}\ -\ \int_{0}^{1}\pars{x - \half}\,\totald{\ln\pars{\Gamma\pars{x + 1}}}{x}\,\dd x \\[5mm]&=-\left.\ln\pars{\Gamma\pars{x + 1}}\pars{x - \half} \right\vert_{x\ =\ 0}^{x\ =\ 1} +\int_{0}^{1}\ln\pars{\Gamma\pars{x + 1}}\,\dd x \\[5mm]&=\underbrace{% -\ln\pars{\Gamma\pars{2}}\half + \ln\pars{\Gamma\pars{1}}\pars{-\,\half}} _{\ds{=}\ \dsc{0}}\ +\ \int_{0}^{1}\ln\pars{\Gamma\pars{x + 1}}\,\dd x \end{align}
$$ \color{#66f}{\large% \int_{1}^{\infty}{\braces{x} - 1/2 \over x}\,\dd x} =\color{#66f}{\large\int_{0}^{1}\ln\pars{\Gamma\pars{x + 1}}\,\dd x} $$
However, \begin{align} \int_{0}^{1}\ln\pars{\Gamma\pars{x + 1}}\,\dd x& =\int_{0}^{1}\ln\pars{x}\,\dd x +\int_{0}^{1}\ln\pars{\Gamma\pars{x}}\,\dd x =-1+\int_{0}^{1}\ln\pars{\Gamma\pars{1 - x}}\,\dd x \\[5mm]&=-1+\int_{0}^{1}\ln\pars{\pi \over \sin\pars{\pi x}\Gamma\pars{x}}\,\dd x \\[5mm]&=-1 + \ln\pars{\pi} -{1 \over\pi}\ \underbrace{\int_{0}^{\pi}\ln\pars{\sin\pars{x}}\,\dd x} _{\ds{=}\ \dsc{-\pi\ln\pars{2}}} -\int_{0}^{1}\ln\pars{\Gamma\pars{x}}\,\dd x \\[5mm]&=\ln\pars{2\pi} - 2 - \int_{0}^{1}\ln\pars{\Gamma\pars{x + 1}}\,\dd x \end{align}
The integral $\ds{\int_{0}^{\pi}\ln\pars{\sin\pars{x}}\,\dd x=-\pi\ln\pars{2}}$ appears frequently in M.SE .
Finally, $$ \color{#66f}{\large% \int_{1}^{\infty}{\braces{x} - 1/2 \over x}\,\dd x} =\color{#66f}{\large\half\,\ln\pars{2\pi} - 1} $$