<s>[INST] Finding coefficients in polynomials Find $p$ and $q$, if $x^3-2x^2+p+q$ is divided by $x^2+x-2$.
I have found $x =-2$ and $x=1$ however when placed into polynomial I am unable to find a value for $p$ and $q$.
 [/INST] One can also reduce $x^3 - 2 x^2 + p x + q$ modulo $x^2 + x - 2$ and then demand that the resulting polynomial is identical to zero. This then means that all the coefficients of that polynomial are zero, and that yields the solution. Modulo $q(x) = x^2 + x - 2$ we have:
$$x^2 \bmod q(x)= -x + 2$$
and
$$x^3 \bmod q(x)= \left(-x^2 + 2 x\right) \bmod q(x) = 3 x-2 $$
Therefore:
$\left(x^3 - 2 x^2 + p x + q\right) \bmod q(x) = (5+p) x + q-6$
which implies that $p = -5$ and $q = 6$.
</s>