Example 11 (1996 National High School League Question) Find the range of real numbers $a$ such that for any real number $x$ and any $\theta \in\left[0, \frac{\pi}{2}\right]$, we have $(x+3+2 \sin \theta \cos \theta)^{2}+(x+a \sin \theta+a \cos \theta)^{2} \geqslant \frac{1}{8}$.


It is known that the original problem is equivalent to
$$
a \geqslant \frac{3+2 \sin \theta \cos \theta+\frac{1}{2}}{\sin \theta+\cos \theta}, \theta \in\left[0, \frac{\pi}{2}\right] \text { or } a \leqslant \frac{3+2 \sin \theta \cos \theta-\frac{1}{2}}{\sin \theta+\cos \theta}, \theta \in\left[0, \frac{\pi}{2}\right] \text {. }
$$

Let $\sin \theta+\cos \theta=t$, then $1 \leqslant t \leqslant \sqrt{2}, \sin \theta \cos \theta=\frac{t^{2}-1}{2}$, then the above two expressions can be transformed into:
$$
a \geqslant t+\frac{5}{2} \cdot \frac{1}{t}=f(t)(1 \leqslant t \leqslant \sqrt{2}) \text { and } a \leqslant t+\frac{3}{2} \cdot \frac{1}{t}=g(t)(1 \leqslant t \leqslant \sqrt{2}) \text {. }
$$

Let $f^{\prime}(t)=1-\frac{5}{2} \cdot \frac{1}{t^{2}}=0$, we get the critical point $t=\frac{\sqrt{10}}{2} \notin[1, \sqrt{2}]$. We only need to calculate $f(1)=\frac{7}{2}$, $f(\sqrt{2})=\frac{9 \sqrt{2}}{4}$, so $f(t)_{\max }=\frac{7}{2}$. Thus, $a \geqslant \frac{7}{2}$. Let $g^{\prime}(t)=1-\frac{3}{2} \cdot \frac{1}{t^{2}}=0$, we get the critical point $t=\frac{\sqrt{6}}{2} \in$ $[1, \sqrt{2}]$. Calculate $g\left(\frac{\sqrt{6}}{2}\right)=\sqrt{6}, g(1)=\frac{5}{2}, g(\sqrt{2})=\frac{7 \sqrt{2}}{4}$, so $g(t)_{\min }=\sqrt{6}$, thus $a \leqslant \sqrt{6}$. Therefore, $a \geqslant \frac{7}{2}$ or $a \leqslant \sqrt{6}$.