# Proof 8: The sum of squares

The formula for the sum of squares is:

$$1^2+2^2+\cdots+n^2=\frac16 n(n+1)(2n+1)$$

It is useful because it converts a row of confusingly many terms (therefore the dots $\cdots$) into a tangible number of terms that we can calculate.

If the formula works, then it must work for any number of terms. If one more term was added, the formula must therefore retain its form if it does work. We therefore add one extra term on the left-hand-side to see if the right-hand-side can be rearranged to the same form again. Such an extra term would be $(n+1)^2$, since the number $n+1$ is 1 larger than $n$:

\begin{align} ~& 1^2+2^2+\cdots+n^2 \quad\boldsymbol{+(n+1)^2}\\ ~=&\underbrace{ \frac16 n(n+1)(2n+1)}_\text{replaced with the formula} \quad\boldsymbol{+(n+1)^2} \\ ~=&(n+1)\left(\frac16 n(2n+1) +(n+1)\right) \\ ~=&(n+1)\left(\frac16 n(2n+1) + \frac66 (n+1)\right) \\ ~=&(n+1) \frac16 \left(n(2n+1) + 6 (n+1)\right) \\ ~=&(n+1) \frac16 \left((2n^2+n) + (6n+6)\right) \\ ~=&(n+1) \frac16 (2n^2+n + 6n+6) \\ ~=&(n+1) \frac16 (2n^2+7n+6) \\ ~=&(n+1) \frac16 (n+2)(2n+3) \\ ~=&(n+1) \frac16 (n+1+1)(2n+2+1) \\ ~=&\boldsymbol{(n+1)} \frac16 \left(\boldsymbol{(n+1)}+1\right)\left(2\boldsymbol{(n+1)}+1\right) \\ \end{align}

The expression here is now exactly the same as we started with, with a row of numbers with $n+1$ terms (it is the same formula $\frac16n(n+1)(2n+1)$ just with $n-1$ instead of $n$ to start with). Therefore, the formula works. $\quad_\blacksquare$