# User:Ans/Sum of Sequence of Squares

## Theorem

$\displaystyle \forall n\in \mathbb {N} :\sum _{i\mathop {=} 1}^{n}i^{2}={\frac {n(n+1)(2n+1)}{6}}$ ## Proof by Induction

{{:proofwiki:Sum of Sequence of Squares/Proof by Induction}}

## Proof by Products of Consecutive Integers

{{:proofwiki:Sum of Sequence of Squares/Proof by Products of Consecutive Integers}}

## Proof by Telescoping Series

{{:proofwiki:Sum of Sequence of Squares/Proof by Telescoping Series}}

## Proof by Summation of Summations

File:Sum of Sequences of Squares.jpg

We can observe from the above diagram that:

$\displaystyle \forall n\in \mathbb {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 =2n^{2}\left({n+1}\right)+n\left({n+1}\right)\\&&\displaystyle =n\left({n+1}\right)\left({2n+1}\right)\\\implies &\displaystyle \sum _{i\mathop {=} 1}^{n}i^{2}&\displaystyle ={\frac {n\left({n+1}\right)\left({2n+1}\right)}{6}}\\\end{array}}$ ## Proof by Sum of Differences of Cubes

{\begin{aligned}\sum _{i\mathop {=} 1}^{n}\left({\left({i+1}\right)^{3}-i^{3}}\right)&=\sum _{i\mathop {=} 1}^{n}\left({i^{3}+3i^{2}+3i+1-i^{3}}\right)&{\text{[[Binomial Theorem]]}}\\&=\sum _{i\mathop {=} 1}^{n}\left({3i^{2}+3i+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{aligned}} On the other hand:

{\begin{aligned}\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{aligned}} 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}+3n^{2}+3n\\\implies &\displaystyle 3\sum _{i\mathop {=} 1}^{n}i^{2}&\displaystyle =n^{3}+3n^{2}+3n-3{\frac {n\left({n+1}\right)}{2}}-n\\\end{array}}$ Therefore:

{\begin{aligned}\sum _{i\mathop {=} 1}^{n}i^{2}&={\frac {1}{3}}\left({n^{3}+3n^{2}+3n-3{\frac {n\left({n+1}\right)}{2}}-n}\right)\\&={\frac {1}{3}}\left({n^{3}+3n^{2}+3n-{\frac {3n^{2}}{2}}-{\frac {3n}{2}}-n}\right)\\&={\frac {1}{3}}\left({n^{3}+{\frac {3n^{2}}{2}}+{\frac {n}{2}}}\right)\\&={\frac {1}{6}}n\left({2n^{2}+3n+1}\right)\\&={\frac {1}{6}}n\left({n+1}\right)\left({2n+1}\right)\\\end{aligned}} ## Proof by Binomial Coefficients

{{:proofwiki:Sum of Sequence of Squares/Proof by Binomial Coefficients}}

## Proof using Bernoulli Numbers

{{:proofwiki:Sum of Sequence of Squares/Proof using Bernoulli Numbers}}

## Historical Note

{{:proofwiki:Sum of Sequence of Squares/Historical Note}}