# What rule does this factors-of-a-polynomial question expect me to use?

I came across this exam question:

$f(x)=x^3+5x^2+px-q$

Given that $(x+2)$ and $(x-1)$ are factors of $f(x)$,

a) form a pair of simultaneous equations in $p$ and $q$

b) show that $p=2$ and find the value of $q$

I immediately wrote, $f(x)=(x+2)(x-1)(x+\alpha) = x^3+5x^2+px-q$, expanded it and equated the coefficients. This answers the second part of the question directly, and given $p$ and $q$ I can construct simultaneous equations involving them arbitrarily.

What rule does the a) part of the question expect me use?

• You can note that $f(-2)=f(1)=0$. – SMM Sep 11 '18 at 9:04
• For the rule's name, it's called Factor Theorem. – Theo Bendit Sep 11 '18 at 9:17

Just plug in the roots $x=-2$ and $x=1$ to get $$0=12-2p-q \\ 0=6+p-q.$$