x^2 + (p + 1/p)x + 1 =
Distribute the x into the numerator (p+1), the denominator remains p
x^2 + (xp + x)/p+ 1 =
Divide (xp + x) by p
x^2 + x + x/p + 1 =
Multiply by p to get p out of the denominator
p(x^2 + x + x/p + 1) =
x^2p + xp + x + 1=
Factor
(x + 1)(xp + 1)