<s>[INST] How to compute remainder of division of $P(x)$ by $x^2 -3x+2$? 
The remainder of division of $P(x)$ by $x^2−1$ is $2x+1$, and the remainder of division of the same polynomial by $x^2−4$ is $x+4$. Compute the remainder of division of $P(x)$ by $x^2−3x+2$.

I will translate these into math equations
$$P(x) = (x^2-1)Q(x)+ 2x+1$$
$$P(x) = (x^2 -4)R(x)+x+4$$
And let 
$$f(x) = P(x) $$
We're asked to find the remainder when this polynomial is divided by $x^2 -3x+2$. So, there are two equations, which is why I'm confused with what to use in the equation $f(x) = P(x)$. What am I missing here?
Regards
 [/INST] HINT:
$$\frac{P(x)}{x^2-1}=Q(x)+\frac{2x+1}{x^2-1}\implies\frac{P(x)}{x-1}=[(x+1)Q(x)+2]+\frac 3{x-1}\\\frac{P(x)}{x^2-4}=R(x)+\frac{x+4}{x^2-4}\implies\frac{P(x)}{x-2}=[(x+2)R(x)+1]+\frac6{x-2}\\\boxed{\frac{P(x)}{x-2}-\frac{P(x)}{x-1}=\frac{(x-1)P(x)-(x-2)P(x)}{x^2-3x+2}=\frac{P(x)}{x^2-3x+2}}$$
</s>