1. Dividing polynomials

If a polynomial is divided by (x+2), the remainder is -19. When the same polynomial is divided by (x-1), the remainder is 2. Determine the remainder when the polynomial is divided by (x-1)(x+2).

2. Hi!
We know that $\displaystyle p(x)=k_1 (x)(x+2)-19$ and $\displaystyle p(x)=k_2 (x)(x-1)+2$ where $\displaystyle k_1 (x)$ and $\displaystyle k_2 (x)$ are two polynomials such that $\displaystyle deg(k_1 (x))=deg(k_2(x))$.
Thus, $\displaystyle p(1)=2$ and $\displaystyle p(-2)=-19$.

The remainer, when dividing $\displaystyle p(x)$ by $\displaystyle (x-1)(x+2)$ can be of degree 1 at most since $\displaystyle (x-1)(x+2)$ is a polynomial of degree 2.
This is, $\displaystyle r(x)=ax+b$ and
$\displaystyle p(x)=k_3(x)(x-1)(x+2)+r(x)=k_3(x)(x-1)(x+2)+ax+b$ where $\displaystyle k_3(x)$ is a polynomial of degree $\displaystyle deg(k_1(x))-1$

We see that $\displaystyle p(1)=a+b$ and $\displaystyle p(-2)=-2a+b$ but we know that $\displaystyle p(1)=2$ and $\displaystyle p(-2)=-19$ so we've to solve a linear system of equations in the unknowns a and b. It's easy to solve this system and the solution is $\displaystyle \begin{cases} -2a+b=-19 \\ a+b=2 \end{cases} \, \, \, \, \, \, \, \, \, \Longrightarrow \, \, \, \, \, \, \, \, \, \begin{cases} a=7 \\ b=-5 \end{cases}$

Therefore, the reaminder when $\displaystyle p(x)$ is divided by $\displaystyle (x-1)(x+2)$ is $\displaystyle r(x)=7x-5$