# Sum of Squares in terms of Sum of Integers

We know that the sum of squares can be expressed as a multiple of the sum of integers as follows: \begin{align} \sum_{r=1}^n r^2 &=\frac 16 n(n+1)(2n+1)\\ &=\frac {2n+1}3\cdot \frac {n(n+1)}2\\ &=\frac {2n+1}3\sum_{r=1}^nr\end{align}

Is there a simple direct proof to express the sum of squares as $\dfrac {2n+1}3$ multiplied by the sum of integers, without first deriving the formula for the sum of squares and then breaking it down as shown above?

• Possibly not what you are looking for but $$\left(\sum_{r=1}^{n+1} r\right)^2-1 = \sum_{r=1}^n (r^3+3r^2+3r+1) = \left(\sum_{r=1}^n r\right)^2 + 3\sum_{r=1}^n r^2 + 3\sum_{r=1}^n r + n$$ seems a way .. – r9m Aug 3 '15 at 16:20
• That might be a possible lead. Can you develop it further? – hypergeometric Aug 3 '15 at 16:46
• @hypergeometric Summation by parts seems to do the trick. Please let me know how I can improve my answer. I really want to give you the best answer I can. – Mark Viola Aug 3 '15 at 16:57
• Have found a proof which does not require prior knowledge of the result of the sum of integers (or the sum of squares) - posted below. – hypergeometric Aug 21 '15 at 6:15

Using Summation by Parts, with $f_r=r^2$ and $g_r=r$, we have

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

ALTERNATIVE SUMMATION BY PARTS

We can instead use the Newton Series for summation by parts. Here, we let $f_k=g_k=k$ and write

\begin{align} \sum_{k=1}^{n}k^2&=n\left(\frac{n(n+1)}{2}\right)-\sum_{k=0}^{n-1}\sum_{\ell=0}^{k} k\\\\ &=n\left(\frac{n(n+1)}{2}\right)-\sum_{k =0}^{n-1}\frac{k(k+1)}{2}\\\\ &=(n+1)\left(\frac{n(n+1)}{2}\right)-\frac12\sum_{k =1}^n k(k+1)\\\\ \frac32\sum_{k=1}^{n}k^2&=(n+1)\left(\frac{n(n+1)}{2}\right)-\frac12\sum_{k =1}^n k\\\\ \sum_{k=1}^{n}k^2&=\frac23 (n+1)\left(\frac{n(n+1)}{2}\right)-\frac13\sum_{k =1}^n\,k\\\\ &=\frac13(2n+1)\left(\frac{n(n+1)}{2}\right) \end{align}

again as expected!

• Thanks for your solution. It appears to be similar to the textbook proof of summing $$(r+1)^3-r^3=3r^2+3r+1$$ for $r=1$ to $n$ and allowing LHS to telescope, resulting immediately in $$(n+1)^3-1^3=3\sum r^2+3\sum r+n$$. – hypergeometric Aug 3 '15 at 17:21
• @hypergeometric Yes, I am aware of the telescoping sum approach. But summation by parts is more robust and does provide the decomposition. I am happy to delete if this doesn't help. – Mark Viola Aug 3 '15 at 17:50
• Please leave the solution here. It helps to have different approaches. – hypergeometric Aug 4 '15 at 2:59
• @hypergeometric Great! I also added an alternative solution using Newton's Series for summation by parts. It might be a bit closer to what you're seeking. – Mark Viola Aug 4 '15 at 3:30

New Solution

Have just found a proof which does not require the prior knowledge of the result of the sum of integers.

\begin{align} \sum_{i=1}^n i^2&=\sum_{i=1}^n\sum_{j=1}^i(2j-1)&& ...(1)\\ \sum_{i=1}^n i^2&=\sum_{i=1}^n\sum_{j=1}^i 2(n-i)+1&& ...(2)\\ \sum_{i=1}^n i^2&=\sum_{i=1}^n\sum_{j=1}^i 2(i-j)+1&& ...(3)\\ (1)+(2)+(3):\\ 3\sum_{i=1}^n i^2 &=\sum_{i=1}^n\sum_{j=1}^i (2j-1)+2(n-1)+1+2(i-j)+1\\ &=\sum_{i=1}^n\sum_{j=1}^i (2n+1)\\ &=(2n+1)\sum_{i=1}^n i\\ \sum_{i=1}^n i^2&=\frac{2n+1}3\sum_{i=1}^n i\qquad\blacksquare \end{align}

This proof is a transcription of the diagrammatic proof of the same as shown on the wikipedia page here.

\begin{align} (2m+1)\sum_{r=1}^mr-(2m-1)\sum_{r=1}^{m-1}r &=(2m+1)\frac {m(m+1)}2-(2m-1)\frac{m(m-1)}2\\ &=\frac m2\left[(2m+1)(m+1)-(2m-1)(m-1)\right]\\ &=3m^2\end{align} Summing $$m$$ from $$1$$ to $$n$$ and telescoping LHS gives
$$(2n+1)\sum_{r=1}^nr=3\sum_{m=1}^nm^2\color{lightgray}{=3\sum_{r=1}^n r^2}\\ \sum_{r=1}^nr^2=\frac {2n+1}3\sum_{r=1}^nr\qquad\blacksquare$$