Sum of Sequence of Squares

Theorem

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

Proof
Proof by induction:

For all $$n \in \N^*$$, let $$P \left({n}\right)$$ be the proposition $$\sum_{i=1}^{n} i^2 = \frac{n (n+1)(2n+1)} {6}$$.

Base Case
When $$n=1$$, we have $$\sum_{i=1}^{1}i^2=1^2=1$$.

Now, we have $$\frac{n(n+1)(2n+1)}{6} = \frac {1(1+1)(2 \cdot 1+1)}{6}=\frac{6}{6}=1$$

So $$P(1)$$ is true. This is our base case.

Induction Hypothesis
Now we need to show that, if $$P \left({k}\right)$$ is true, where $$k \ge 2$$, then it logically follows that $$P \left({k+1}\right)$$ is true.

So this is our induction hypothesis:
 * $$\sum_{i=1}^{k}i^2 = \frac{k(k+1)(2k+1)}{6}$$.

Then we need to show:
 * $$\sum_{i=1}^{k+1} i^2 = \frac{\left({k+1}\right) \left({k+2}\right) \left({2 \left({k+1}\right) + 1}\right)}{6}$$.

Induction Step
This is our induction step:

Using the properties of summation, we have $$\sum_{i=1}^{k+1}i^2=\sum_{i=1}^{k}i^2 + (k+1)^2$$.

We can now apply our induction hypothesis, obtaining:

$$ $$ $$ $$ $$

So $$P \left({k}\right) \implies P \left({k+1}\right)$$ and the result follows by the Principle of Mathematical Induction.

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

Proof by Telescoping Sum
Observe that $$3i(i+1)=i(i+1)(i+2)-i(i+1)(i-1)$$.

By taking the sum we'll get a telescoping one on the RHS and the conclusion follows.