# Computing the integral $\int \limits_{1}^{\infty}\left(\frac{1}{\lfloor{x}\rfloor}-\frac{1}{x}\right)$ …

Prove that $$\large\int \limits_{1}^{\infty}\Bigg(\dfrac{1}{\lfloor{x}\rfloor}-\dfrac{1}{x}\Bigg)dx=\lim \limits_{n \to \infty} \Bigg(-\ln(n) + \sum \limits_{k=1}^n\dfrac{1}{k}\Bigg)$$

I was reading an article on Euler–Mascheroni constant$\Big(\gamma\approx0.577215664901532\Big)$, when I read that it is defined as the limiting difference between the harmonic series and the natural logarithm :

$$\gamma=\lim \limits_{n \to \infty} \Bigg(-\ln(n) + \sum \limits_{k=1}^n\dfrac{1}{k}\Bigg)$$

That is completely fine, but in the next "step" this limit is equated to a definite integral of reciprocal of $x$ subtracted from the reciprocal of floor of $x$.

It can not really understand this transition from limit to a definite integral. Also, I could not find even a single proof of this equivalence anywhere. A geometrical explanation (or even an algebraic one) will surely help me understand this.

• Riemann sums seem to be the most direct way – Yuriy S Feb 25 '17 at 7:29
• Well the integral from 1 to n of 1/x is ln(n) and the integral from 1 to n of 1/floor(x) is the n^th harmonic number. So the equality should hold. – Lee Fisher Feb 25 '17 at 7:31

This is an improper integral, so just write it as

$$\lim_{n\to\infty}\int_1^n{1\over \lfloor x\rfloor}-{1\over x}\,dx = \lim_{n\to\infty}\left(\sum_{k=1}^n k^{-1}-\log n\right)$$

The first term by noting that $$[x]^{-1} = k^{-1}$$ on $$[k, k+1)$$ and the second by one of the (many) definitions for $$\log x$$.

• Oh!!! So Simple!!! I was thinking that limits must be involved as it an improper integral but it just did not come to my mind that I can integrate term-wise. So Silly of me !!! Anyways, thanks a lot for answering my question. :-) – user399078 Feb 25 '17 at 7:51

$\int_1^\infty \dfrac {-1}xdx$ = $\lim_{n\to \infty}$$-ln(n)$

Further, between any two integers $n$ and $n+1$, $\lfloor x\rfloor$ equals $n$.

For $k\in N$

Therefore, $\int_1^\infty \dfrac 1{\lfloor x\rfloor}$ = $\sum_{k=1}^\infty \int_k^{k+1} \dfrac 1kdx$ = $\sum_1^\infty \dfrac 1k$ **

Adding the two, we get the required result.

**Over here, I used the result that $\int_k^{k+1} \dfrac 1kdx$ = $\dfrac {(k+1)-k}k$ = $\dfrac 1k$

• I not downvote you but observe that $\int_1^\infty\frac1x\mathrm dx\neq\ln x$ – Masacroso Feb 25 '17 at 8:54