Answer:
P(x) = (x +1)²(x -4)
Explanation:
You want the complete factorization of P(x) = x³- 2x² - 7x - 4.
Graph
A graph of the function is attached. It verifies that (x-k) = (x +1) is a factor, with multiplicity 2, and shows that (x -4) is also a factor.
P(x) = (x +1)²(x -4)
__
Additional comment
If P(x) has a zero at x=k, then (x -k) is a factor.
If the graph does not cross the x-axis at a zero, then that zero has even multiplicity.
Here, the cubic must have (at most) 3 real zeros, so there must be two others in addition to the one at x=4. That means the multiplicity of the zero at x=-1 is 2, and the factorization is ...
P(x) = (x +1)(x +1)(x -4)
We could determine the factorization by dividing P(x) by (x+1) to get a quotient of x²-3x-4. The factors of this quadratic are (x +1)(x -4), so the complete factorization is as shown above. The division could be by polynomial long division, or by synthetic division (shown in the second attachment).