I am attaching my workings which should make this clearer but the crux of this is that I have just proven by induction that the sum of the first n squares is: $\dfrac{n(n + 1)(2n + 1)}{6}$
The issue is that I did this by proving the base case $n = 1$, assuming it is true for arbitrary $n \leq k$ and then showing true for $k + 1$ and breaking down both sides of an equation to:
$$\dfrac{2k^3 + 9k^2 + 13k + 6}{6}$$
This took some time, including finding and correcting a mistake, and when I checked my answer at the back of the book it was proven in two lines as seen here:
By induction. True for $n=1$. If $n>1$, then $$1^2+2^2+\dots+n^2=\left(1^2+2^2+\dots+(n-1)^2\right)+n^2=\\ \frac{(n-1)n(2n-1)}6+n^2=\frac{n(n+1)(2n+1)}6$$
Induction is something I understand with the ladder analogy, first prove the first step $n = 1$ is there, then assume an arbitrary step $k$ is there and prove the step after it $k + 1$ is there. If we can do that, we can set that random step to the first step, and use what we have proven with $k + 1$ to traverse the entire ladder. My understanding comes from what I read in Discrete Maths - Elementary and Beyond, and a video from Khan Academy and theTrevTutor.
I get that the author uses $n$ instead of $k$ but I do not understand how in that solution where $\frac{(n-1)n(2n-1)}6$ comes from and how it is used. Referencing the ladder analogy, I thought that perhaps the solution uses the step previous to $k$, $k - 1$, instead of the step after $k + 1$ but I cannot seem to work that out.
This kind of solution was provided for another problem I solved with more lines before this also, so I would love to understand what I am missing so I can apply it myself from now on. Can someone please explain this to me plainly?
This is my work: