4. $f(x)=\frac{x^{2}}{8}+x \cos x+\cos (2 x)(x \in \mathbf{R})$'s minimum value is $\qquad$ .
4. -1 .
$$
\begin{array}{l}
f(x)=\frac{x^{2}}{8}+x \cos x+2 \cos ^{2} x-1 \\
=\frac{1}{8}(x+4 \cos x)^{2}-1 \geqslant-1 .
\end{array}
$$

Since the equation $\cos x=-\frac{x}{4}$ (as can be seen from the graph) has a solution, we have
$$
f(x)_{\min }=-1
$$