The sum of the first $n$ squares $(1 + 4 + 9 + \cdots + n^2)$ is $\frac{n(n+1)(2n+1)}{6}$ Prove that the sum of the first $n$ squares $(1 + 4 + 9 + \cdots + n^2)$ is 
$\frac{n(n+1)(2n+1)}{6}$.
Can someone pls help and provide a solution for this and if possible explain the question 

By mathematical induction, say $P(n):1+4+9+\cdots+n^2=\frac{n(n+1)(2n+1)}{6}$ 
Now $P(1)$ is true as L.H.S. $= 1$ and R.H.S. $= 1$
Say $P(k)$ is true for some $k \in \mathbb{N}$ and $k>1$.
Therefore $1+4+9+\cdots+k^2=\frac{k(k+1)(2k+1)}{6}$
Now for $P(k+1)$,
\begin{align}
& 1+4+9+\cdots+k^2+(k+1)^2 \\[10pt]
= {} & \frac{k(k+1)(2k+1)}{6}+(k+1)^2 \\[10pt]
= {} & (k+1)\cdot \frac{2k^2+k+6(k+1)}{6} \\[10pt]
= {} &\frac{(k+1)[k+1+1][2(k+1)+1]}{6}
\end{align}
So $P(k+1)$ is true.
Hence by induction, $P(n):1+4+9+\cdots+n^2=\frac{n(n+1)(2n+1)}{6}$ is true.
