5. If the equation $x^{2}=a \mathrm{e}^{x}$ has three distinct real roots, then the range of the real number $a$ is $\qquad$
5. $\left(0,4 \mathrm{e}^{-2}\right)$.

Let $f(x)=x^{2} \mathrm{e}^{-x}$. Then
$$
f^{\prime}(x)=\left(2 x-x^{2}\right) \mathrm{e}^{-x} \text {. }
$$

When $x \leqslant 0$, $f(x)$ is monotonically decreasing, $f(0)=0$;
When $0 \leqslant x \leqslant 2$, $f(x)$ is monotonically increasing, $f(2)=$ $4 e^{-2}$
When $x \geqslant 2$, $f(x)$ is monotonically decreasing;
When $x \rightarrow+\infty$, $f(x) \rightarrow 0$.
Therefore, $f(x)=a$ has three distinct real roots if and only if $0<a<4 \mathrm{e}^{-2}$.