
I don't know how they come from the step prior to the last to the last. If somebody could explain what happens there, that would be appreciated.
Thanks in advance!

I don't know how they come from the step prior to the last to the last. If somebody could explain what happens there, that would be appreciated.
Thanks in advance!
It is an instance of the distributive property (Wikipedia link): $$\large a\cdot c\;+\;b\cdot c=(a+b)\cdot c$$ In your instance, we have $$\large a=n,\qquad b=2,\qquad c=\frac{n+1}{2}$$