# Dividing polynomial $f(x)$ by $x-3$ and $x+6$ leaves respective remainders $7$ and $22$. What's the remainder upon dividing by $(x-3)(x+6)$?

If I have a polynomial $$f(x)$$ and is divided by $$(x- 3)$$ and $$(x + 6)$$ the respective remainders are $$7$$ and $$22$$, what is the remainder when $$f(x)$$ is divided by $$(x-3)(x + 6)$$?

I tried it by doing:

$$f(x) =(x-3)(x+6)q(x) + ax+b$$ And, $$a$$ and $$b$$ comes out to be $$-\dfrac53$$ and $$12$$ respectively.

But I'm not sure how to solve any further. And kindly explain exactly how it's done

• Chinese remainder theorem. – Wuestenfux Oct 12 '18 at 10:32
• You got that the remainder is $-\frac53x+12$. What else do you want? – José Carlos Santos Oct 12 '18 at 10:33

Let $$f(x)=Q1(x-3)+7$$ and $$f(x)=Q2(x+6)+22$$ (where Q1 and Q2 are some functions of x, since degree of f can be 2)

So, if you substitute x=3 and x=-6 in above equations respectively, you get f(3)=7 and f(-6)=22

Now, let $$f(x)=Q3(x-3)(x+6)+(ax+b)$$ where (ax+b) is remainder
(remainder may be a constant or a linear in x because of degree restriction over f(x))

Substitute x=3 $$f(3)=0+(3a+b)$$ Substitute x=-6 $$f(-6)=0+(-6a+b)$$
So, 3a+b=7 and -6a+b=22

Solving, $$a= \frac{-5}{3}$$ and $$b=12$$ Remainder is $$\frac{-5x}{3}+12$$

• In fact we can avoid solving equations - see my answer – Bill Dubuque Oct 13 '18 at 0:22

A slick way via $$\ {ab\bmod ac = a(b\bmod c)} =$$ mod Distributive Law,  is to add $$\ f(3) = 7\$$ to

$$\quad f(x)\!-\!f(3)\bmod (x\!-\!3)(x\!+\!6)\, =\, (x\!-\!3)\Bigg[\dfrac{\overbrace{f(x)\!-\!f(3)}^{\Large\color{#c00}{ 22\ \ -\ \ 7}\ }}{\underbrace{x - 3}_{\large\color{#c00}{\Large -6\ -\ 3\ }\ \ }}\underbrace{\bmod_{\phantom{1_{1_1{1_{1_{1_1}}}}}}\!\!\!\!\!\!\!\!\!\!\! x\!+\!6}_{\Large\Rightarrow\ \ x\ \equiv\ \color{#c00}{-6}\!}\Bigg] =\, \color{#c00}{-\dfrac{5}3}(x\!-\!3)$$

• seems better, but a bit above my understanding...not so familiar with modular algebra... – idea Oct 13 '18 at 8:11
• @omega The first linked post shows how to do it without mod. – Bill Dubuque Oct 13 '18 at 12:38

$$f(x)=(x-3)a(x)+7\Rightarrow f(3)=7$$

## $$f(x)=(x+6)b(x)+22\Rightarrow f(-6)=22$$

If you can write $$f$$ is of the form $$f(x) =(x-3)(x+6)q(x) + ax+b$$.

Solution is so easy:

$$f(3)=3a+b=7$$ $$f(-6)=-6a+b=22$$

Hence, $$a=-\dfrac53$$ and $$b=12$$