# Find the remainder when $f(x)$ is divided by $x^2+x-2$

When $f(x)$ is divided by $x-1$ and $x+2$, the remainders are $4$ and $-2$ respectively. Find the remainder when $f(x)$ is divided by $x^2+x-2$.

Please help. The answer is $2x+2$.

I tried to understand the link between the first sentence and the second sentence but all I could make out was $f(1)=4$ ($4$ being the remainder) and $f(-2)=-2$.

I also broke down $x^2+x-2$ into $(x-1)(x+2)$ but after that, I didn't know how to continue. It seemed like there was a link as both have $x-1$ and $x+2$. I tried to attempt it myself for quite a long time but I couldn't make out anything. I'm not sure what I made out was even on the correct track though.

Division of a polynomial $A(x)$ by $B(x)$ means finding another two polynomials $Q(x)$ (quotient), $R(x)$ (remainder) with $\deg(R(x))<\deg(B(x))$ ($\deg$ denotes the highest power of $x$ that is present in the polynomial) such that: $$A(x)=B(x)Q(x)+R(x)$$

So by definition: if you divide $f(x)$ by $x-1$ and obtain remainder $4$, this says $f(x)=(x-1)Q(x)+4$ for some polynomial $Q(x)$. This gives $f(1)=4$. Similarly, $f(-2)=-2$.

$$f(x)=(x^2+x-2)Q(x)+ax+b=(x+2)(x-1)Q(x)+ax+b$$

for some $a,b\in\Bbb R$, polynomial $Q(x)$ (we wrote $ax+b$ because as I said $\deg(R(x))<\deg(B(x))$, so the remainder has degree less than $2$). You know $f(1)=4,\,f(-2)=-2$.

$f(1)=a+b=4$ and $f(-2)=-2a+b=-2$. It's a system of two equations with two variables. You should be able to solve it.

Use the Chinese Remainder theorem (Wikipedia link) in the ring of polynomials.

You'll want to look at the polynomials $g=\frac{1}{3}(x+2)$ and $h=-\frac{1}{3}(x-1)$, which satisfy \begin{align*} g&\equiv 1\bmod (x-1) & h&\equiv 0\bmod(x-1)\\ g&\equiv 0\bmod (x+2) & h&\equiv 1\bmod (x+2) \end{align*} Thus, for any $a$ and $b$, \begin{align*} ag+bh&\equiv a\bmod (x-1)\\ ag+bh&\equiv b\bmod (x+2) \end{align*} In particular, the polynomial $$k=4g-2h=(\tfrac{4}{3}x+\tfrac{8}{3})+(\tfrac{2}{3}x-\tfrac{2}{3})=2x+2$$ has the property that \begin{align*} k&\equiv \hphantom{-}4\bmod (x-1)\\ k&\equiv -2\bmod (x+2) \end{align*} The Chinese remainder theorem then guarantees that $f\equiv k\bmod (x^2+x-2)$ for any $f$ such that $f(1)=4$ and $f(-2)=-2$.

HINT:

As $x^2+x-2=(x+2)(x-1),$

Let $f(x)=g(x)(x^2+x-2)+A(x+2)+B(x-1)$

$\implies f(x)\equiv A(x+2)\pmod{x-1}\implies A(-1+2)=6$