2. The minimum value of the function $f(x)=\sin \left(x+\frac{\pi}{6}\right)+\sin \left(x-\frac{\pi}{6}\right)-\cos x+$ is $\qquad$ .
Solution: $f(x)=\sin \left(x+\frac{\pi}{6}\right)+\sin \left(x-\frac{\pi}{6}\right)-\cos x+3$
$$
\begin{array}{l}
=2 \sin x \cos \frac{\pi}{6}-\cos x+3 \\
=\sqrt{3} \sin x-\cos x+3 \\
=2 \sin \left(x-\frac{\pi}{6}\right)+3 \\
\geq 1,
\end{array}
$$

When $x=-\frac{\pi}{3}+2 k \pi, k \in Z$, the equality holds,
that is, the minimum value of the function $f(x)=\sin \left(x+\frac{\pi}{6}\right)+\sin \left(x-\frac{\pi}{6}\right)-\cos x+3$ is.