Example 4. Calculate the double integral $I=\iint_{D} y^{2} \sin x d x d y$, where $D$ is the region bounded by the lines $x=0, x=\pi, y=0, y=1+\cos x$.
Solution. The region $D$ is described by the system of inequalities

$$
\left\{\begin{array}{l}
0 \leqslant x \leqslant \pi \\
0 \leqslant y \leqslant 1+\cos x
\end{array}\right.
$$

Therefore, the given double integral can be written as an iterated integral:

$$
\begin{aligned}
I=\int_{0}^{\pi} \sin x d x \int_{0}^{1+\cos x} y^{2} d y=\frac{1}{3} \int_{0}^{\pi}(1+\cos x)^{3} \cdot \sin x d x & \\
= & -\left.\frac{1}{12}(1+\cos x)^{4}\right|_{0} ^{\pi}=\frac{4}{3}
\end{aligned}
$$

## Answer. $\frac{4}{3}$.