So I am reading this paper https://arxiv.org/pdf/math/0008177.pdf by Jeffrey Lagarias and in the proof of Lemma 3.1 he says \begin{equation} \int_{1}^{n} \frac{\lfloor t \rfloor}{t^2}dt = \sum_{1 \le r \le n} \int_{r}^{n} \frac{1}{t^2} dt. \end{equation} In the paper he uses $\infty$ as the upper integration bound, but I think it should be n, and r as the lower end, in order for the next steps in the paper to make sense. The left side is equal to $\int_{1}^{n} \sum_{1 \le r \le t} \frac{1}{t^2} dt$, but I cannot see how \begin{equation} \int_{1}^{n} \sum_{1 \le r \le t} \frac{1}{t^2} dt = \sum_{1 \le r \le n} \int_{r}^{n} \frac{1}{t^2} dt \end{equation} would hold. Yes it is a finite sum, but we are integrating over t, so we shouldn't be able to just move it out of the sum, right?
Then I thought it might help that $\lfloor t \rfloor$ is a step function, but we multiply it with $\frac{1}{t^2}$, so I can't see how I can use that either. I tried using integration by parts but I got a completely different result than whats in the paper. WolframAlpha tells me it exceeds computation time. What am I missing here?
I apologise if this is a stupid question, it's been a long time since my Analysis courses!