1) \(2x^2-5x+a=x\left(2x+1\right)-3\left(2x+1\right)+3+a=\left(2x+1\right)\left(x-3\right)+3+a⋮\left(2x+1\right)\)
\(\Rightarrow3+a=0\Rightarrow a=-3\)
2) \(x^4-9x^3+21x^2+x+a=x^2\left(x^2-x-2\right)-8x\left(x^2-x-2\right)+15\left(x^2-x-2\right)+30+a=\left(x^2-x-2\right)\left(x^2-8x+15\right)+30+a⋮\left(x^2-x-2\right)\)
\(\Rightarrow30+a=0\Rightarrow a=-30\)