Example 4. Find the integral $\int \cos ^{5} x d x$.
Solution. In this case $n=0, m=5$. We separate the first-degree factor and express $\cos ^{2} x$ in terms of $\sin ^{2} x$:

$$
\cos ^{5} x=\cos ^{4} x \cos x=\left(\cos ^{2} x\right)^{2} \cos x=\left(1-\sin ^{2} x\right)^{2} \cos x
$$

Introducing a new variable $t$ by the formula $\sin x=t$, we get

$$
\begin{gathered}
\int \cos ^{5} x d x=\int\left(1-\sin ^{2} x\right)^{2} \cos x d x=\int\left(1-t^{2}\right)^{2} d t= \\
=\int\left(1-2 t^{2}+t^{4}\right) d t=\int d t-2 \int t^{2} d t+\int t^{4} d t=t-\frac{2}{3} t^{3}+\frac{t^{5}}{5}+C
\end{gathered}
$$

Returning to the original variable $x$, we find

$$
\int \cos ^{5} x d x=\sin x-\frac{2}{3} \sin ^{3} x+\frac{1}{5} \sin ^{5} x+C
$$