Let $f\in\mathbb{Q}[X]$ such that $f(1)=-2, f(2)=1$ and $f(-1)=0$. Find the remainder of the division of $f$ by $X^3-2X^2-X+2$. Let $f\in\mathbb{Q}[X]$ such that $f(1)=-2, f(2)=1$ and $f(-1)=0$. Find the remainder of the division of $f$ by $X^3-2X^2-X+2$.
So, I figured: $f=(X+1)q$. Assumming that $f$ has degree 3, I solve $\begin{cases} (2+1)(2-a)(2-b)=1 \\ (1+1)(1-a)(1-b)=-2\end{cases}$ to find that $\begin{cases} a=\frac{5}{6}-\frac{\sqrt{37}}{6}, b=\frac{5}{6}+\frac{\sqrt{37}}{6} \\ a=\frac{5}{6}+\frac{\sqrt{37}}{6}, b=\frac{5}{6}-\frac{\sqrt{37}}{6} \end{cases}$. I divide $X^3-2X^2-X+2$ by $(X+1)(X-\frac{5}{6}-\frac{\sqrt{37}}{6})(X-\frac{5}{6}+\frac{\sqrt{37}}{6})$. The remainder is $\frac{4}{3}(X+1)(X-\frac{7}{4})$. Is it correct to assume that the remainder is always this, no matter the degree of $f$? Since that's what the problem asks for, I'm lead to assume this.

You can not assume that $f$ has degree $3$. Also the remainder that you have calculated is not correct, the actual remainder is $\frac{1}{3} \, {\left(4 \, x - 7\right)} {\left(x + 1\right)}$.
For example take $f(x) =
\frac{3}{4} \, x^{4} + \frac{1}{6} \, x^{3} - \frac{11}{4} \, x^{2} - \frac{7}{6} \, x + 1$.Observe that $f$ satisfies all the requirements given in the question. So when you divide (perhaps using long division or some other methods) $f$ by $x^3 - 2x^2 - x + 2$
you get the same remainder.
A big hint:
Let $g(x) = x^3 - 2x^2 - x + 2$ and let $r(x)$ be the remainder when you divide $f$ by $g$. Then there exist a $q(x)$ such that $f(x) = g(x)q(x) +  r(x)$. Observe that $r(x)$ is atmost quadratic polynomial. Also see that $g(1) = g(2) = g(-1) = 0$. So $f(1) = r(1) = -2$, $f(2) = r(2) = 1$ and $f(-1) = r(-1) = 0$. Can you find $r(x)$ satisfieng these conditions?
