# Prove $\sum \limits_{i=1}^n i^2 \in \Theta (n^3)$

I'm preparing for an exam, and one of the review problems is to sort functions by order of growth, and this was the only summation in it. I know that

$$\sum \limits_{i=1}^n i^2 = \frac{n(n+1)(2n+1)}{6},$$

But what if I did not know the closed form? How, then, would I prove

$$\sum \limits_{i=1}^n i^2 \in \Theta (n^3).$$

• Note that the hard part is showing $\sum_{i=1}^n i^2 \geq c n^3$, since trivially: $\sum_{i=1}^n i^2 \leq n \cdot n^2 = n^3$ (bounding the sum by its largest term times the number of terms). – JavaMan Dec 11 '11 at 21:46
• Well, $\sum_{i=1}^n i^2 \leq n \cdot n^2$ (trivially) and $\sum_{i=1}^n i^2 \geq \frac{n}{2} \cdot (n/2)^2$ by taking the last half of the series. – cardinal Dec 11 '11 at 21:48
• Hint: compare with the integral of x^2 – Bruno Joyal Dec 11 '11 at 21:49

$$\frac{1}{n^3} \sum_{i=1}^n i^2 = \frac{1}{n} \sum_{i=1}^n \left(\frac{i}{n}\right)^2,$$
which is a Riemann sum for the function $x \to x^2$ on $[0,1]$. Hence :
$$\lim_{n \to + \infty} \frac{1}{n^3} \sum_{i=1}^n i^2 = \int_0^1 x^2 dx = \frac{1}{3}.$$