hi i know the answer is D but can someone explain why it’s D?

Answer:
D) (x + 1)(x - 2)
Explanation:
The Factor Theorem tells us that if p(x) = 0, then (x - (x)) is a factor of p. Usually it would be if p(a) = 0, then (x - a) is a factor of p, but this question is set up differently.
On the right hand side of the table we can see two values for where p(x) = 0. These values occur at x = -1 and x = 2.
These x-values are the a-values for the Factor Theorem, meaning that (x - (-1)) and (x - 2) are the factors for p.
(x + 1)(x -2) is a factor of p because when x = -1 and x = 2, p(x) = 0.