Trigonometric Integrals
Open any door with a wave behind it and you will find powers of \sin
and \cos waiting to be integrated. The power delivered by the mains
socket in your wall goes as \sin^2(\omega t) — averaging it over a
cycle is a trig integral. Every Fourier coefficient — the numbers that let a phone compress
music — is an integral of a product like f(x)\cos nx. Orbital
mechanics, alternating current, the vibrating string: all of them keep handing you integrals
such as
\int \sin^3 x\, dx, \qquad \int \cos^2 x\, dx, \qquad \int \sin^2 x \cos^3 x\, dx.
They look forbidding — you cannot antidifferentiate \sin^3 x by
staring at it — but a remarkably small kit cracks the whole family. Just two ideas, both
leaning on
substitution
and the Pythagorean identity \sin^2 x + \cos^2 x = 1:
-
An odd power? Peel off one factor to be the
du, convert the (now even) rest with
\sin^2 = 1 - \cos^2 (or vice versa), and substitute. The trig
integral collapses into a polynomial.
-
Only even powers? There is no factor to peel — so lower the powers first
with the power-reduction (half-angle) identities, then integrate term by term.
That's the entire strategy. Everything below is those two moves, practised until they are
reflexes.
Odd power, peel and substitute: \displaystyle\int \sin^3 x\, dx
The exponent 3 is odd — that is our cue. An odd power always has a
"spare" factor we can donate to the dx, leaving an even
power behind, and even powers of sine convert perfectly into cosines.
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
(mind that minus sign — it is the classic slip):
\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. This is the
payoff: the trig has vanished and only a polynomial remains.
-\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.
Sanity check (always worth ten seconds): differentiate the answer. You get
\sin x - \cos^2 x \sin x = \sin x\,(1 - \cos^2 x) = \sin^3 x. It
works.
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 of cosine attached to the
wrong du. Instead, halve the power: the double-angle formula
\cos 2x = 2\cos^2 x - 1, solved for
\cos^2 x, trades a squared cosine for a plain
cosine of twice the angle. Squares are hard to integrate; plain cosines are easy.
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.
Notice the shape of the answer: a ramp x/2 plus a small
wiggle. That ramp is no accident — it says the average value of
\cos^2 x is exactly \tfrac12, a fact your
electricity supplier quietly relies on (see the vignette below).
Asked for \int \cos^2 x\, dx, a huge fraction of students write
\int \cos^2 x\, dx \;\ne\; \frac{\cos^3 x}{3} + C.
This is the power rule \int x^n dx = \tfrac{x^{n+1}}{n+1} applied
where it has no business: that rule is for powers of the variable itself, not powers
of a function of it. Differentiate the "answer" and the chain rule exposes the crime:
\frac{d}{dx}\left[\frac{\cos^3 x}{3}\right] = \cos^2 x \cdot (-\sin x) \;\ne\; \cos^2 x.
That stray -\sin x from the chain rule is exactly why even powers
must go through the identity, not the power rule. (The power rule is legal
after a substitution — that is the whole point of the odd-power trick: peel off the factor
that supplies the du, and only then is the integrand a genuine
power of u.)
Second trap — the sign of du. With
u = \cos x you get du = -\sin x\, dx:
the minus sign flips every sign downstream, and dropping it produces an answer that
is exactly wrong (its derivative is -\sin^3 x). With
u = \sin x there is no minus:
du = \cos x\, dx. Cheap insurance either way: differentiate your
final answer before moving on.
Mixed powers: \displaystyle\int \sin^2 x \cos^3 x\, dx
Products \sin^m x \cos^n x follow the same logic — you only need
one odd exponent to unlock the peel. Here \sin^2 is even
but \cos^3 is odd, so cosine donates the spare factor and
sine becomes the substitution variable.
Step 1 — peel one \cos x off the odd power:
\sin^2 x \cos^3 x = \sin^2 x \cos^2 x \cdot \cos x.
Step 2 — convert the leftover even power of cosine to sines with
\cos^2 x = 1 - \sin^2 x:
\int \sin^2 x \cos^3 x\, dx = \int \sin^2 x\,\big(1 - \sin^2 x\big)\cos x\, dx.
Step 3 — substitute u = \sin x, so
du = \cos x\, dx (no minus sign this time — the lone
\cos x is swallowed whole):
\int u^2 (1 - u^2)\, du = \int \big(u^2 - u^4\big)\, du = \frac{u^3}{3} - \frac{u^5}{5} + C.
Step 4 — back-substitute:
\int \sin^2 x \cos^3 x\, dx = \frac{\sin^3 x}{3} - \frac{\sin^5 x}{5} + C.
If both exponents are even — say \int \sin^2 x \cos^2 x\, dx
— no peeling is possible; power-reduce both factors (or spot
\sin x\cos x = \tfrac12 \sin 2x, square it, then power-reduce once
more). Every route ends in plain cosines of multiple angles, which integrate on sight.
To evaluate \displaystyle\int \sin^m x\, \cos^n x\, dx:
-
If m (the power of sine) is odd: save one
\sin x, rewrite the rest with
\sin^2 x = 1 - \cos^2 x, and substitute
u = \cos x (so du = -\sin x\,dx).
-
If n (the power of cosine) is odd: save one
\cos x, rewrite with
\cos^2 x = 1 - \sin^2 x, and substitute
u = \sin x (so du = \cos x\,dx).
-
If both are even: lower the powers with the power-reduction identities
\sin^2 x = \tfrac{1 - \cos 2x}{2} and
\cos^2 x = \tfrac{1 + \cos 2x}{2}, then integrate term by term
(repeat if squares survive).
-
For \displaystyle\int \sec^m x \tan^n x\, dx:
if the power of secant is even, save a \sec^2 x and substitute
u = \tan x; if the power of tangent is odd, save a
\sec x \tan x and substitute u = \sec x
— using \sec^2 x = 1 + \tan^2 x to convert the rest.
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.
This identity stumped mathematicians for decades: it was first stated (as a conjecture about
the Mercator map projection!) around 1645, and proved only in 1668. Cartographers needed the
integral of the secant to space the latitude lines on nautical charts — a trig integral that
quite literally helped sailors find their way.
Why your 230 V mains isn't really 230 V
Here is the single most-used trig integral in the world, hidden in every wall socket. Mains
voltage is a sine wave, V(t) = V_0 \sin \omega t, and the power it
delivers to a heater goes as the square,
P \propto V_0^2 \sin^2 \omega t. What matters for your electricity
bill is the average power over a cycle — and averaging
\sin^2 is exactly our even-power integral:
\frac{1}{2\pi}\int_0^{2\pi} \sin^2 t\, dt = \frac{1}{2\pi}\left[\frac{t}{2} - \frac{\sin 2t}{4}\right]_0^{2\pi} = \frac{1}{2\pi}\cdot\pi = \frac{1}{2}.
The average of \sin^2 (and of \cos^2)
over a full cycle is exactly \tfrac12. So a sine wave delivers half
the power of a steady voltage at the peak value — which is why engineers quote the
root-mean-square voltage V_{\text{rms}} = V_0/\sqrt{2}: the
steady voltage that would heat your toaster equally. European "230 V" mains is the RMS figure;
the actual peaks swing to V_0 = 230\sqrt{2} \approx 325 volts,
about a hundred times a second. That \tfrac12 — the ramp
x/2 in \int \cos^2 x\, dx — is baked
into every power rating you own.
Push the same toolkit one step further and something miraculous appears. Product-to-sum
identities turn \sin mx \sin nx into cosines of
(m-n)x and (m+n)x, and integrating
over a full period gives, for whole numbers m \ne n:
\int_0^{2\pi} \sin mx \,\sin nx \; dx = 0, \qquad \int_0^{2\pi} \sin^2 nx \; dx = \pi.
Different frequencies integrate against each other to zero — they are
"orthogonal", perpendicular in the same sense as the axes of a graph — while each frequency
against itself gives \pi. This means you can take a messy
periodic signal, multiply it by \sin nx, integrate, and the
integral picks out exactly how much of frequency n the signal
contains — every other frequency silently cancels. That one trick is the engine of
Fourier series,
and through them MP3 audio, JPEG images, and the maths of heat flow. It all rests on the
humble integrals on this page.
See it: a trig integrand and its antiderivative
Switch between the three integrals we worked above: \sin^3 x
(odd-power case), \cos^2 x (even-power case), and the mixed
\sin^2 x \cos^3 x. The faint curve is the integrand; the bold curve
is the antiderivative we derived. The bold curve's slope equals the faint curve's height
everywhere — confirming each antiderivative.
Two things worth spotting. The antiderivative of \cos^2 x
climbs, wobbling about the line y = x/2 — the graph of the
"average value \tfrac12" fact: a positive integrand accumulates
area at an average rate of \tfrac12 per unit. The other two
antiderivatives stay bounded, because their integrands spend as much time below the axis as
above it, and the accumulated area keeps cancelling.