4. Let the function $f(x)=\sin ^{5} x+1$. Then the value of $\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} f(x) \mathrm{d} x$ is ( ).
(A) $\frac{1}{6}+\frac{\pi}{2}$
(B) 0
(C) 1
(D) $\pi$
4. D.

From $y=\sin ^{5} x$ being an odd function, we know
$$
\begin{array}{l}
\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} f(x) \mathrm{d} x=\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \sin ^{5} x \mathrm{~d} x+\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} 1 \mathrm{~d} x \\
=0+\left.x\right|_{-\frac{\pi}{2}} ^{\frac{\pi}{2}}=\pi
\end{array}
$$