I can quite grasp what is going on here. Can your bright minds please shine a little light my way. I do understand the first 2 but I don't know how they came about with the last two.

Do not know that $x^{a}x^{b}= x^{a+ b}$? $x^{2(p-1)+ 2(p+1)}= x^{2p- 2+ 2p+ 2}$.