a(1+p)^2+b(1+p)+1
=a(1+2p+p^2)+b(1+p)+1
=a(2p+p^2)+bp+a+b+1
=p(a(2+p)+b)+p
=p(a(2+p)+b+1)