Example 5 Find the range of the function $y=\left|x^{2}-4\right|-3 x(-2 \leqslant x \leqslant 5)$.
Solve $y=\left\{\begin{array}{cl}\left(x-\frac{3}{2}\right)^{2}-\frac{25}{4}, & 2 \leqslant x \leqslant 5, \\ -\left(x+\frac{3}{2}\right)^{2}+\frac{25}{4}, & -2 \leqslant x<2\end{array}\right.$
From $y=\left(x-\frac{3}{2}\right)^{2}-\frac{25}{4}$ and $2 \leqslant x \leqslant 5$, we get $-6 \leqslant y \leqslant 6$;
From $y=-\left(x+\frac{3}{2}\right)^{2}+\frac{25}{4}$ and $-2 \leqslant x<2$, we get $-6<y \leqslant \frac{25}{4}$. Therefore, the range of the function $y=1 x^{2}-$
$4 \mid-3 x(-2 \leqslant x \leqslant 5)$ is $\left[-6, \frac{25}{4}\right]$.