If $f(x)\mod (x-1)=5$, $f(x)\mod (x+1)=3$, $f(x)\mod (x+2)=5$ then find the remainder when $f(x)$ is divided by $x^3+2x^2-x-2$ 
If $f(x)\mod (x-1)=5$, $f(x)\mod (x+1)=3$, $f(x)\mod (x+2)=5$ then find the remainder when $f(x)$ is divided by $x^3+2x^2-x-2$    

I don't have any idea as to how to proceed with this question. I have figured out that $x^3+2x^2-x-2=(x-1)(x+1)(x+2)$.
But I don't know how to use this information to find the remainder $x^3+2x^2-x-2$ would give. A small hint as to how to proceed would be enough. 
 A: The final condition implies that the divisor is of order $3$, so the remainder is of order $2$. We can write $$f(x)=(x-1)(x+1)(x+2)Q(x) +ax^2+bx+c$$ We have $f(1) =5$, so $$a+b+c=5...(1)$$ and similarly $f(-1)=3$ and $f(-2)=5$, so , $$a-b+c=3...(2)$$ and $$4a-2b+c=5$$ Solving for $a,b,c$, we get $a=1, b=1, c=3$. Hence our remainder is $$ax^2+bx+c = x^2+x+3.$$
A: From the information provided, we can write 
$$ f(x) = p(x)(x-1) + 5,$$
$$ f(x) = q(x)(x+1) + 3,$$
and 
$$ f(x) = r(x) (x+2) + 5.$$ 
where $p(x)$, $q(x)$, and $r(x)$ are polynomials such that 
$$\mathrm{gcd} (p(x), x-1 ) = \mathrm{gcd} (q(x), x+1 ) = \mathrm{gcd} (r(x), x+2 ) = 1.$$
Now as 
$$ x^3 + 2x^2 -x-2 = (x+1)(x-1)(x+2),$$
and as 
$$\mathrm{gcd}(x-1, x+1) = \mathrm{gcd}(x+1, x+2) = \mathrm{gcd}(x+2, x-1) = 1, $$
so we can conclude that ...
Can you proceed from here?
A: Write $\ f = q\,g + r\ $ with $\,\deg r \le 2 = \deg g,\ $ by the Division Algorithm.
$\color{#0a0}5 \ =  f(1)\ =\ r(1)\ \ $  by $\ g(1)\ =0\ $
$\color{#0a0}5\! =\! f(-2)\!=\! r(-2)\ $ by $\ g(-2)\!=\!0,\ $ so $\ r = \color{#0a0}5 + \color{#c00}c\,(x\!-\!1)(x\!+\!2)$
$\!\begin{align} 3\! =\! f(-1)\!\! &=\! r(-1)\ \, {\rm by}\  \ g(-1)\! =\! 0\\
 &= 5+\color{#c00}c(-2)\ \Rightarrow\, \color{#c00}{c= 1}\ \Rightarrow\  r = 5\ +\ (x\!-\!1)(x\!+\!2)\end{align}$
