Deriving the formula of a summation Derive the formula for 
$$
\sum_{k=1}^n k^2
$$
The solution's that I was given has $k^3 + (k-1)^3$ as the first step but doesn't say how it got to that.  Any help?

Note $(k+1)^3-k^3=3k^2+3k+1$ so $$\begin{align} n^3=\sum_{k=0}^{n-1} (k+1)^3-k^3&=\sum_{k=0}^{n-1} 3k^2+3k+1\\ &=3\sum_{k=0}^{n-1}k^2+3\sum_{k=0}^{n-1}k+\sum_{k=0}^{n-1}1\\
&=3\sum_{k=0}^{n-1}k^2+3\frac{(n-1)n}{2}+n\\
\frac{n^3}{6}-\frac{n(n-1)}{2}-\frac n3&=\sum_{k=0}^{n-1}k^2\\
\frac{n(n-1)(2n-1)}{6}&=\sum_{k=0}^{n-1}k^2 \end{align}$$
So we get $$ \frac{n(n+1)(2n+1)}{6}=\sum_{k=1}^{n}k^2 $$
