The question and its answer is given in the following pictures:
The first line in the solution is not clear for me, my questions are:
1- where is the interval from 0 to 1 ?
2- why we changed the x inside the floor function to n and did not change the x in the power of e ?
Could anyone illustrate this for me please?



The solution is too complicated according to me.
A way to simplify,
$\begin{align} J&=\sum_{n=1}^{\infty} \int_n^{n+1} ne^{-x}\\ &=\sum_{n=1}^{\infty} \Big[-ne^{-x}\Big]_n^{n+1}\\ &=\sum_{n=1}^{\infty}n\left(e^{-n}-e^{-(n+1)}\right)\\ &=\sum_{n=1}^{\infty}ne^{-n}-\sum_{n=1}^{\infty}ne^{-(n+1)}\\ &=\sum_{n=1}^{\infty}ne^{-n}-\sum_{n=1}^{\infty}(n+1)e^{-(n+1)}+\sum_{n=1}^{\infty}e^{-(n+1)}\\ &=\sum_{n=1}^{\infty}ne^{-n}-\sum_{n=2}^{\infty}ne^{-n}+\sum_{n=1}^{\infty}e^{-(n+1)}\\ &=e^{-1}+\sum_{n=1}^{\infty}e^{-(n+1)}\\ &=\sum_{n=0}^{\infty}e^{-(n+1)}\\ &=\frac{1}{\text{e}}\sum_{n=0}^{\infty}\left(e^{-1}\right)^n\\ &=\dfrac{1}{\text{e}}\frac{1}{1-\dfrac{1}{\text{e}}}\\ &=\frac{1}{\text{e}-1} \end{align}$