Example 4. Find the integral $\int \cos ^{2} x \sin x d x$.
Solution. Let $\cos x=u$, then

$$
-\sin x d x=d u, \sin x d x=-d u
$$

Thus,

$$
\begin{gathered}
\int \cos ^{2} x \sin x d x=\int u^{2}(-d u)=-\int u^{2} d u=-\frac{u^{3}}{3}+C= \\
=-\frac{\cos ^{3} x}{3}+C
\end{gathered}
$$

The same result can be obtained directly (see § 4.2):

$$
\begin{gathered}
\int \cos ^{2} x \sin x d x=\int \cos ^{2} x d(-\cos x)=-\int \cos ^{2} x d(\cos x)= \\
=-\frac{\cos ^{3} x}{3}+C
\end{gathered}
$$