<s>[INST] Finding polynomial given the remainders Question: Find a polynomial $f(x) \in \mathbb{Q} (x)$ of minimal degree that has both the following properties:
When $f(x)$ is divided by $(x-1)^2$, the remainder is $2x$; and when $f(x)$ is divided by $(x-2)^3$, the remainder is $3x$.
Answer provided: $f(x)=(x-2)^3 \cdot (4x-3)+3x$
Work so far: Okay, so I know this problem shouldn't be difficult, but I've been stumped. I know that this is probably a simple application of the division algorithm, where $f(x)=q(x) \cdot d(x)+r(x)$ but I can't seem to get an answer. The polynomial's minimum degree should be $4$, intuitively.
So I have that $f(x)=(x-1)^2 \cdot q_1(x) + 2x$ and $f(x)=(x-2)^3 \cdot q_2(x)+3x$. Then I know that for the second equation, $q_2(x)$ should be of form $(ax+b)$ for some $a,b \in \mathbb{Q}$, also I also applied the remainder theorem to find that $f(1)=4$ and that $f(2)=6$, and so 
$f(1)=4=(-1)^3 \cdot (a+b) +3(1) \rightarrow a+b=1$ 
so it makes sense that the answer is $q_2(x)=4x-3$, but I don't know how to get there after finding $a+b=1$. 
 [/INST] It might be worth noticing that this can be phrased in terms of congruences
$$
\begin{cases}
f(x) \equiv 2x \pmod{(x-1)^2}\\
f(x) \equiv 3x \pmod{(x-2)^3}.
\end{cases}
$$
There is definitely a solution because of CRT, since $(x-1)^2$ and $(x-2)^3$ are clearly coprime.
The solution is of course the same the others have given, I just would like to illustrate how you get it using the general theory of system of congruences.
Now use the extended Euclidean algorithm on $(x-1)^2$ and $(x-2)^3$ to get 
$$
1 = (x-1)^2 \cdot (3x^2 -14 x + 17) + (x-2)^3 \cdot (-3x+2).
$$
So applying the general method for solving a system of congruences, write
$$
3 x - 2 x = x = (x-1)^2 \cdot (3x^3 -14 x^2 + 17 x) + (x-2)^3 \cdot (-3x^2+2x),
$$
so that
$$
3 x + (x-2)^3 \cdot (3x^2-2x) = 2 x + (x-1)^2 \cdot (3x^3 -14 x^2 + 17 x)
=
3 x^5-20 x^4+48x^3-48x^2+19 x
$$
is a solution. This is not minimal, because you can still take the remainder with respect to the lcm of $(x-1)^2$ and $(x-2)^3$ (which is their product in this case), so one gets
$$
4 x^4-27 x^3+66 x^2-65x+24.
$$
</s>