Prove by induction $1^2 + 2^2 + ... + n^2 = \frac{n(n+1)(2n+1)}{6}$ I am practicing mathematical induction and I got this question.
$$1^2 + 2^2 + ... + n^2  = \frac{n(n+1)(2n+1)}{6}$$
I am wondering, if this is correct way to do it? Would my answer get accepted if it was an exam?
I put n+1 in the places of n. So Im trying to get this final result:
$$\frac{(n+1)(n+2)(2n+3)}{6}$$
Getting the left side done:
$$\frac{n(n+1)(2n+1)}{6} + \frac{6(n+1)^2}{6} = \frac{n(n+1)(2n+1)  +6(n+1)^2}{6} = \frac{(n+1)(n+2)(2n+3)}{6}$$
Am I doing this completely wrong, can someone guide me?

It is quite well done, but you should check first that the statement is true when $n=1$, and then to say that if$$1^2+2^2+\cdots+n^2=\frac{n(n+1)(2n+1)}6,\tag1$$then$$1^2+2^2+\cdots+n^2+(n+1)^2=\frac{n(n+1)(2n+1)}6+(n+1)^2$$(due to $(1)$), followed by the computations that you have shown us at the end of your question.
