# Prove that $\int_0^1{\left\lfloor{1\over x}\right\rfloor}^{-1}\!dx={1\over2^2}+{1\over3^2}+{1\over4^2}+\cdots.$

Question. Let $$f(x)=\!\left\{\,\,\, \begin{array}{ccc} \displaystyle{\left\lfloor{1\over x}\right\rfloor}^{-1}_{\hphantom{|_|}}&\text{if} & 0\lt x\le 1, \\ & \\ 0^{\hphantom{|^|}} &\text{if} & x=0. \end{array}\right.$$ Is f(x) Riemann integrable on $[0,1]$? If it is Riemann integrable, then what is the value of the integral $\,\int_0^1{\left\lfloor{1\over x}\right\rfloor}^{-1}dx$?

An attempt: Since $f$ is increasing, non-negative and bounded the integral does exist. Choosing the partition $P=\big\{0,\frac{1}{n},\frac{1}{n-1},...,1\big\}$, we have the following upper and lower sums $$U(f,P)=\sum_{i=1}^{n-1}{1\over n-i}\left [ {1\over n-i}-{1\over n-i+1}\right] - {1\over n^2},\\L(f,P)=\sum_{i=1}^{n-1}{1\over n-i+1}\left[{1\over n-i} - {1\over n-i+1} \right].$$ Simplifying we obtain
$$U(f,P)= \sum_{i=1}^n{1\over i^2}+ {1\over n} -1, \quad L(f,P)= 2-{1\over n}-\sum_{i=1}^n{1\over n^2}.$$ As $n\to\infty$, $U(f,P)\to{\pi^2\over 6}-1$ and $L(f,P)\to2-{\pi^2\over 6}$. Therefore $2-{\pi^2\over 6}\le\int_0^1f(x)\,dx\le{\pi^2\over 6}-1$. Direct calculation using MATLAB shows $\int_0^1f(x)\,dx={\pi^2\over 6}-1$.

• The reason why your partition gives a upper sum converging to the right value is quite obvious by the shape of the function, i.e, $f$ has a shape of a staircase function, and the place where stairs collapse is discrete. In other word, because this function has supreme in each interval(almost everywhere), the integral should be the limit of upper sum. If you want to follow the definition of Riemann integral, just take the modification to each inteval like - $\left\{ 0,\frac{1}{n},\frac{1}{n}+\frac{1}{n^{100}}, \frac{1}{n-1}, \cdots\right\}$ Dec 27, 2013 at 8:29
• Your lower sums are "stuck" under a certain bound (actually, the bound is $2-\pi^2/ 6$) because that partition doesn't "add the area" that is missed in the interval $[1/2, 1], [1/3,1/2]$ etc. as $n\to \infty$. Dec 27, 2013 at 8:30

We observe that: if $x\in\big(\frac{1}{k+1},\frac{1}{k}\big]$, then $\frac{1}{x}\in[k,k+1)$, thus $\left\lfloor{1\over x}\right\rfloor=k$ and hence $$\left\lfloor{1\over x}\right\rfloor^{-1}=\frac{1}{k}, \quad \text{whenever}\,\, x\in\Big(\frac{1}{k+1},\frac{1}{k}\Big].$$ Therefore $$\int_{1/n}^1{\left\lfloor{1\over x}\right\rfloor}^{-1}dx=\sum_{k=1}^{n-1} \int_{1/(k+1)}^{1/k}{\left\lfloor{1\over x}\right\rfloor}^{-1}dx=\sum_{k=1}^{n-1} \int_{1/(k+1)}^{1/k}\frac{1}{k}dx=\sum_{k=1}^{n-1}\frac{1}{k}\cdot\frac{1}{k(k+1)},$$ and thus $$\int_0^1 {\left\lfloor{1\over x}\right\rfloor}^{-1}dx=\lim_{n\to\infty} \int_{1/n}^1{\left\lfloor{1\over x}\right\rfloor}^{-1}dx= \sum_{n=1}^\infty \frac{1}{n^2(n+1)}.$$ Meanwhile $$\sum_{n=1}^\infty \frac{1}{n(n+1)}=\sum_{n=1}^\infty\left(\frac{1}{n}-\frac{1}{n+1}\right)=1 \quad\text{and}\quad \frac{1}{n^2}-\frac{1}{n(n+1)}=\frac{1}{n^2(n+1)}.$$ Hence, finally \begin{align} \frac{1}{2^2}+\frac{1}{3^2}+\cdots+\frac{1}{n^2}+\cdots&=\sum_{n=1}^{\infty}\frac{1}{n^2}-1 =\sum_{n=1}^{\infty}\frac{1}{n^2}-\sum_{n=1}^\infty \frac{1}{n(n+1)}\\&=\sum_{n=1}^\infty \frac{1}{n^2(n+1)}=\int_0^1 {\left\lfloor{1\over x}\right\rfloor}^{-1}dx. \end{align}
$\ds{\Psi\pars{z}}$ is the Digamma Function and we used the properties \begin{align} &\sum_{k = 0}^{\infty}{1 \over \pars{k + \mu}\pars{k + \nu}} = {\Psi\pars{\mu} - \Psi\pars{\nu} \over \mu - \nu}\,,\qquad \begin{array}{|rcl} \ \Psi\pars{z + 1} & = & \Psi\pars{z} + {1 \over z} \\ \Psi'\pars{1} & = & {\pi^{2} \over 6} \end{array} \end{align}