6r2 + 5rp - 21p2
You want two numbers that multiply to give 6*(-21) = -126 and add to give 5. Answer is 14 and -9 (14*(-9) = -126 and 14 + (-9) = 14 - 9 = 5).
6r2 + 5rp - 21p2
6r2 + 14rp - 9rp - 21p2
Group terms:
(6r2 + 14rp) - (9rp + 21p2)
Factor the greatest common factor out of each expression in parentheses:
2r(3r + 7p) - 3p(3r + 7p)
Factor out the common factor (3r+7p):
(2r - 3p)(3r + 7p)
and we're done!