5. Let $f(x)=x^{2}-2 a x+2$, when $x \in[-1,+\infty)$, the inequality $f(x) \geqslant a$ always holds, the range of real number $a$ is $\qquad$ .
5. $-3 \leqslant a \leqslant 1$.
$f(x)=(x-a)^{2}+2-a^{2}$, when $a<-1$, $f_{\text {min }}=f(-1)=3+2 a$; when $a \geqslant-1$, $f_{\text {min }}=$ $f(a)=2-a^{2}$, to make $a \leqslant f(x)$ always hold, then $\left\{\begin{array}{l}a<-1 \\ a \leqslant 3+2 a\end{array}\right.$ or $\left\{\begin{array}{l}a \geqslant-1 \\ a \leqslant 2-a^{2},\end{array}\right.$ we get $-3 \leqslant a \leqslant 1$.