8 If for all $\theta \in \mathbf{R}$, the modulus of the complex number $z=(a+\cos \theta)+(2 a-\sin \theta) \mathrm{i}$ does not exceed 2, then the range of the real number $a$ is $\qquad$.
Solve According to the problem, we get
$$
\begin{aligned}
|z| \leqslant 2 & \Leftrightarrow(a+\cos \theta)^{2}+(2 a-\sin \theta)^{2} \leqslant 4 \\
& \Leftrightarrow 2 a(\cos \theta-2 \sin \theta) \leqslant 3-5 a^{2} \\
& \Leftrightarrow-2 \sqrt{5} a \sin (\theta-\varphi) \leqslant 3-5 a^{2}\left(\varphi=\arcsin \frac{1}{\sqrt{5}}\right) \text { (for any }
\end{aligned}
$$

real number $\theta$)
$$
\Rightarrow 2 \sqrt{5}|a| \leqslant 3-5 a^{2} \Rightarrow|a| \leqslant \frac{\sqrt{5}}{5} \text {. }
$$

Therefore, the range of $a$ is $\left[-\frac{\sqrt{5}}{5}, \frac{\sqrt{5}}{5}\right]$.