I am just starting into calculus and I have a question about the following statement I encountered while learning about definite integrals:

n∑k=1k2=n(n+1)(2n+1)6

I really have no idea why this statement is true. Can someone please explain why this is true and if possible show how to arrive at one given the other?

**Answer**

Another way (by Euler, I think), from the geometric sum:

1+x+x2+⋯+xn=xn+1−1x−1

Differentiate both sides and multiply by x:

x+2x2+3x3+⋯+nxn=nxn+2−(n+1)xn+1+x(x−1)2

Differentiating once more, we get on the LHS

1+22x+32x2+⋯+n2xn−1

which, evaluated at x=1 gives our desired sum ∑nk=1k2. Hence, we just need to compute the derivative on the RHS in (2) (eg, with L’Hopital rule) and evaluate it at x→1.

It should be evident that this procedure also can be applied (though it also turns more cumbersome) for sums of higher powers.

*(Update)* here’s a concrete computation, applying the binomial theorem on the RHS of (1) and doing a series expansion around x=1. Let

\begin{align}

g(x)&=\frac{x^{n+1}-1}{x-1}\\

&=\frac{\left(1+(x-1)\right)^{n+1}-1}{x-1}\\

&={n+1 \choose 1}+{n+1 \choose 2}(x-1)+{n+1 \choose 3}(x-1)^2+O\left((x-1)^3\right) \tag{4}

\end{align}

Deriving, multiplying by x and deriving again: (g'(x) \, x)’={n+1 \choose 2}+{n+1 \choose 3}2 \, x + O(x-1) \tag{5}

which evaluated at x=1 gives the desired answer:

{n+1 \choose 2}+2{n+1 \choose 3} =\frac{n(n+1)(2n+1)}{6}

We can apply the same procedure for higher powers. For example:

\sum_{k=1}^n k^3={n+1 \choose 2}+{n+1 \choose 3}6+{n+1 \choose 4}6

**Attribution***Source : Link , Question Author : Nathan Osman , Answer Author : Community*