integrating powers of trigonometric functions
How do you integrate sin^5(x), or sin^2(x) cos^4(x), or tan^3(x) sec^4(x)? There is no single formula, but there is a small set of reliable maneuvers that turn any product of powers of trig functions into something you can integrate by substitution. The strategy depends only on whether the exponents are odd or even.
For sines and cosines: if either power is odd, peel off one factor to pair with dx and convert the rest using sin^2 + cos^2 = 1, so that the substitution u = sin(x) or u = cos(x) finishes it. If both powers are even, you cannot do that, so you grind the exponents down with the half-angle (power-reduction) identities sin^2 = (1 - cos 2x)/2 and cos^2 = (1 + cos 2x)/2, repeating until everything is linear in a cosine. For secants and tangents the parallel tricks use 1 + tan^2 = sec^2 and the fact that the derivative of tan is sec^2 and the derivative of sec is sec tan, so you save the right factor to become du.
These integrals are the everyday bread of Fourier analysis, where you compute the coefficients of a Fourier series by integrating a signal against sin(nx) and cos(nx), and the orthogonality of the trig system is exactly a statement that many of these products integrate to zero over a period. The Weierstrass substitution is the universal fallback when the case analysis gets ugly, and reduction formulas package the even-even grind into a single recursive rule.
integral of sin^3(x) dx: write sin^3 = sin(x)(1 - cos^2 x), set u = cos(x), du = -sin(x) dx, giving the integral of -(1 - u^2) du = -u + u^3/3 = -cos(x) + cos^3(x)/3 + C.
An odd power lets you split off one factor for du and rewrite the rest in the other function.
The even-even case has no odd factor to grab, so substitution alone fails — you must lower the powers with half-angle identities first. Skipping that step is the most common dead end here.