Lời giải:
Vì $x^2-3x+2=(x-1)(x-2)$ nên để $A(x)\vdots B(x)$ nghĩa là $A(x)\vdots x-1$ và $A(x)\vdots x-2$
Theo định lý Bê-du, để $A(x)\vdots x-1, A(x)\vdots x-2$ thì:
$A(1)=A(2)=0$
$\Leftrightarrow 1^4-9.1^3+21.1^2+a+b=2^4-9.2^3+21.2^2+2a+b=0$
$\Leftrightarrow 13+a+b=56+2a+b=0$
$\Rightarrow a=-43; b=30$