Evaluating a limit to get an integral for Euler's Constant

40 Views Asked by At

I have been reading a book on Number Theory and just came across an equation that I can't seem to see how to get the result, in the book is states that:

$$\lim_{x \to \infty}\left ( \sum_{n\leq x} \frac{1}{n} -\log x\right ) = 1-\int_{1}^{\infty} \frac{t - \left \lfloor t \right \rfloor}{t^2} dt $$

All I have so far is

$$\lim_{x\rightarrow \infty}\left ( \sum_{x\leq n}\frac{1}{n} \right ) -\lim_{x\rightarrow \infty} \left ( \log x \right )\\ =1 -\lim_{x\rightarrow \infty}(\log x)$$

But I'm not sure this even this is correct?

I am aware that this is Euler's constant however I am just rather puzzled about how the right hand side is obtained. Any help is greatly appreciated.