2. Given the function $y=\left(a \cos ^{2} x-3\right) \sin x$ has a minimum value of -3, then the range of the real number $a$ is
Solve:
$y=\left(a \cos ^{2} x-3\right) \sin x=-a \sin ^{3} x+(a-3) \sin x$, let $t=\sin x \in[-1,1]$, then $y \geqslant-3 \Rightarrow-a t^{3}+(a-3) t+3 \geqslant 0$
$\Rightarrow a t^{3}-(a-3) t-3=(t-1)\left(a t^{2}+a t+3\right) \leqslant 0$ for $t \in[-1,1]$ always holds.
Since $t-1 \leqslant 0$, and equality holds when $t=1 \Rightarrow x=2 k \pi+\frac{\pi}{2}(k \in \mathbf{Z})$.
Thus, $f(t)=a t^{2}+a t+3 \geqslant 0$ for $t \in[-1,1]$ always holds.
When $a>0$, since the axis of symmetry of $f(x)$ is $x=-\frac{1}{2} \in[-1,1]$, so $\Delta=a^{2}-12 a \leqslant 0 \Rightarrow a \in(0,12]$.
In summary, the range of real number $a$ is $\left[-\frac{3}{2}, 12\right]$.