Powers of sinus and cosinus are integrated in the following way:

1. Odd powers

Expanding the binomial $(1-\cos^2(x))^n$ results in several integrals of the form

all of which are solvable with the change of variable $t=\cos x$, $\mathrm{d}t=-\sin x \,\mathrm{d}x$.

The integral

is solved in an analogous manner

2. Even powers

and after expanding the binomial, the integrand is expressed in terms of lower powers of $\cos$; this way we may proceed iterating until everything is integrated