29
$\begingroup$

$$\displaystyle\int_1^{\infty}\frac{\{x\}-\frac{1}{2}}{x}\ \mathrm dx$$

where $\{x\}$ denotes the fractional part of x (for example- $\{3.141\}=0.141)$

I'm looking for alternative methods (maybe also ones which are shorter) to what I already know (method I have used below), to Evaluate this.


The only method I know:

$$\ln(n!)=\sum_{k=2}^{n} \ln k$$

$$\ln(n!)=\sum_{k=2}^{n} \color{brown}{\int_1^k \frac{dx}{x}}$$

Since: $$\color{brown}{\int_1^k \frac{dx}{x}}=\sum_{j=1}^{k-1} \int_j^{j+1} \frac{dx}{x}$$

$$\ln(n!)=\sum_{k=2}^{n} {\Bigg\{\sum_{j=1}^{k-1} \int_j^{j+1} \frac{dx}{x}}\Bigg\}$$

$$\ln(n!)=(n-1)\int_1^2 \frac{dx}{x}+(n-2)\int_2^3 \frac{dx}{x}+\cdots+\int_{n-1}^n \frac{dx}{x}$$

$$ln(n!)=\int_1^2 \frac{(n-1) dx}{x}+\int_2^3 \frac{(n-2)dx}{x}+\cdots+\int_{n-1}^n \frac{dx}{x}$$

The general form of the terms in the last summation is, with $1\leq j\leq n-1$

$$\int_j^{j+1} \frac{(n-j)}{x}dx=\int_j^{j+1} \frac{(n-[x])}{x} dx$$

where the notation $[x]$ means the integer part of $x$

because, for the integration interval $j\leq x <j+1$

$$\ln(n!)=\int_1^n \frac{n-[x]}{x} dx$$


Now :

$$x=[x]+\{x\}\implies[x]=x-\{x\}$$

$$\Large{\color{orange}{\ln(n!)}} = \int_1^n \frac{n-x+\{x\}}{x}dx=n\ln(n)-n+1+\int_1^n \frac{\{x\}}{x}dx$$

$$=n\ln(n)-n+1+\frac{1}{2}\ln(n)+\int_1^n \frac{\{x\}-\frac{1}{2}}{x}dx$$ $$\left(n+\frac{1}{2}\right)\ln(n)-n+1+\int_1^n \frac{\{x\}-\frac{1}{2}}{x} dx$$

$$=\ln\left(n^{n+\frac{1}{2}}\right)+\ln(e^{-n})+1+\int_1^n \frac{\{x\}-\frac{1}{2}}{x} dx$$

$$=\ln\left(e^{-n}n^{n+\frac{1}{2}}\right)+\ln\left(e^{1+\int_1^n \frac{\{x\}-\frac{1}{2}}{x}dx}\right)$$

$$=\color{crimson}{\Large{\ln\left(e^{-n}n^{n+\frac{1}{2}}e^{1+\int_1^n \frac{\{x\}-\frac{1}{2}}{x}dx}\right)}}$$


$$\Large{\color{orange}{n!}=\color{Crimson}{e^{-n}n^{n+\frac{1}{2}}e^{1+\int_1^n \frac{\{x\}-\frac{1}{2}}{x}dx}}}$$

$$\Large{e^{1+\int_1^n \frac{\{x\}-\frac{1}{2}}{x}dx}=\frac{n!}{e^{-n}n^{n+\frac{1}{2}}}}$$

If we let $n\to \infty$ And using Stirling's formula, we have:

$$\Large{e^{1+\int_1^{\infty} \frac{\{x\}-\frac{1}{2}}{x}dx}}=\sqrt{2\pi}$$

Thus, $$1+\int_1^{\infty} \frac{\{x\}-\frac{1}{2}}{x}dx=\ln(\sqrt{2\pi})$$

$$\bbox[8pt,border:2px #0099FF solid]{\int_1^{\infty}\frac{\{x\}-\frac{1}{2}}{x} dx=-1+\ln(\sqrt{2\pi})}$$

$\endgroup$
8
  • $\begingroup$ A similar question. $\endgroup$
    – Lucian
    Dec 6, 2014 at 10:08
  • 7
    $\begingroup$ You might be interested in proving the following integral : $$\int_1^{\infty}\left(\frac{\{x\}-\frac{1}{2}}{x}\right)^2\ \mathrm dx=\bbox[8pt,border:3px #FF69B4 solid]{\color{red}{\large\ln\left(\,2 \pi\,\right)-\frac{7}{4}}}\tag{$\color{red}{❤}$}$$ $\endgroup$
    – Venus
    Dec 6, 2014 at 17:55
  • $\begingroup$ @Venus Omg Thank you :D Yes this will be my next exercise :) After I sucessfully complete the current integral Im attempting which is evaluating $$\Large{\int_0^{\frac{\pi}{4}} \frac{\sin x}{1+x^2} dx}$$ (maybe you will find this interesting too :) If you haven't tried it already). Thanks again $\endgroup$
    – The Artist
    Dec 6, 2014 at 18:18
  • $\begingroup$ @TheArtist Your integral is the solution of the following ODE at $a=1$ $$I''(a)-I(a)=\frac{2}{a}\sin^2\left(\frac{a\pi}{8}\right)$$ with boundary conditions $I(0)=0$ and $I'(0)=\frac{1}{2} \ln \left(1+\frac{\pi ^2}{16}\right)$. $\endgroup$
    – Venus
    Dec 6, 2014 at 18:31
  • $\begingroup$ @Venus Thanks :) I'm trying to solve it without Differential Equations, and another user already did that yesterday. Trying to do it that way. $\endgroup$
    – The Artist
    Dec 7, 2014 at 3:07

3 Answers 3

25
$\begingroup$

\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)$$

$\endgroup$
2
  • 1
    $\begingroup$ Click $\qquad(\spadesuit)$ $\endgroup$
    – Venus
    Dec 6, 2014 at 9:12
  • 1
    $\begingroup$ This is wow typesetting ! :-) .. although the proof by Hypergeometric and The Artists proof in the OP are essentially similar :) $\endgroup$
    – r9m
    Dec 6, 2014 at 9:19
15
$\begingroup$

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)$

$\endgroup$
2
  • 1
    $\begingroup$ These may all be similar, but perhaps one presentation will be clearer to some than to others. $\endgroup$
    – robjohn
    Dec 6, 2014 at 10:16
  • $\begingroup$ (+1) Thank you very much Rob John....Your presentations are always beautiful :) $\endgroup$
    – The Artist
    Dec 6, 2014 at 10:19
9
$\begingroup$

$\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} $$

$\endgroup$
5
  • $\begingroup$ Holy cow :D (+1) Thank you so much :) $\endgroup$
    – The Artist
    Dec 7, 2014 at 2:32
  • $\begingroup$ @TheArtist Thanks. It's nice it was useful for you. $\endgroup$ Dec 7, 2014 at 2:33
  • 1
    $\begingroup$ This is indeed very nice Felix. Without involving Stirling's. (+1) @r9m $\endgroup$
    – Venus
    Dec 7, 2014 at 2:57
  • $\begingroup$ @FelixMarin Yes it is :) $\endgroup$
    – The Artist
    Dec 7, 2014 at 3:03
  • $\begingroup$ why the Psi(x+n+2)becomes the ln(x+n+2)? $\endgroup$
    – WSSF
    Apr 27, 2021 at 15:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .