# Euler-Mascheroni constant

I proved that $$\int_{1}^\infty \left(\frac{1}{\lfloor x\rfloor}-\frac{1}{x}\right)\mathrm dx=\gamma.$$

I now have to deduce that $$1-\int_1^\infty \frac{x-\lfloor x\rfloor}{x^2}\mathrm dx=\gamma.$$

So what I want to prove is that $$\int_1^\infty \frac{x-\lfloor x\rfloor}{x^2}\mathrm dx=1-\gamma=1-\int_1^\infty \left(\frac{1}{\lfloor x\rfloor}-\frac{1}{x}\right)\mathrm dx=1-\int_1^\infty \frac{x-\lfloor x\rfloor}{x\lfloor x\rfloor}\mathrm dx.$$

To do this, I use the fact that $$1=\int_1^\infty \frac{1}{x^2}\mathrm dx$$ and thus, I get that $$1-\int_1^\infty \frac{x-\lfloor x\rfloor}{x\lfloor x\rfloor}\mathrm dx=\int_1^\infty \left(\frac{1}{x^2}+\frac{\lfloor x\rfloor-x}{x\lfloor x\rfloor}\right)\mathrm dx.$$

But I don't see how to deduce that $$\int_1^\infty \left(\frac{1}{x^2}+\frac{\lfloor x\rfloor-x}{x\lfloor x\rfloor}\right)\mathrm dx=\int_1^\infty \frac{x-\lfloor x\rfloor}{x^2}\mathrm dx.$$

I tried many manipulation, but it wasn't conclusif.

The $1/x$ terms cancel, so what you want to prove is
$$\int_1^\infty\left(\frac1{\lfloor x\rfloor}-\frac{\lfloor x\rfloor}{x^2}\right)\mathrm dx=1\;.$$
$$\left[\frac{\lfloor x\rfloor}x\right]_{1\uparrow}^\infty+\int_{1\uparrow}^\infty\left(\frac1{\lfloor x\rfloor}-\frac{\lfloor x\rfloor'}x\right)\mathrm dx=1\;.$$
The first term is $1$, and in the integral both terms run through the positive integers, so they cancel.