Trigonometric integrals
The basic table integrates \sin x and \sec^2 x, but not \sin^3 x\cos^4 x or \tan^4 x\sec^4 x. Which identity turns a product of trig powers into something substitution can finish?
Where you are 16 in Integrals
When you reach for it
Antiderivatives of trig, exponential and log functions integrates a single trig function, and substitution integrates \sin^4 x\cos x because the factor \cos x is the derivative of the inside. Most products of trig powers have no such factor in plain view. In \sin^3 x\cos^4 x, \sin^4 x\cos^2 x or \tan^4 x\sec^4 x, the integrand must first be rewritten, using an identity, until one factor is the derivative of a function and everything else is a function of that same function.
You reach for these rewrites whenever the integrand is a product of powers of sine and cosine, a product of sines and cosines at different frequencies, or a product of powers of tangent and secant (cotangent and cosecant behave like tangent and secant). They also finish every integral produced by Trigonometric substitution, which turns a square root into exactly these products.
The procedure
Day 1: sine and cosine
Three facts do all the work. The Pythagorean identity \sin^2 x + \cos^2 x = 1 (The Pythagorean identities) trades an even power of one function for a polynomial in the other. The derivatives \displaystyle \frac{d}{dx}\sin x = \cos x and \displaystyle \frac{d}{dx}\cos x = -\sin x supply the du. The Power reducing and half angle formulas \displaystyle \sin^2 x = \frac{1 - \cos 2x}{2} and \displaystyle \cos^2 x = \frac{1 + \cos 2x}{2} halve a power by doubling the angle.
An odd power of sine. In \int \sin^m x\cos^n x\,dx with m odd, write m = 2k + 1 and set one factor \sin x aside:
Everything except the last factor is a function of \cos x, and \sin x\,dx = -du for u = \cos x. The integral becomes -\int (1 - u^2)^k u^n\,du, a polynomial when n is a whole number. The power n plays no part in the rewrite, so it may be even, odd, zero or a fraction. The reason one factor must be set aside, and only one, is that du needs exactly one \sin x, and what remains must be an even power so that \sin^2 x = 1 - \cos^2 x can be applied to it.
An odd power of cosine. The same move with the roles swapped: set one \cos x aside, convert the even power \cos^{2k} x = (1 - \sin^2 x)^k, and put u = \sin x. If both powers are odd, either choice works; the answers differ by a constant.
Both powers even. Now the move fails. Setting one \sin x aside leaves an odd power of sine, and an odd power of sine is not a polynomial in \cos x: \displaystyle \sin x = \pm\sqrt{1 - \cos^2 x}. Instead, lower the powers. Each power reducing formula replaces a square by a first power of \cos 2x; after expanding, a term with an even power of \cos 2x is reduced again, and a term with an odd power falls to the odd-power method. Each round halves the highest power, so the process ends. The shortcut \displaystyle \sin x\cos x = \frac{1}{2}\sin 2x from the Double angle formulas often saves a round.
Different frequencies. A product such as \sin 3x\cos 5x is not a power at all. The Product to sum and sum to product formulas turn it into a sum of single sines or cosines, each in the table:
Day 2: tangent and secant
The facts now are \displaystyle \frac{d}{dx}\tan x = \sec^2 x, \displaystyle \frac{d}{dx}\sec x = \sec x\tan x, and 1 + \tan^2 x = \sec^2 x, the Pythagorean identity divided by \cos^2 x. Two antiderivatives finish the leftovers:
The first is in Antiderivatives of trig, exponential and log functions. The second is checked by differentiating: the derivative of \ln\lvert \sec x + \tan x \rvert is \dfrac{\sec x\tan x + \sec^2 x}{\sec x + \tan x} = \sec x.
An even power of secant, n = 2k \ge 2. Set \sec^2 x aside for du, with u = \tan x, and convert the rest: \sec^{2k-2} x = (1 + \tan^2 x)^{k-1}. Then \int \tan^m x\sec^n x\,dx = \int u^m(1 + u^2)^{k-1}\,du, for any power m.
An odd power of tangent with at least one secant, m = 2k + 1, n \ge 1. Set \sec x\tan x aside for du, with u = \sec x, and convert the rest: \tan^{2k} x = (\sec^2 x - 1)^k. Then \int \tan^m x\sec^n x\,dx = \int (u^2 - 1)^k u^{n-1}\,du.
The reason is the same as on Day 1: the factor set aside is a derivative, and the even power left behind is what the identity can convert. When both conditions hold, either route works.
Tangent alone. \int \tan^m x\,dx has no secant to set aside. Write \tan^m x = \tan^{m-2} x\sec^2 x - \tan^{m-2} x. The first piece integrates to \displaystyle \frac{\tan^{m-1} x}{m - 1} by u = \tan x, and the second is the same problem with a power two lower, so repeating ends at \int \tan x\,dx or \int dx.
In every case the factor set aside is du:
| Case | u | Identity |
|---|---|---|
| sine power odd | \cos x | \sin^2 x = 1 - \cos^2 x |
| cosine power odd | \sin x | \cos^2 x = 1 - \sin^2 x |
| both even | none | power reducing |
| secant power even | \tan x | \sec^2 x = 1 + \tan^2 x |
| tangent power odd | \sec x | \tan^2 x = \sec^2 x - 1 |
Worked examples
Day 1: an odd power of sine
Find \int \sin^3 x\cos^4 x\,dx.
SolutionThe power of sine is odd, so one \sin x is set aside and \sin^2 x = 1 - \cos^2 x converts the rest:
With u = \cos x, du = -\sin x\,dx, so \sin x\,dx = -du:
Check by the chain rule: the derivative is -\cos^6 x\sin x + \cos^4 x\sin x, which factors as \sin x\cos^4 x\left(1 - \cos^2 x\right), that is, \sin^3 x\cos^4 x. Setting a \cos x aside instead would leave \cos^3 x, an odd power, which is not a polynomial in \sin x; the odd power decides the route.
Day 1: both powers even
Find \int_0^{\pi} \sin^4 x\cos^2 x\,dx.
SolutionBoth powers are even, so no single factor can be set aside. Lower the powers, saving a round with the double-angle shortcut: \displaystyle \sin^2 x\cos^2 x = (\sin x\cos x)^2 = \frac{1}{4}\sin^2 2x, and the remaining \displaystyle \sin^2 x = \frac{1 - \cos 2x}{2}. So
The first term is an even power again: \displaystyle \sin^2 2x = \frac{1 - \cos 4x}{2}, so
The second term has an odd power of \cos 2x (the first power), so it falls to substitution: u = \sin 2x, du = 2\cos 2x\,dx. Its antiderivative is \displaystyle -\frac{1}{8}\cdot\frac{\sin^3 2x}{6} = -\frac{\sin^3 2x}{48}, which is 0 at both x = 0 and x = \pi. So
The integrand is never negative, so a positive answer is expected; Figure 1 shows the region. The indefinite form is \displaystyle \frac{x}{16} - \frac{\sin 4x}{64} - \frac{\sin^3 2x}{48} + C.
Day 1: two different frequencies
Find \int \sin 3x\cos 5x\,dx, and then \int_0^{2\pi} \sin 3x\cos 5x\,dx.
SolutionNo power is involved; the angles differ. The product to sum formula with A = 3x, B = 5x gives
using that sine is odd. Each term is in the table, with \displaystyle \int \sin kx\,dx = -\frac{\cos kx}{k} + C:
Over [0, 2\pi], both \cos 8x and \cos 2x equal 1 at each end, so the definite integral is 0. The product of two waves of different whole-number frequencies has zero integral over a full turn; Exercises 20 and 21 prove this in general.
Day 2: an even power of secant
Find \int \tan^4 x\sec^4 x\,dx.
SolutionThe power of secant is even. Set \sec^2 x aside and convert the remaining \sec^2 x to 1 + \tan^2 x:
With u = \tan x, du = \sec^2 x\,dx:
on each interval where \cos x \ne 0. Check: the derivative is \tan^4 x\sec^2 x + \tan^6 x\sec^2 x, which factors as \tan^4 x\sec^2 x\left(1 + \tan^2 x\right), that is, \tan^4 x\sec^4 x.
Day 2: an odd power of tangent
Find \int_0^{\pi/3} \tan^3 x\sec^5 x\,dx.
SolutionThe power of secant is odd, so the even-secant route is closed: setting \sec^2 x aside would leave \sec^3 x, not a polynomial in \tan x. The power of tangent is odd, so set \sec x\tan x aside:
With u = \sec x, du = \sec x\tan x\,dx. The limits change: \sec 0 = 1 and \displaystyle \sec\frac{\pi}{3} = 2. So
The value is about 11.94, positive as it must be, since both \tan x and \sec x are positive on \displaystyle \left(0, \frac{\pi}{3}\right).
Day 2: tangent alone, by two routes
Find \int \tan^5 x\,dx.
SolutionThere is no secant, so peel off \tan^2 x = \sec^2 x - 1:
In the first integral, u = \tan x gives \displaystyle \frac{\tan^4 x}{4}. The second is the same problem with the power two lower, so peel again:
So
The integral \int \tan x\sec^2 x\,dx can also be read as \int \sec x\,(\sec x\tan x)\,dx, with u = \sec x, giving \displaystyle \frac{\sec^2 x}{2} in place of \displaystyle \frac{\tan^2 x}{2}. This is not a contradiction: \displaystyle \frac{\sec^2 x}{2} = \frac{\tan^2 x}{2} + \frac{1}{2}, so the two answers differ by the constant \displaystyle \frac{1}{2}, which C absorbs. Check: the derivative of \displaystyle \frac{\tan^4 x}{4} - \frac{\tan^2 x}{2} + \ln\lvert \sec x \rvert is \tan^3 x\sec^2 x - \tan x\sec^2 x + \tan x, and since \tan x\sec^2 x - \tan x = \tan^3 x, this is \tan^3 x\left(\sec^2 x - 1\right) = \tan^5 x.
Day 2: the tide mill’s current
At a tide mill, Nairi models the current through the sluice between the sea and the millpond as \displaystyle v(t) = 1.6\sin\frac{\pi t}{6.2} meters per second, t in hours, positive while the flood tide fills the pond and negative while the ebb drains it. One tidal period is 12.4 hours. Tigran points out that the average of v over a period is 0, since flood and ebb cancel. Find the average of v^2 over one period, and the root mean square speed \displaystyle \sqrt{\text{average of } v^2}.
SolutionThe average value of v^2 on [0, 12.4] is \displaystyle \frac{1}{12.4}\int_0^{12.4} 2.56\sin^2\frac{\pi t}{6.2}\,dt. The square of sine is an even power, so reduce it, with angle \displaystyle \frac{\pi t}{6.2} doubled to \displaystyle \frac{\pi t}{3.1}:
The term \displaystyle -\frac{1}{2}\cos\frac{\pi t}{3.1} integrates to \displaystyle -\frac{3.1}{2\pi}\sin\frac{\pi t}{3.1}, which is 0 at t = 0 and at t = 12.4, where the angle is 4\pi. So
and the average of v^2 is \displaystyle \frac{2.56 \cdot 6.2}{12.4} = 1.28 square meters per square second. The root mean square speed is \displaystyle \sqrt{1.28} \approx 1.13 meters per second.
The average of \sin^2 over a whole period is exactly \displaystyle \frac{1}{2}, whatever the period, because the cosine term in the power reducing formula completes whole cycles. Figure 2 shows the picture: the humps above the line at 1.28 fill the dips below it.
Boundaries
- Even powers of tangent with an odd power of secant. Neither move applies to \int \sec^3 x\,dx or to \int \tan^2 x\sec x\,dx, which equals \int \left(\sec^3 x - \sec x\right)dx. There is no even secant power to give \sec^2 x away, and no odd tangent power to give \sec x\tan x away. An odd power of secant needs integration by parts, which gives \int \sec^3 x\,dx as \displaystyle \frac{1}{2}\big(\sec x\tan x + \ln\lvert \sec x + \tan x \rvert\big) + C.
- The powers must be the same angle. The table applies to \sin^m x\cos^n x; in \sin^2 x\cos 3x the angles differ, so first rewrite with one angle or with a product to sum formula.
- Domains. Every tangent or secant answer holds on each interval where \cos x \ne 0, and a fractional power such as \cos^{3/2} x only where its base is positive. A definite integral across a point where \cos x = 0, such as \int_0^{\pi} \sec^2 x\,dx, is not an ordinary integral at all.
- Different-looking answers. Two correct routes may give antiderivatives that look unalike (Example 6); they always differ by a constant, which differentiating each one confirms.
- The rewrites stop at whole powers. \displaystyle \int \sqrt{\sin x}\,dx or \int \sin(x^2)\,dx has no odd factor to set aside and no power to reduce; neither has an elementary antiderivative.
Where this goes next
Integration by parts handles odd powers of secant and turns the “tangent alone” repetition into reduction formulas. Trigonometric substitution replaces \displaystyle \sqrt{a^2 - x^2}, \displaystyle \sqrt{a^2 + x^2} or \displaystyle \sqrt{x^2 - a^2} by a trig expression, and every integral it produces is finished by this lesson. The zero integrals of Example 3 and Exercises 20 and 21 are the orthogonality behind Fourier series, where a periodic signal is split into sines and cosines. Choosing an integration technique puts these rewrites alongside substitution, parts and partial fractions.
Exercises
Day 1: an odd power
- Find \int \sin^5 x\,dx.
- Find \int \cos^5 x\sin^2 x\,dx.
- Find \displaystyle \int \sin^3 x\sqrt{\cos x}\,dx.
- Find \int_0^{\pi/2} \cos^3 x\,dx.
Day 1: even powers and different frequencies
- Find \int_0^{\pi/2} \cos^6 x\,dx.
- Find \int \sin^4 x\cos^4 x\,dx.
- Find \int \cos 2x\cos 6x\,dx.
- Find \int \sin 5x\sin 2x\,dx.
- Find \int_0^{\pi} \sin 2x\cos 3x\,dx.
Day 2: an even power of secant
- Find \int \sec^4 x\,dx.
- Find \int \tan^5 x\sec^4 x\,dx.
- Find \int_0^{\pi/4} \sec^6 x\,dx.
Day 2: an odd power of tangent
- Find \int \tan x\sec^3 x\,dx.
- Find \int_0^{\pi/3} \tan^5 x\sec x\,dx.
- Find \displaystyle \int \tan^3 x\sqrt{\sec x}\,dx.
Day 2: tangent alone, cotangent, and the tide mill
- Find \int \tan^7 x\,dx.
- Find \int \cot^3 x\,dx, using 1 + \cot^2 x = \csc^2 x and \displaystyle \frac{d}{dx}\cot x = -\csc^2 x.
- Vugar notes that the power the current in Example 7 carries is proportional to the cube of its speed, \lvert v \rvert^3. Find the average of \displaystyle \left\lvert \sin\frac{\pi t}{6.2} \right\rvert^3 over [0, 12.4], and the average of \lvert v \rvert^3.
- The water in the millpond stands \displaystyle h(t) = 2 - 1.5\cos\frac{\pi t}{6.2} meters deep, rising while the flood tide of Example 7 fills it, and the force of the water on each meter of width of the sluice gate is proportional to h^2. Find the average of h and the average of h^2 over [0, 12.4].
Reasoning
- Show that \int_0^{2\pi} \sin mx\cos nx\,dx = 0 for all positive integers m and n.
- Show that for positive integers m and n, \int_0^{2\pi} \sin mx\sin nx\,dx is 0 when m \ne n and \pi when m = n.
- Show that \int_0^{\pi/2} \sin^n x\,dx = \int_0^{\pi/2} \cos^n x\,dx for every positive integer n.
- Explain why setting one factor \sin x aside does not finish \int \sin^2 x\cos^6 x\,dx, and what does.
- Explain why neither move of Day 2 finishes \int \tan^4 x\sec x\,dx, and what the integral becomes after \tan^2 x = \sec^2 x - 1.
Answers
- \displaystyle -\cos x + \frac{2}{3}\cos^3 x - \frac{1}{5}\cos^5 x + C. \sin^5 x = \left(1 - \cos^2 x\right)^2\sin x; with u = \cos x the integral is -\int \left(1 - 2u^2 + u^4\right)du.
- \displaystyle \frac{\sin^3 x}{3} - \frac{2\sin^5 x}{5} + \frac{\sin^7 x}{7} + C. Set \cos x aside, \cos^4 x = \left(1 - \sin^2 x\right)^2, u = \sin x: \int \left(u^2 - 2u^4 + u^6\right)du.
- \displaystyle -\frac{2}{3}\cos^{3/2} x + \frac{2}{7}\cos^{7/2} x + C, on each interval where \cos x > 0. With u = \cos x the integral is -\int \left(1 - u^2\right)u^{1/2}\,du, that is, -\int \left(u^{1/2} - u^{5/2}\right)du.
- \displaystyle \frac{2}{3}. \cos^3 x = \left(1 - \sin^2 x\right)\cos x; with u = \sin x from 0 to 1, \displaystyle \int_0^1 \left(1 - u^2\right)du = 1 - \frac{1}{3}.
- \displaystyle \frac{5\pi}{32}. With c = \cos 2x, \displaystyle \cos^6 x = \frac{(1 + c)^3}{8} = \frac{1 + 3c + 3c^2 + c^3}{8}. On \displaystyle \left[0, \frac{\pi}{2}\right]: \displaystyle \int 1 = \frac{\pi}{2}, \int c = 0, \displaystyle \int c^2 = \frac{\pi}{4}, and \int c^3 = 0 by u = \sin 2x, which is 0 at both ends. Total \displaystyle \frac{1}{8}\left(\frac{\pi}{2} + \frac{3\pi}{4}\right).
- \displaystyle \frac{3x}{128} - \frac{\sin 4x}{128} + \frac{\sin 8x}{1024} + C. \displaystyle \sin^4 x\cos^4 x = \frac{1}{16}\sin^4 2x, and \displaystyle \sin^4 2x = \frac{1}{4}\left(1 - \cos 4x\right)^2. Expanding and reducing \cos^2 4x gives \displaystyle \frac{1}{64}\left(\frac{3}{2} - 2\cos 4x + \frac{1}{2}\cos 8x\right).
- \displaystyle \frac{\sin 4x}{8} + \frac{\sin 8x}{16} + C. \displaystyle \cos 2x\cos 6x = \frac{1}{2}\left(\cos 4x + \cos 8x\right), since cosine is even.
- \displaystyle \frac{\sin 3x}{6} - \frac{\sin 7x}{14} + C. \displaystyle \sin 5x\sin 2x = \frac{1}{2}\left(\cos 3x - \cos 7x\right).
- \displaystyle -\frac{4}{5}. \displaystyle \sin 2x\cos 3x = \frac{1}{2}\left(\sin 5x - \sin x\right), antiderivative \displaystyle \frac{1}{2}\left(-\frac{\cos 5x}{5} + \cos x\right); at \pi it is \displaystyle \frac{1}{2}\left(\frac{1}{5} - 1\right) and at 0 it is \displaystyle \frac{1}{2}\left(-\frac{1}{5} + 1\right).
- \displaystyle \tan x + \frac{\tan^3 x}{3} + C. \sec^4 x = \left(1 + \tan^2 x\right)\sec^2 x, u = \tan x.
- \displaystyle \frac{\tan^6 x}{6} + \frac{\tan^8 x}{8} + C. u = \tan x: \int u^5\left(1 + u^2\right)du. The secant route also works; its answer differs by a constant.
- \displaystyle \frac{28}{15}. u = \tan x from 0 to 1: \displaystyle \int_0^1 \left(1 + u^2\right)^2 du = 1 + \frac{2}{3} + \frac{1}{5}.
- \displaystyle \frac{\sec^3 x}{3} + C. \tan x\sec^3 x = \sec^2 x\,(\sec x\tan x), u = \sec x.
- \displaystyle \frac{38}{15}. \tan^5 x\sec x = \left(\sec^2 x - 1\right)^2(\sec x\tan x); u = \sec x from 1 to 2 gives \displaystyle \left[\frac{u^5}{5} - \frac{2u^3}{3} + u\right]_1^2, which is \displaystyle \frac{46}{15} - \frac{8}{15}.
- \displaystyle \frac{2}{5}\sec^{5/2} x - 2\sec^{1/2} x + C, on each interval where \cos x > 0. Write \displaystyle \tan^3 x\sqrt{\sec x} as \left(\sec^2 x - 1\right)\sec^{-1/2} x times \sec x\tan x; with u = \sec x the integral is \int \left(u^{3/2} - u^{-1/2}\right)du.
- \displaystyle \frac{\tan^6 x}{6} - \frac{\tan^4 x}{4} + \frac{\tan^2 x}{2} - \ln\lvert \sec x \rvert + C. \displaystyle \int \tan^7 x\,dx = \frac{\tan^6 x}{6} - \int \tan^5 x\,dx, and Example 6 gives \int \tan^5 x\,dx.
- \displaystyle -\frac{\cot^2 x}{2} - \ln\lvert \sin x \rvert + C, on each interval where \sin x \ne 0. \cot^3 x = \cot x\csc^2 x - \cot x; u = \cot x gives \displaystyle -\frac{u^2}{2}, and \int \cot x\,dx = \ln\lvert \sin x \rvert.
- \displaystyle \frac{4}{3\pi} \approx 0.424, and \displaystyle 1.6^3 \cdot \frac{4}{3\pi} = \frac{2048}{375\pi} \approx 1.74. By symmetry the average is \displaystyle \frac{2}{12.4}\int_0^{6.2} \sin^3\frac{\pi t}{6.2}\,dt; with \displaystyle s = \frac{\pi t}{6.2} this is \displaystyle \frac{1}{\pi}\int_0^{\pi} \sin^3 s\,ds = \frac{1}{\pi}\cdot\frac{4}{3}, the odd power done by u = \cos s.
- Average of h: 2 meters. Average of h^2: \displaystyle \frac{41}{8} = 5.125 square meters. \displaystyle h^2 = 4 - 6\cos\frac{\pi t}{6.2} + 2.25\cos^2\frac{\pi t}{6.2}; the cosine averages 0 over a period and its square averages \displaystyle \frac{1}{2}, as in Example 7, so 4 + 1.125. It exceeds 2^2.
- The product \sin mx\cos nx equals \displaystyle \frac{1}{2}\sin(m + n)x + \frac{1}{2}\sin(m - n)x. For a nonzero integer k, \displaystyle \int_0^{2\pi} \sin kx\,dx = \left[-\frac{\cos kx}{k}\right]_0^{2\pi} = 0, since \cos 2k\pi = 1; when m = n the second term is \sin 0 = 0. Both terms integrate to 0.
- When m \ne n, the product \sin mx\sin nx equals \displaystyle \frac{1}{2}\cos(m - n)x - \frac{1}{2}\cos(m + n)x, and for a nonzero integer k, \displaystyle \int_0^{2\pi} \cos kx\,dx = \left[\frac{\sin kx}{k}\right]_0^{2\pi} = 0. When m = n, the integrand is \displaystyle \sin^2 mx = \frac{1}{2} - \frac{1}{2}\cos 2mx, whose integral is \pi + 0.
- Substitute \displaystyle x = \frac{\pi}{2} - t, so dx = -dt and \sin x = \cos t; the limits 0 and \displaystyle \frac{\pi}{2} become \displaystyle \frac{\pi}{2} and 0. Then \int_0^{\pi/2} \sin^n x\,dx becomes \int_{\pi/2}^0 \cos^n t\,(-dt), which is \int_0^{\pi/2} \cos^n t\,dt.
- Setting \sin x aside leaves \sin x\cos^6 x, and u = \cos x needs it written in \cos x alone; but \displaystyle \sin x = \pm\sqrt{1 - \cos^2 x} is not a polynomial in \cos x. Setting \cos x aside fails the same way, since the \cos^5 x left behind is an odd power. Power reducing works: \displaystyle \sin^2 x\cos^6 x = \frac{1}{4}\sin^2 2x\cos^4 x, and expanding \displaystyle \cos^4 x = \frac{1}{4}(1 + \cos 2x)^2 gives three terms, \displaystyle \frac{1}{16}\sin^2 2x, \displaystyle \frac{1}{8}\sin^2 2x\cos 2x and \displaystyle \frac{1}{16}\sin^2 2x\cos^2 2x. The middle term falls to u = \sin 2x, and the first and last reduce again, with \displaystyle \sin^2 2x\cos^2 2x = \frac{1}{4}\sin^2 4x.
- The secant power 1 is odd, so there is no \sec^2 x to give away; the tangent power 4 is even, so setting \sec x\tan x aside leaves \tan^3 x, which is not a polynomial in \sec x. With \tan^4 x = \left(\sec^2 x - 1\right)^2 the integral becomes \int \left(\sec^5 x - 2\sec^3 x + \sec x\right)dx, odd powers of secant, which need integration by parts.