Find the range of real number $a$ such that for any real number $x$ and any $\theta \in[0$, $\frac{\pi}{2}$ ], the following inequality always holds:
$$
(x+3+2 \sin \theta \cos \theta)^{2}+(x+a \sin \theta+a \cos \theta)^{2} \geqslant \frac{1}{8} .
$$
II. It is known that the original inequality $\Leftrightarrow(3+2 \sin \theta \cos \theta-a \sin \theta-a \cos \theta)^{2} \geqslant \frac{1}{4}$, for any
$$
\theta \in\left[0, \frac{\pi}{2}\right],
$$

From (1), we get $a \geqslant \frac{3+2 \sin \theta \cos \theta+\frac{1}{2}}{\sin \theta+\cos \theta}$, for any $\theta \in\left[0, \frac{\pi}{2}\right]$,
or, $a \geqslant \frac{3+2 \sin \theta \cos \theta-\frac{1}{2}}{\sin \theta+\cos \theta}$, for any $\theta \in\left[0, \frac{\pi}{2}\right]$,
Under condition (2), since $\theta \in\left[0, \frac{\pi}{2}\right]$, $1 \leqslant \sin \theta+\cos \theta \leqslant \sqrt{2}$,
$$
\frac{3+2 \sin \theta \cos \theta+\frac{1}{2}}{\sin \theta+\cos \theta}=(\sin \theta+\cos \theta)+\frac{5}{2} \cdot \frac{1}{\sin \theta+\cos \theta} .
$$

Clearly, when $1 \leqslant x \leqslant \sqrt{2}$, $f(x)=x+\frac{5}{2} \cdot \frac{1}{x}$ is a decreasing function, thus
$$
\max _{\theta \in\left[0, \frac{\pi}{2}\right]} \frac{3+2 \sin \theta \cos \theta+\frac{1}{2}}{\sin \theta+\cos \theta}=\max _{1 \leqslant x \leqslant \sqrt{2}} f(x)=1+\frac{5}{2}=\frac{7}{2} .
$$

Therefore, we have
$$
a \geqslant \frac{7}{2} \text {. }
$$

Under condition (3), since
$$
\begin{aligned}
\frac{3+2 \sin \theta \cos \theta-\frac{1}{2}}{\sin \theta+\cos \theta} & =(\sin \theta+\cos \theta)+\frac{3}{2} \cdot \frac{1}{\sin \theta+\cos \theta} \\
& \geqslant 2 \sqrt{\frac{3}{2}}=\sqrt{6},
\end{aligned}
$$

and the equality holds when $\sin \theta+\cos \theta=\frac{\sqrt{6}}{2}$, thus $\min _{0 \leqslant \theta \leqslant \frac{\pi}{2}} \frac{3+2 \sin \theta \cos \theta-\frac{1}{2}}{\sin \theta+\cos \theta}=\sqrt{6}$. Therefore, $a \leqslant \sqrt{6}$.
In summary, we have $a \geqslant \frac{7}{2}$ or $a \leqslant \sqrt{6}$, which is the required result.