TITLE: How to solve an definite integral of floor valute function?
QUESTION [16 upvotes]: How do you prove this identity:
$$\int_0^{n^2}\lfloor\sqrt{t}\rfloor dt = \frac{1}{6}n(n-1)(4n+1)$$
I'd very much appreciate your help on this one!

REPLY [14 votes]: Related problems: (I), (II). Using the change of variables $ u=\sqrt{t} $ makes the problem to fall apart
$$ \int_0^{n^2}\lfloor\sqrt{t}\rfloor dt = 2\int_0^{n}\lfloor u \rfloor u du = 2\sum_{k=0}^{n-1}k\int_{k}^{k+1} u \, du = \sum_{k=0}^{n-1} k\,( (k+1)^2 - k^2 ) $$
$$ = \frac{1}{6}n(n-1)(4n+1). $$
Note 1: To evaluate the sum, you may need to look here.
Clarification: Answering your comment. In the above calculations, since $ \lfloor u \rfloor = k,\quad k\leq u < k+1 $, then
$$ \int_0^{n} \lfloor u \rfloor u du =  \int_0^{1} (0) u du+ \int_1^{2} (1) u du +  \int_2^{3} (2) u du + \dots +  \int_{n-1}^{n} (n-1) u du $$
$$ =  \sum_{k=0}^{n-1}\int_{k}^{k+1} (k)\, u \, du. $$