To evaluate ∫cosmxsinnxdx when at least one of m,n is odd:
If m is odd, factor out cosx to obtain ∫cosm−1xsinnxcosxdx. If n is odd, factor out sinx to obtain ∫cosmxsinn−1xsinxdx.
The leftover power is even. Replace it using sin2x+cos2x=1.
Substitute u=sinx or u=cosx. The binomial expansion (a+b)k is usually needed before the powers of u can be integrated.
Always peel from an odd power. Peeling from an even power leaves an odd remainder, which 1=sin2x+cos2x cannot turn into a polynomial in the substitution variable. If both m and n are odd, either factor works, although the two antiderivatives need not look the same.
To evaluate ∫cosmxsinnxdx when both m and n are even, use
cos2α=21+cos2α,sin2α=21−cos2α
to rewrite the integrand as a sum of integrals of the form ∫cosk(2x)dx. Integrate any odd k by the odd-power substitution in 2x; apply the double-angle identities again to any remaining even k.
After expanding, the constant and cos2x terms integrate immediately. Because the argument is 2x, the odd-power substitution is u=sin2x, with du=2cos2xdx.
If n is a positive even integer, factor out sec2x and substitute u=tanx. Convert remaining powers of sec by 1+tan2x=sec2x.
If n=0, use tan2x=sec2x−1 to lower the power of tan by two, with ∫dx and ∫tanxdx as base cases.
If n is odd:
If m is odd, factor out tanxsecx and substitute u=secx. Convert remaining powers of tan by tan2x=sec2x−1.
If m is even, write tanmx=(sec2x−1)m/2 and expand into powers of secx. Reduce odd secant powers by parts until only ∫secxdx remains.
The first rule needs n even: factoring out sec2x when n is odd leaves an unmatched secx, so u=tanx does not absorb the whole integrand.
For the odd secant powers Sℓ=∫secℓxdx, the integration by parts used below for S3 gives the reduction formula
Sℓ=ℓ−1secℓ−2xtanx+ℓ−1ℓ−2Sℓ−2,ℓ≥3.
To derive it, split secℓx=secℓ−2xsec2x to get Sℓ=secℓ−2xtanx−(ℓ−2)∫secℓ−2xtan2xdx, substitute tan2x=sec2x−1 and collect the resulting copy of Sℓ. Stop at S1=ln∣secx+tanx∣ and add one arbitrary constant at the end.