a) \(A=x^4-9x^3+21x^2+x+k=x^2\left(x^2-x-2\right)-8x\left(x^2-x-2\right)+15\left(x^2-x-2\right)+30+k=\left(x^2-x-2\right)\left(x^2-8x+15\right)+30+k\)
Để A chia hết cho \(x^2-x-2\) thì \(30+k=0\Leftrightarrow k=-30\)
b) \(A=x^4-x^3+6x^2-x+k=x^2\left(x^2-x+5\right)+\left(x^2-x+5\right)-5+k=\left(x^2-x+5\right)\left(x^2+1\right)-5+k\)
Để A chia hết cho \(x^2-x+5\) thì \(-5+k=0\Leftrightarrow k=5\)