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.
Thanks in Advance ! :-)
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$.