2. The function
$$
f(x)=4 \sin ^{3} x-\sin x+2\left(\sin \frac{x}{2}-\cos \frac{x}{2}\right)^{2}
$$

has the smallest positive period of ( ).
(A) $2 \pi$
(B) $\frac{\pi}{2}$
(C) $\frac{2 \pi}{3}$
(D) $\pi$
2. C.

Simplifying, we get $f(x)=-\sin 3 x+2$. Then, the smallest positive period of the function $f(x)$ is $\frac{2 \pi}{3}$.