# Prove that $\int_{0}^{1}\mathrm{f}\left(x\right)\mathrm{d}x = 1 - \gamma$

$\mbox{I know that}\quad \gamma = \lim_{n\to\infty}\left[\sum_{k = 1}^{n}\frac{1}{k} - \log\left(n\right)\right] \quad\mbox{and}\quad\gamma \in \left[0,1\right]$.

Let $\mathrm{f}:\left[0,1\right] \to \mathbb{R}\,,\quad x \mapsto \begin{equation} \mathrm{f}\left(x\right) = \left\{\begin{array}{lr} {\displaystyle\frac{1}{x} - \left\lfloor\frac{1}{x}\right\rfloor\,,} & x>0} \\[2mm] 0\,,} & x = 0} \end{array}\right. \end{equation$

How can i show that $\displaystyle\int_{0}^{1}\mathrm{f}\left(x\right)\mathrm{d}x = 1 - \gamma$.

So some of mine ideas: I work with Riemann-integral,so until now i have proved that the function f is Riemann-integrable. For all $n \in \mathbb{N}$ is $f$on $[\frac{1}{n},1]$ piecewise monotonous and limited, here Riemann integrable. Let $\epsilon > 0$ and choose a $n \in \mathbb{N}$ with $\frac{1}{n} < \frac{\epsilon}{2}$ and some step functions $o_n',u_n'$ on $[\frac{1}{n},1]$ with $u_n'\le f\mid_{[\frac{1}{n},1]} \le o_n'$ and $\int_{\frac{1}{n}}^{1} (o_n'-u_n')dx$ so i know some characterizations of the riemann integrability hence this integral exist. Now let $o_n'$ continue through the value 1 and $u_n'$ 0 on whole $[0,1]$ and i will name the function then $u_n, o_n$. So $u_n, o_n$ are step functions on $[0,1]$ with $u_n \le f \le o_n$ and $\int_{0}^{1}(o_n-u_n )dx$ = $\int_{0}^{1/n}(o_n-u_n )dx$+$\int_{1/n}^{1}(o_n-u_n )dx$ = $\int_{0}^{1/n}1dx$+$\int_{1/n}^{1}(o_n'-u_n' )dx < \frac{1}{n} + \frac{\epsilon}{2} < \epsilon$. So f is Riemann Integrable. But i can't see how i can use this knowledge...

• No, you want us to show it. Or did you really try anything?
– user436658
Dec 19, 2017 at 17:17
• What is $\int_{1/(k+1)}^{1/k}f(x)\,dx$? Dec 19, 2017 at 17:18
• What @ProfessorVector is trying to say it that you're expected to show your work when you're asking a question. Provide some context, and people can push you in the right direction, but just giving you the solution won't teach you anything. Dec 19, 2017 at 17:25
• @ProfessorVector I have add some ideas but i don't , if this is the right way ? Dec 19, 2017 at 18:03
• Use Lord Shark's hint. Compute $\int_{1/(k+1)}^{1/k} f(x)\,dx$, and sum the results to determine $\int_{1/n}^1 f(x)\,dx$ for $n \geqslant 2$. Then take the limit. Dec 19, 2017 at 18:42

$$\sum_{k=1}^{n}\frac{1}{k} = \int_{1}^{n+1}\frac{dx}{\lfloor x\rfloor},\quad \log(n+1)=\int_{1}^{n+1}\frac{dx}{x},\tag{A}$$ $$H_n-\log(n+1) = \int_{1}^{n+1}\frac{x-\lfloor x\rfloor}{x\lfloor x\rfloor}\,dx=\int_{1}^{n+1}\frac{\{x\}}{x\lfloor x\rfloor}\,dx\tag{B}$$ $$\gamma=\int_{1}^{+\infty}\frac{\{x\}}{x\lfloor x\rfloor}\,dx \tag{C}$$ $$\forall N\geq 2,\quad\begin{eqnarray*} \int_{1/N}^{1}\frac{1}{x}-\left\lfloor\frac{1}{x}\right\rfloor \,dx&=&\sum_{n=2}^N\int_{1/n}^{1/(n-1)}\frac{1}{x}-(n-1)\,dx\\&=&\sum_{n=2}^{N}\log\left(1+\frac{1}{n-1}\right)-\frac{1}{n}\end{eqnarray*}\tag{D}$$ and $$\lim_{N\to +\infty}\int_{1/N}^{1}\frac{1}{x}-\left\lfloor\frac{1}{x}\right\rfloor\,dx = 1-\gamma$$ follows by comparing $(D)$ with $\gamma = \sum_{n\geq 1}\frac{1}{n}-\log\left(1+\frac{1}{n}\right)$.

• Thank you, but what do you mean by $H_n$ in (B) and i don't know that the notation {x} means. Dec 19, 2017 at 19:18
• $H_n$ is the $n$-th harmonic number, namely $\frac{1}{1}+\frac{1}{2}+\ldots+\frac{1}{n}$, and $\{x\}$ stands for the fractional part of $x$, i.e. $x-\lfloor x\rfloor$. Dec 19, 2017 at 19:24
• Very interesting. I didn't spend time looking for a "classical (?) proof" as yours, because I was satisfied by my own one, of "Aha" type as Martin Gardner coined the term... Dec 20, 2017 at 0:27

$\newcommand{\bbx}{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}{\displaystyle{#1}} \newcommand{\expo}{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}{\mathcal{#1}} \newcommand{\mrm}{\mathrm{#1}} \newcommand{\pars}{\left(\,{#1}\,\right)} \newcommand{\partiald}[]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}{\left\vert\,{#1}\,\right\vert}$ \begin{align} &\int_{0}^{1}\pars{{1 \over x} - \left\lfloor\,{1 \over x}\,\right\rfloor} \,\dd x\,\,\,\stackrel{x\ \mapsto\ 1/x}{=}\,\,\, \int_{1}^{\infty}{x - \left\lfloor\,x\,\right\rfloor \over x^{2}}\,\dd x = \sum_{n = 1}^{\infty}\int_{n}^{n + 1}{x - n \over x^{2}}\,\dd x \\[5mm] = &\ \sum_{n = 1}^{\infty}\bracks{-\,{1 \over 1 + n} - \ln\pars{n} + \ln\pars{n + 1}}\ =\ \overbrace{\sum_{n = 1}^{\infty}\pars{{1 \over n} - {1 \over n + 1}}} ^{\ds{Telescopic\ Sum\ =\ 1}}\ -\sum_{n = 1}^{\infty}\bracks{{1 \over n} - \ln\pars{n + 1 \over n}} \\[5mm] = &\ 1 - \lim_{N \to \infty}\braces{\sum_{n = 1}^{N}{1 \over n} - \bracks{\ln\pars{2 \over 1} + \ln\pars{3 \over 2} + \cdots + \ln\pars{N + 1 \over N}}} \\[5mm] = &\ 1\ -\ \overbrace{\lim_{N \to \infty}\bracks{\sum_{n = 1}^{N}{1 \over n} - \ln\pars{N}}}^{\ds{\gamma}}\ +\ \overbrace{\lim_{N \to \infty}\ln\pars{N +1 \over N}}^{\ds{=\ 0}} = \bbx{1 - \gamma} \end{align}

• Interesting proof. Dec 20, 2017 at 0:29
• @JeanMarie Thanks. I like it because it seems the most "natural" one. Dec 20, 2017 at 18:01

Here is an - almost - immediate graphical proof.

The (necessarily truncated) graphical representation of function $f$ with equation $f(x)=\frac{1}{x} - \left\lfloor\frac{1}{x}\right\rfloor$ is as follows: Now, switch to the figure in the answer I made here : (https://math.stackexchange.com/q/1689697) : exchanging axes, the two figures are identical ; the blue area corresponds to the area under the curve of $f$, i.e., the integral of $f$ over $(0,1)$.