# Sum of Sequence of Squares/Proof by Sum of Differences of Cubes

## Theorem

$\ds \forall n \in \N: \sum_{i \mathop = 1}^n i^2 = \frac {n \paren {n + 1} \paren {2 n + 1} } 6$

## Proof

 $\ds \sum_{i \mathop = 1}^n \paren {\paren {i + 1}^3 - i^3}$ $=$ $\ds \sum_{i \mathop = 1}^n \paren {i^3 + 3 i^2 + 3 i + 1 - i^3}$ Binomial Theorem $\ds$ $=$ $\ds \sum_{i \mathop = 1}^n \paren {3 i^2 + 3 i + 1}$ $\ds$ $=$ $\ds 3 \sum_{i \mathop = 1}^n i^2 + 3 \sum_{i \mathop = 1}^n i + \sum_{i \mathop = 1}^n 1$ Summation is Linear $\ds$ $=$ $\ds 3\sum_{i \mathop = 1}^n i^2 + 3 \frac {n \paren {n + 1} } 2 + n$ Closed Form for Triangular Numbers

On the other hand:

 $\ds \sum_{i \mathop = 1}^n \paren {\paren {i + 1}^3 - i^3}$ $=$ $\ds \paren {n + 1}^3 - n^3 + n^3 - \paren {n - 1}^3 + \paren {n - 1}^3 - \cdots + 2^3 - 1^3$ Definition of Summation $\ds$ $=$ $\ds \paren {n + 1}^3 - 1^3$ Telescoping Series: Example 2 $\ds$ $=$ $\ds n^3 + 3n^2 + 3n + 1 - 1$ Binomial Theorem $\ds$ $=$ $\ds n^3 + 3n^2 + 3n$

Therefore:

 $\ds 3 \sum_{i \mathop = 1}^n i^2 + 3 \frac {n \paren {n + 1} } 2 + n$ $=$ $\ds n^3 + 3 n^2 + 3 n$ $\ds \leadsto \ \$ $\ds 3 \sum_{i \mathop = 1}^n i^2$ $=$ $\ds n^3 + 3 n^2 + 3 n - 3 \frac {n \paren {n + 1} } 2 - n$

Therefore:

 $\ds \sum_{i \mathop = 1}^n i^2$ $=$ $\ds \frac 1 3 \paren {n^3 + 3 n^2 + 3 n - 3 \frac {n \paren {n + 1} }2 - n}$ $\ds$ $=$ $\ds \frac 1 3 \paren {n^3 + 3 n^2 + 3 n - \frac {3 n^2} 2 - \frac {3 n} 2 - n}$ $\ds$ $=$ $\ds \frac 1 3 \paren {n^3 + \frac {3 n^2} 2 + \frac n 2}$ $\ds$ $=$ $\ds \frac 1 6 n \paren {2 n^2 + 3 n + 1}$ $\ds$ $=$ $\ds \frac 1 6 n \paren {n + 1} \paren {2 n + 1}$

$\blacksquare$