User:Ans/Sum of Sequence of Squares

Theorem

 * $$\displaystyle \forall n \in \N: \sum_{i \mathop = 1}^n i^2 = \frac {n (n + 1) (2 n + 1) } 6$$

Proof by Summation of Summations

 * [[File:Sum of Sequences of Squares.jpg]]

We can observe from the above diagram that:
 * $$\displaystyle \forall n \in \N: \sum_{i \mathop = 1}^n i^2 = \sum_{i \mathop = 1}^n \left({\sum_{j \mathop = i}^n j}\right)$$

Therefore we have:

$$ \begin{array}{rrl} & \displaystyle \sum_{i \mathop = 1}^n i^2 & \displaystyle = \sum_{i \mathop = 1}^n \left({\sum_{j \mathop = i}^n j}\right) \\ & & \displaystyle = \sum_{i \mathop = 1}^n \left( {\sum_{j \mathop = 1}^n j - \sum_{j \mathop = 1}^{i - 1} j} \right) \\ & & \displaystyle = \sum_{i \mathop = 1}^n \left({\frac {n \left({n + 1}\right)} 2 - \frac {i \left({i - 1}\right)} 2}\right) \\ \implies & \displaystyle 2 \sum_{i \mathop = 1}^n i^2 & \displaystyle = n^2 \left({n + 1}\right) - \sum_{i \mathop = 1}^n i^2 + \sum_{i \mathop = 1}^n i \\ \implies & \displaystyle 3 \sum_{i \mathop = 1}^n i^2 & \displaystyle = n^2 \left({n + 1}\right) + \sum_{i \mathop = 1}^n i \\ \implies & \displaystyle 3 \sum_{i \mathop = 1}^n i^2 & \displaystyle = n^2 \left({n + 1}\right) + \frac {n \left({n + 1}\right)} 2 & \text{Closed Form for Triangular Numbers} \\ \implies & \displaystyle 6 \sum_{i \mathop = 1}^n i^2 & \displaystyle = 2 n^2 \left({n + 1}\right) + n \left({n + 1}\right) \\ & & \displaystyle = n \left({n + 1}\right) \left({2 n + 1}\right) \\ \implies & \displaystyle \sum_{i \mathop = 1}^n i^2 & \displaystyle = \frac {n \left({n + 1}\right) \left({2 n + 1}\right)} 6 \\ \end{array} $$

Proof by Sum of Differences of Cubes
$$ \begin{align} \sum_{i \mathop = 1}^n \left({\left({i + 1}\right)^3 - i^3}\right) & = \sum_{i \mathop = 1}^n \left({i^3 + 3 i^2 + 3 i + 1 - i^3}\right) & \text{Binomial Theorem} \\ & = \sum_{i \mathop = 1}^n \left({3 i^2 + 3 i + 1}\right) \\ & = 3 \sum_{i \mathop = 1}^n i^2 + 3 \sum_{i \mathop = 1}^n i + \sum_{i \mathop = 1}^n 1 & \text{Summation is Linear} \\ & = 3\sum_{i \mathop = 1}^n i^2 + 3 \frac {n \left({n + 1}\right)} 2 + n & \text{Closed Form for Triangular Numbers} \\ \end{align} $$

On the other hand:

$$ \begin{align} \sum_{i \mathop = 1}^n \left({\left({i + 1}\right)^3 - i^3}\right) & = \left({n + 1}\right)^3 - n^3 + n^3 - \left({n - 1}\right)^3 + \left({n - 1}\right)^3 - \cdots + 2^3 - 1^3 & \text{Definition of Definition:Summation!Summation} \\ & = \left({n + 1}\right)^3 - 1^3 & \text{Telescoping Series/Example 2!Telescoping Series: Example 2} \\ & = n^3 + 3n^2 + 3n + 1 - 1 & \text{Binomial Theorem} \\ & = n^3 + 3n^2 + 3n \\ \end{align} $$

Therefore:

$$ \begin{array}{rrl} & \displaystyle 3 \sum_{i \mathop = 1}^n i^2 + 3 \frac {n \left({n + 1}\right)} 2 + n & \displaystyle = n^3 + 3 n^2 + 3 n \\ \implies & \displaystyle 3 \sum_{i \mathop = 1}^n i^2 & \displaystyle = n^3 + 3 n^2 + 3 n - 3 \frac {n \left({n + 1}\right)} 2 - n \\ \end{array} $$

Therefore:

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