# Question regarding the derivation of textbook example sum of $k^2$

I have had a look at similar topic and I found quite a few at math.stack..... However, I am particularly interested in this bit that I am providing here, to be more specific, from the photo of the textbook you can see I have marked out something in red and something in blue. The blue I get, but the red I don't, it looks like they have just swapped $k$ for $n$ removed the sum notation and I have a hard time understanding how this is possible. Could someone please explain$?$ • When you got to the step that puzzled you, what number did you plug in for $n$? I plugged in $n=5$ and got $$(2^3+3^3+4^3+5^3+6^3)-(1^3+2^3+3^3+4^3+5^3)=6^3-1^3.$$ Yeah, that makes sense. – bof Jan 21 '16 at 11:37

Looking at the bit in square brackets and remembering what summation notation means, $$\sum_{k=1}^n(k+1)^3-\sum_{k=1}^nk^3 =\bigl(2^3+3^3+\cdots+n^3+(n+1)^3\bigr)-\bigl(1^3+2^3+3^3+\cdots+n^3\bigr)\ .$$ On the RHS, if you look carefully, you will see that pretty much everything cancels and you get $$(n+1)^3-1^3\ .$$ This is called a telescoping sum.
See take $2$ in place of $n$ so it will be $3^3-2^2+2^3-1^3$ now we have taken $n=2$ which is same as $(2+1)^3-1^3$ or take summation common so it becomes $(k+1)^3-k^3=(k+1-k)(k^2+2k+1+k^2+k+k^2)=3k^2+3k+1$ and then do the normal summation which was first taken outside. Or its also a telescopic series