<s>[INST] Proving $\sum_{k=1}^n{k^2}=\frac{n(n+1)(2n+1)}{6}$ without induction I was looking at: $$\sum_{k=1}^n{k^2}=\frac{n(n+1)(2n+1)}{6}$$
It's pretty easy proving the above using induction, but I was wondering what is the actual way of getting this equation?
 [/INST] HINT:
To find $\sum_{1\le r\le n}r^m$  we can utilize the identity  
$$(r+1)^{m+1}-r^{m+1}$$
$$=\sum_{1\le t\le m+1}\binom {m+1}t r^{m+1-t}=(m+1)r^m+\sum_{2\le t\le m+1}\binom {m+1}t r^{m+1-t}$$ and need to know $\sum_{1\le r\le n}r^s$ for $0\le s\le m-1$
For $m=2,$  $$(r+1)^3-r^3=3r^2+\sum_{2\le t\le 3}\binom 3t r^{3-t}=3r^2+3r+1$$
Put $r=1,2,3,\cdots,n-1,n$ and add to get $$(n+1)^3-1^3=3\sum_{1\le r\le n}r^2+3\sum_{1\le r\le n}r+\sum_{1\le r\le n}1$$
Now, we know $\sum_{1\le r\le n}r=\frac{n(n+1)}2$ and $\sum_{1\le r\le n}1=n$
</s>