Hi, in one of the steps of a particular problem in my math book the author simply rewrites an equation to the following:

p(2p+1)(2p-1)+3(2p+1)^2 = (2p+1)(p(2p-1)+3(2p+1))

Basically factorizing the equation. It should be really simple but I' don't see how this can be achieved easily.

Is there some trick that I'm missing?