\(a^2x+3ax+9=a^2\)
\(a^2x+3ax+9-a^2=0\)
\(ax\left(a+3\right)+\left(3-a\right)\left(a+3\right)=0\)
\(\left(a+3\right)\left(ax+3-a\right)=0\)
\(\left(a+3\right)\left[a\left(x-1\right)+3\right]=0\)
\(\Leftrightarrow\orbr{\begin{cases}a+3=0\\a\left(x-1\right)+3=0\end{cases}}\)
\(\Leftrightarrow\orbr{\begin{cases}a=-3\left(L\right)\\a=\left\{\pm1;3\right\}\left(N\right);a=-3\left(L\right)\end{cases}}\)
Vậy \(a=\left\{\pm1;3\right\}\)