<s>[INST] 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. 
 [/INST] 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?
</s>