Calculate $\int_0^1 \left\lfloor \frac{2020}{x} \right\rfloor – 2020\left\lfloor\frac1x\right\rfloor\,dx$

analysiscalculusharmonic-numbersreal-analysis

Calculate the definite integral $$\int_0^1 \left\lfloor \frac{2020}{x} \right\rfloor – 2020\left\lfloor\frac1x\right\rfloor\,dx$$

My Attempt:

Let's make a start. Write $[2020/x]=n\ge 2020$ then ${{2020}\over {n+1}}\le 1/x < {{2020}\over n}$ and ${n\over {2020}}\le 1/x <{{n+1}\over {2020}}$. Hence $[1/x]=[n/2020]$. For the integral we find

$$\sum_{n=2020}^\infty \int_{2020/(n+1)}^{2020/n} (n-2020[n/2020]) dx=2020\sum_{2020}^\infty {1\over {n(n+1)}} (n-2020[n/2020]) $$
In order to get $[n/2020] = m$ we need $m \leq n/2020 < m+1$ or $2020m \leq n \leq 2020m + 2019$. Now write:
$$2020\sum_{n=2020}^\infty \frac{1}{n(n+1)} (n-2020\lfloor n/2020\rfloor) = 2020\sum_{m=1}^\infty \sum_{n=2020m}^{2020m+2019} \frac{1}{n(n+1)} (n-2020m)$$$$ = 2020\sum_{m=1}^\infty \left[\left(\sum_{n=2020m}^{2020m+2019} \frac{1}{n+1}\right) – 2020m\left(\frac{1}{2020m} – \frac{1}{2020(m+1)}\right)\right]$$$$ = 2020\sum_{m=1}^\infty \left[\left(\sum_{n=2020m}^{2020m+2019} \frac{1}{n+1}\right) – \frac{1}{m+1}\right]$$Now an analysis of partial sums…
$$\sum_{m=1}^N \left[\left(\sum_{n=2020m}^{2020m+2019} \frac{1}{n+1}\right) – \frac{1}{m+1}\right] = \sum_{k=2021}^{2020N+2020} \frac{1}{k} – \sum_{k=2}^{N+1} \frac1k$$$$ = H_{2020N+2020} – H_{N+1} – H_{2020} + 1 \to \log(2020) – H_{2020} + 1$$So the answer is $\boxed{2020\left(\log(2020) – H_{2020} + 1\right)}$.
However, I still wonder whether my answer is correct.
Please help on this problem, thank you.

Best Answer

Let $ n\in\mathbb{N}^{*} $.

\begin{aligned}\int_{0}^{1}{\left(\left\lfloor\frac{n}{x}\right\rfloor -n\left\lfloor\frac{1}{x}\right\rfloor\right)\mathrm{d}x}&=\int_{1}^{+\infty}{\frac{\left\lfloor nx\right\rfloor - n\left\lfloor x\right\rfloor}{x^{2}}\,\mathrm{d}x}\\ &=\sum_{p=1}^{+\infty}{\int_{p}^{p+1}{\frac{\left\lfloor nx\right\rfloor - n\left\lfloor x\right\rfloor}{x^{2}}\,\mathrm{d}x}}\\ &=\sum_{p=1}^{+\infty}{\int_{p}^{p+1}{\frac{\left\lfloor nx\right\rfloor - np}{x^{2}}\,\mathrm{d}x}}\\ &=\sum_{p=1}^{+\infty}{\sum_{\ell = np}^{n\left(p+1\right)-1}{\int_{\frac{\ell}{n}}^{\frac{\ell+1}{n}}{\frac{\left\lfloor nx\right\rfloor - np}{x^{2}}\,\mathrm{d}x}}}\\ &=\sum_{p=1}^{+\infty}{\sum_{\ell = np}^{n\left(p+1\right)-1}{\int_{\frac{\ell}{n}}^{\frac{\ell+1}{n}}{\frac{\ell - np}{x^{2}}\,\mathrm{d}x}}}\\ &=n\sum_{p=1}^{+\infty}{\sum_{\ell = np}^{n\left(p+1\right)-1}{\frac{\ell - np}{\ell\left(\ell +1\right)}}}\\ &=n\sum_{p=1}^{+\infty}{\left(H_{n\left(p+1\right)}-H_{np}-np\left(\frac{1}{np}-\frac{1}{n\left(p+1\right)}\right)\right)}\\ &=n\sum_{p=1}^{+\infty}{\left(H_{n\left(p+1\right)}-H_{np}-\frac{1}{p+1}\right)}\\ &=\lim_{k\to +\infty}{n\left(H_{nk}-H_{n}-H_{k}+1\right)}\\ \int_{0}^{1}{\left(\left\lfloor\frac{n}{x}\right\rfloor -n\left\lfloor\frac{1}{x}\right\rfloor\right)\mathrm{d}x}&=n\left(\ln{n}-H_{n}+1\right)\end{aligned}

So what you did is correct.