If $x^5 - x^4 + x^3 - px^2 + qx + 4$ is divisible by both $x+2$ and $x-1$, then find $p$ and $q$.
If it's divisible by x + 2 and x - 1 then -2 and 1 are roots
Using synthetic division
-2 [ 1 -1 1 - p q 4 ]
-2 6 -14 2p + 28 -4p -2q -56
_______________________________________________
1 -3 7 -p - 14 2p +q + 28 -4p - 2q - 52 = 0
Rearranging the last equation we have that
-4p - 2q = 52
-2p - q = 26 (2)
1 [ 1 - 1 1 - p q 4 ]
1 0 1 -p + 1 -p + q + 1
_________________________________________________
1 0 1 -p + 1 - p + q +1 -p + q + 5 = 0
Rearranging the last equation
p - q = 5
q = p - 5 (1)
Sub (1) into (2)
-2p - (p - 5) = 26
-3p = 21
p= -7
q = p-5 = -12