# Proving an integral equivalence involving floor and ceiling functions

During the course of looking at the Euler–Mascheroni constant I have run across the following result:

$$\gamma = \int \limits_1^\infty \Bigg( \frac{1}{\lfloor x \rfloor} - \frac{1}{x} \Bigg) \ dx = \int \limits_1^\infty \Bigg( \frac{\lceil x \rceil}{x^2} - \frac{1}{x} \Bigg) \ dx.$$

Representation of this constant using the first integral is a well-known result. What is the simplest way to prove the equivalence of the two integrals?

• Perhaps you have tried to take a convergent integral of the form $\int_1^{\infty} (f-g)=0$ and tried to deduce $\int_1^{\infty} f=\int_1^{\infty} g$. Aug 13, 2021 at 4:35
• @ParamanandSingh: Sorry, my bad --- I was trying (mistakenly) to simplify the problem --- I have edited to fix.
– Ben
Aug 13, 2021 at 5:04
• A simple strategy would be to split the integrals over intervals $[1,2],[2,3],\dots$ and try to evaluate the integrals as infinite series. Aug 13, 2021 at 5:07

This is actually easier than it seems, since for any positive integer $$k$$, \begin{align*} \int_k^{k+1} \bigg( \frac{\lceil x \rceil}{x^2} - \frac{1}{x} \bigg) \, dx &= \int_k^{k+1} \bigg( \frac{k+1}{x^2} - \frac{1}{x} \bigg) \, dx = \frac1k - \log\bigg( 1+\frac1k \bigg) \\ \int_k^{k+1} \bigg( \frac{1}{\lfloor x \rfloor} - \frac{1}{x} \bigg) \, dx &= \int_k^{k+1} \bigg( \frac{1}{k} - \frac{1}{x} \bigg) \, dx = \frac1k - \log\bigg( 1+\frac1k \bigg). \end{align*} Then one can sum both sides over all positive integers $$k$$ (yielding the Euler–Mascheroni constant as it turns out).
\begin{align} \int \limits_1^\infty \Bigg( \frac{\lceil x \rceil}{x^2} - \frac{1}{\lfloor x \rfloor} \Bigg) \ dx &= \sum_{n=1}^\infty \int \limits_n^{n+1} \Bigg( \frac{\lceil x \rceil}{x^2} - \frac{1}{\lfloor x \rfloor} \Bigg) \ dx \\[6pt] &= \sum_{n=1}^\infty \int \limits_n^{n+1} \Bigg( \frac{n+1}{x^2} - \frac{1}{n} \Bigg) \ dx ​\\[6pt] &= \sum_{n=1}^\infty \Bigg[ - \frac{n+1}{x} - \frac{x}{n} \Bigg]_{x=n}^{x=n+1} ​\\[6pt] &= \sum_{n=1}^\infty \Bigg[ \Bigg( - \frac{n+1}{n+1} - \frac{n+1}{n} \Bigg) - \Bigg( - \frac{n+1}{n} - \frac{n}{n} \Bigg) \Bigg] ​\\[6pt] &= \sum_{n=1}^\infty \Bigg[ \Bigg( - 2 - \frac{1}{n} \Bigg) - \Bigg( - 2 - \frac{1}{n} \Bigg) \Bigg] ​\\[6pt] &= \sum_{n=1}^\infty 0 = 0. ​\\[6pt] \end{align}