$$\sum_{k=1}^n k^2 = \sum_{j=1}^n \sum_{k=j}^n k$$
This equation was given in book Concrete Mathematics : A Foundation for Computer Science Page 46 under Method 5: Expand and contract.
In book author jumped from single sum to double sum but how he derived the double sum(using summation properties) I am unable to get it.
Explain in detail please.
I'll illustrate by calculating the right-hand-side expression with $n=5$. So we have an expression that runs from $j=1$ to $5$ like so: $$ \begin{array}{crrrrrr} j= 1 \Rightarrow & 1 &+ 2 &+3 &+4 &+5 \\ j= 2 \Rightarrow & & 2 &+3 &+4 &+5 \\ j= 3 \Rightarrow & & &3 &+4 &+5 \\ j= 4 \Rightarrow & & & &4 &+5 \\ j= 5 \Rightarrow & & & & &5 \\ \end{array} $$ what is the sum of all these rows? We have one $1$, two $2$'s, three $3$'s, four $4$'s and five $5$'s. So the sum is $$ 1\times 1 + 2\times 2 + 3\times 3 + 4\times 4 + 5\times 5 $$ which can also be written as $$ \sum_{k=1}^5 k^2 $$