The remainder theorem says that a polynomial f(x) has a remainder of f(c) upon getting divided by x - c. So if
f(x) = x⁴ + p x³ + q x² + r x + 6
is divisible by x - 1, x - 2, and x - 3, then we have
f (1) = 7 + p + q + r = 0
f (2) = 22 + 8p + 4q + 2r = 0
f (3) = 87 + 27p + 9q + 3r = 0
Solve the system for p, q, r. You can eliminate r by substituting the first equation into the other two:
p + q + r = -7
8p + 4q + 2r = -22 → 6p + 2q - 14 = -22 → 3p + q = -4
27p + 9q + 3r = -87 → 24p + 6q - 21 = -87 → 4p + q = -11
Eliminate q by adding (-1) times the first equation to the second one, then solve for p :
- (3p + q) + (4p + q) = - (-4) + (-11)
-3p - q + 4p + q = 4 - 11
p = -7
Solve for q :
3p + q = -4 → 3 (-7) + q = -4 → q = 17
Solve for r :
p + q + r = -7 → -7 + 17 + r = -7 → r = -17