(2) The maximum value of the function $y=\cos ^{3} x+\sin ^{2} x-\cos x(x \in \mathbf{R})$ is ( ).
(A) $\frac{4}{27}$
(B) $\frac{8}{27}$
(C) $\frac{16}{27}$
(D) $\frac{32}{27}$
(2) Method 1: Since
$$
\begin{aligned}
y & =\sin ^{2} x-\cos x\left(1-\cos ^{2} x\right) \\
& =\sin ^{2} x(1-\cos x) \\
& =2 \sin ^{2} x \sin ^{2} \frac{x}{2} \\
& =8 \sin ^{4} \frac{x}{2} \cos ^{2} \frac{x}{2} \\
& =4 \sin ^{2} \frac{x}{2} \cdot \sin ^{2} \frac{x}{2} \cdot 2 \cos ^{2} \frac{x}{2} \\
& \leqslant 4\left(\frac{\sin ^{2} \frac{x}{2}+\sin ^{2} \frac{x}{2}+2 \cos ^{2} \frac{x}{2}}{3}\right)^{3} \\
& =\frac{32}{27},
\end{aligned}
$$

When and only when $\sin ^{2} \frac{x}{2}=2 \cos ^{2} \frac{x}{2}$, i.e., $\tan \frac{x}{2}= \pm \sqrt{2}$, $y$ achieves its maximum value $\frac{32}{27}$. Therefore, the answer is D.
Method 2: Let $t=\cos x(-1 \leqslant t \leqslant 1)$, then $y=t^{3}-t^{2}-t+1$. The maximum value can be found using the derivative method.