2. For the equation $\sin ^{2} x+\cos x+a=0$ to have solutions in the real number range, the range of the real number $a$ is
A. $\left[-\frac{5}{4}, 1\right]$
B. $[-1,1]$
C. $\left[-\frac{5}{4}, \frac{5}{4}\right]$
D. $\left[-1, \frac{5}{4}\right]$
$$
\begin{array}{l}
-a=\sin ^{2} x+\cos x=-\cos ^{2} x+\cos x+1 \Rightarrow a=\cos ^{2} x-\cos x-1 \\
=\left(\cos x-\frac{1}{2}\right)^{2}-\frac{5}{4} \in\left[-\frac{5}{4}, 1\right], \text { so choose } A .
\end{array}
$$