Error in proving of the formula the sum of squares Given formula
$$
\sum_{k=1}^n k^2 = \frac{n(n+1)(2n+1)}{6}
$$
And I tried to prove it in that way:
$$
\sum_{k=1}^n (k^2)'=2\sum_{k=1}^n k=2(\frac{n(n+1)}{2})=n^2+n
$$
$$
\int (n^2+n)\ \text d n=\frac{n^3}{3}+\frac{n^2}{2}+C
$$
But 
$$
\frac{n^3}{3}+\frac{n^2}{2}+C $$ is not equal to 
$$\frac{n(n+1)(2n+1)}{6}=\frac{n^3}{3}+\frac{n^2}{2}+\frac{n}{6}$$
Where I made a mistake?

Adding integers has nothing to do with derivatives. You cannot expect to get anything meaningful form your attempt. 
