15. The inequality $\sin ^{2} x+a \cos x+a^{2} \geqslant 1+\cos x$ holds for all $x \in \mathbf{R}$, find the range of real number $a$.

保留源文本的换行和格式，翻译结果如下：

15. The inequality $\sin ^{2} x+a \cos x+a^{2} \geqslant 1+\cos x$ holds for all $x \in \mathbf{R}$, find the range of real number $a$.

---

Note: The translation is provided as requested, with the format and line breaks preserved.
15. The original inequality is transformed into $\cos ^{2}+(1-a) \cos x-a^{2} \leqslant 0$. Let $\cos x=t, t \in[-1,1] . f(t)=t^{2}+(1-a) t-a^{2}$. Then $\left\{\begin{array}{l}f(1) \leqslant 0 \\ f(-1) \leqslant 0\end{array} \Leftrightarrow\left\{\begin{array}{l}2-(1-a)^{2} \leqslant 0 \\ a-a^{2} \leqslant 0\end{array} \Rightarrow a \geqslant 1\right.\right.$ or $a \leqslant-2$.