# Integral $\int_{0}^{n^{2}} \lfloor \sqrt{t} \rfloor \rm dt$

To find the integral $$\int_{0}^{n^{2}} \lfloor \sqrt{t} \rfloor \rm dt$$ if $$n \geq 1$$ is an integer and $$\lfloor \cdot \rfloor$$ is the floor function, I began with the observation that $$\int_{0}^{n^{2}} \lfloor \sqrt{t} \rfloor \rm dt = (2^{2}-1^{2})\cdot 1 + \cdots + \big[ n^{2} - (n-1)^{2} \big]\cdot (n-1).$$ However it seems that this observation may not be sufficiently useful?

$$\int_{0}^{n^2}\lfloor \sqrt{t}\rfloor dt=\sum_{k=1}^n\int_{(k-1)^2}^{k^2}\lfloor \sqrt{t}\rfloor dt\\=\sum_{k=1}^n\int_{(k-1)^2}^{k^2} (k-1)dt=\sum_{k=1}^{n}(k-1)(k^2-(k-1)^2)=\sum_{k=1}^n (2k^2-3k+1)\\=\frac{n(n+1)(2n+1)}{3}-3\frac{n(n+1)}{2}+n$$

• Very nice answer! Good to show how we get to the sum. Feb 12, 2015 at 7:09

That's the right starting point, now just write that out in summation notation. So we have your integral is equal to $$\sum _{k=1}^{n-1}((k+1)^2-k^2)k$$ Simplifying, we get $$\sum _{k=1}^{n-1}(2k+1)k=2\sum _{k=1}^{n-1}k^2+\sum_{k=1}^{n-1}k=2\cdot \frac {(n-1)(n)(2n-1)}{6}+\frac {(n-1)(n)}{2}$$ Factoring, we get$$(n-1)(n)\left( \frac {2n-1}{3}+ \frac{ 1}{ 2} \right)$$

If your observation is right, then

\begin{align} \sum_{k=1}^{n-1}((k+1)^2-k^2)k&=\sum_{k=1}^{n-1}(k^2+2k+1-k^2)k\\ &=\sum_{k=1}^{n-1}(2k^2+k)\\ &=2\frac{n({n-1})(2n-1)}{6}+\frac{n(n-1)}{2}\\ &=n(n-1)\left(\frac{2n-1}{3}+\frac12\right) \end{align}

• Oops, wrong upper bound. One sec. Feb 12, 2015 at 6:51
• close, but the bounds are off, the top bound is n-1. I'm almost finishing up typing about the same thing :. Also you need to use k and not n as the variable inside the summation.
– Alan
Feb 12, 2015 at 6:51
• @Alan: Yes, I am too used to $n$. Feb 12, 2015 at 6:52