Trigonometric Integrals

Integrals of powers and products of \sin and \cos (and later \sec, \tan) look forbidding, but two simple ideas crack almost all of them. Both lean on substitution and the Pythagorean identity \sin^2 x + \cos^2 x = 1.

Odd power, peel and substitute: \displaystyle\int \sin^3 x\, dx

Step 1 — peel one \sin x off the odd power. Keep a single \sin x aside (it will become du), leaving an even power:

\sin^3 x = \sin^2 x \cdot \sin x.

Step 2 — convert the even part to cosines. Use \sin^2 x = 1 - \cos^2 x, so everything but the lone \sin x is in \cos x:

\int \sin^3 x\, dx = \int \big(1 - \cos^2 x\big)\sin x\, dx.

Step 3 — substitute u = \cos x. Then du = -\sin x\, dx, so \sin x\, dx = -du:

\int \big(1 - \cos^2 x\big)\sin x\, dx = \int (1 - u^2)(-du) = -\int (1 - u^2)\, du.

Step 4 — integrate the polynomial in u.

-\int (1 - u^2)\, du = -\left(u - \frac{u^3}{3}\right) + C = -u + \frac{u^3}{3} + C.

Step 5 — back-substitute u = \cos x.

\int \sin^3 x\, dx = -\cos x + \frac{\cos^3 x}{3} + C.

Even power, reduce first: \displaystyle\int \cos^2 x\, dx

Here there is nothing to peel — \cos^2 x is even, and pulling out a \cos x would leave an awkward odd power. Instead, halve the power.

Step 1 — apply the power-reduction identity.

\cos^2 x = \frac{1 + \cos 2x}{2}.

Step 2 — substitute it into the integral. The integrand is now a sum of things we can integrate directly:

\int \cos^2 x\, dx = \int \frac{1 + \cos 2x}{2}\, dx = \frac{1}{2}\int 1\, dx + \frac{1}{2}\int \cos 2x\, dx.

Step 3 — integrate each piece. The first is x; for the second, \int \cos 2x\, dx = \tfrac{1}{2}\sin 2x (a tiny substitution u = 2x):

\frac{1}{2}\int 1\, dx + \frac{1}{2}\int \cos 2x\, dx = \frac{x}{2} + \frac{1}{2}\cdot\frac{\sin 2x}{2}.

Step 4 — collect.

\int \cos^2 x\, dx = \frac{x}{2} + \frac{\sin 2x}{4} + C.

To evaluate \displaystyle\int \sin^m x\, \cos^n x\, dx:

The identities that do all the work:

\sin^2 x + \cos^2 x = 1, \qquad \sin^2 x = \frac{1 - \cos 2x}{2}, \qquad \cos^2 x = \frac{1 + \cos 2x}{2}.

For the secant/tangent family, the Pythagorean identity in its other guise is the key:

\sec^2 x = 1 + \tan^2 x, \qquad \frac{d}{dx}\tan x = \sec^2 x, \qquad \frac{d}{dx}\sec x = \sec x \tan x.

The famous \int \sec x\, dx trick. Multiply and divide by \sec x + \tan x:

\int \sec x\, dx = \int \sec x \cdot \frac{\sec x + \tan x}{\sec x + \tan x}\, dx = \int \frac{\sec^2 x + \sec x \tan x}{\sec x + \tan x}\, dx.

The numerator is exactly the derivative of the denominator, so the substitution u = \sec x + \tan x turns it into \int \tfrac{du}{u} = \ln|u|:

\int \sec x\, dx = \ln\big|\sec x + \tan x\big| + C.

See it: a trig integrand and its antiderivative

Switch between the integrand \sin^3 x (odd-power case) and \cos^2 x (even-power case). The faint curve is the integrand; the bold curve is the antiderivative we derived above. The bold curve's slope equals the faint curve's height everywhere — confirming the antiderivative.