Để C chia hết cho D thì \(3x^3+9x^2-7x^2-21x+17x+51+a-2⋮x+3\)
=>a-2=0
=>a=2
\(C=3x^3+2x^2-4x+a+49\)
\(=\left(3x^3+9x^2\right)-\left(7x^2+21x\right)+\left(17x+51\right)+a-2\)
\(=3x^2\left(x+3\right)-7x\left(x+3\right)+17\left(x+3\right)+a-2\)
\(=\left(3x^2-7x+17\right)\left(x+3\right)+a-2\)
Để \(C⋮D=x+3\)
\(\Leftrightarrow a-2=0\Leftrightarrow a=2\)