We have,
p2 + 6p – 16
Coefficient of p2 is unity. So, we add and subtract square of half of coefficient of p.
p2 + 6p – 16 = p2 + 6p + 32 – 32 – 16 (Adding and subtracting 32)
= (p + 3)2 – 52 (Completing the square)
By using the formula (a2 – b2) = (a+b) (a-b)
= (p + 3 + 5) (p + 3 – 5)
= (p + 8) (p – 2)