Ta có :
\(x^2-9=\left(x-3\right)\left(x+3\right)\)
Đặt \(f_{\left(x\right)}=3x^3+ax^2+bx+9\)
Vì \(f_{\left(x\right)}⋮\left(x^2-9\right)\)
\(\Rightarrow\left\{{}\begin{matrix}f_{\left(3\right)}=3.3^3+a.3^2+3b+9=0\\f_{\left(-3\right)}=3.\left(-3\right)^3+a.\left(-3\right)^2+\left(-3\right)b+9=0\end{matrix}\right.\)
\(\Rightarrow\left\{{}\begin{matrix}81+9a+3b+9=0\\-81+9a-3b+9=0\end{matrix}\right.\)
\(\Rightarrow\left\{{}\begin{matrix}9a+3b+90=0\\9a-3b-72=0\end{matrix}\right.\)
\(\Rightarrow\left\{{}\begin{matrix}9a+3b=-90\\9a-3b=72\end{matrix}\right.\)
\(\Rightarrow\left\{{}\begin{matrix}3a+b=-30\\3a-b=24\end{matrix}\right.\)
\(\Rightarrow\left\{{}\begin{matrix}6a=-6\\2b=-54\end{matrix}\right.\)
\(\Rightarrow\left\{{}\begin{matrix}a=-1\\b=-27\end{matrix}\right.\)
Vậy \(a=-1;b=-27\)