Trigonometric Integrals and the Weierstrass Universal Substitution

Trigonometric integrals are computed with identities and substitutions: for powers of sine and cosine, use the odd-power trick or power reduction, and for any rational expression in sin x and cos x, the Weierstrass substitution t = tan(x/2) turns the integrand into a rational function of t. In brief: ∫ sin3x dx = −cos x + cos3x/3 + C, and with t = tan(x/2) one has sin x = 2t/(1 + t2), cos x = (1 − t2)/(1 + t2) and dx = 2 dt/(1 + t2). Then ∫ dx/(1 + cos x) = ∫ dt = tan(x/2) + C.

Trigonometric integrals appear in geometry, physics and signal analysis. A few systematic techniques cover most cases, and the Weierstrass substitution is a universal method that always works for rational functions of sine and cosine, though it may produce lengthy computations. This guide gives the methods for powers and products of trigonometric functions, the integrals of tan, sec and csc, the Weierstrass substitution with worked examples and a table of formulas.

How do you integrate powers of sine and cosine?

For ∫ sinmx cosnx dx:

Example 1: odd power

∫ sin3x dx = ∫ (1 − cos2x) sin x dx. With u = cos x, du = −sin x dx: −∫ (1 − u2) du = −u + u3/3 + C = −cos x + cos3x/3 + C.

Example 2: mixed

∫ sin2x cos3x dx = ∫ sin2x (1 − sin2x) cos x dx. With u = sin x: ∫ (u2 − u4) du = u3/3 − u5/5 + C = sin3x/3 − sin5x/5 + C.

Example 3: even powers

∫ cos2x dx = ∫ (1 + cos 2x)/2 dx = x/2 + sin 2x/4 + C. And ∫ sin4x dx = ∫ ((1 − cos 2x)/2)2 dx = (1/4) ∫ (1 − 2 cos 2x + cos22x) dx = (1/4) ∫ (3/2 − 2 cos 2x + (cos 4x)/2) dx = 3x/8 − sin 2x/4 + sin 4x/32 + C.

Example 4: a definite integral

∫0π sin2x dx = [x/2 − sin 2x/4]0π = π/2. The average value of sin2 over a period is 1/2.

π1π/2+4

How do you integrate products of different angles?

Use the product-to-sum formulas: sin a cos b = [sin(a + b) + sin(a − b)]/2, sin a sin b = [cos(a − b) − cos(a + b)]/2 and cos a cos b = [cos(a − b) + cos(a + b)]/2.

Example 5

∫ sin 3x cos 5x dx = (1/2) ∫ [sin 8x + sin(−2x)] dx = (1/2)(−cos 8x/8 + cos 2x/2) + C = −cos 8x/16 + cos 2x/4 + C.

Example 6: orthogonality

∫02π sin mx sin nx dx = 0 for different integers m and n, and π for m = n. This is the basis of Fourier series.

How do you integrate tangent, secant and cosecant?

Example 7

∫ tan3x dx = ∫ tan x (sec2x − 1) dx = tan2x/2 + ln|cos x| + C (using u = tan x for the first part). And ∫ tan x sec2x dx = tan2x/2 + C.

Example 8

∫ sec x dx: multiply by (sec x + tan x)/(sec x + tan x). The numerator becomes sec x tan x + sec2x, which is the derivative of the denominator sec x + tan x, giving ln|sec x + tan x| + C.

What is the Weierstrass substitution?

For an integrand R(sin x, cos x), where R is a rational function, set t = tan(x/2) (valid for −π < x < π). Then

The integral becomes the integral of a rational function of t. The formulas follow from the double-angle identities with tan(x/2).

Worked examples with the Weierstrass substitution

Example 9

∫ dx/(1 + cos x). 1 + cos x = (1 + t2 + 1 − t2)/(1 + t2) = 2/(1 + t2). So the integrand times dx is [(1 + t2)/2] · [2/(1 + t2)] dt = dt. The integral is t + C = tan(x/2) + C.

Example 10

∫ dx/(2 + cos x). 2 + cos x = (2 + 2t2 + 1 − t2)/(1 + t2) = (3 + t2)/(1 + t2). The integral is ∫ [(1 + t2)/(3 + t2)] · [2/(1 + t2)] dt = ∫ 2 dt/(3 + t2) = (2/√3) arctan(t/√3) + C = (2/√3) arctan(tan(x/2)/√3) + C.

Example 11

∫ dx/(1 + sin x). 1 + sin x = (1 + t2 + 2t)/(1 + t2) = (1 + t)2/(1 + t2). The integral: ∫ 2 dt/(1 + t)2 = −2/(1 + t) + C = −2/(1 + tan(x/2)) + C.

Example 12: csc x

∫ dx/sin x = ∫ [(1 + t2)/(2t)] · [2/(1 + t2)] dt = ∫ dt/t = ln|t| + C = ln|tan(x/2)| + C.

Example 13: a definite integral

∫0π/2 dx/(1 + sin x): with the antiderivative −2/(1 + tan(x/2)): at π/2: tan(π/4) = 1, so −1; at 0: −2. The value is −1 + 2 = 1.

π/211

Example 14: a denominator of the form a + b cos x

∫ dx/(5 + 4 cos x) = ∫ 2 dt/((1 + t2)(5 + 4(1 − t2)/(1 + t2))) = ∫ 2 dt/(5 + 5t2 + 4 − 4t2) = ∫ 2 dt/(9 + t2) = (2/3) arctan(t/3) + C = (2/3) arctan(tan(x/2)/3) + C.

Table of trigonometric integrals

Trigonometric integrals and the method used
Integral Method Result
∫ sin3x dxodd power, u = cos x−cos x + cos3x/3
∫ cos2x dxpower reductionx/2 + sin 2x/4
∫ sin 3x cos 5x dxproduct to sum−cos 8x/16 + cos 2x/4
∫ tan x dxu = cos x−ln|cos x|
∫ sec x dxmultiply by (sec x + tan x)ln|sec x + tan x|
∫ dx/(1 + cos x)t = tan(x/2)tan(x/2)
∫ dx/(2 + cos x)t = tan(x/2)(2/√3) arctan(tan(x/2)/√3)

Where do these methods come from?

The integrals of tan x and sec x were important in the construction of Mercator charts for navigation in the sixteenth century: the distance on a Mercator map is related to the integral of sec x, which was numerically tabulated by Edward Wright before the logarithmic formula was found by James Gregory in 1668. The substitution t = tan(x/2) was used by Euler and is named after Karl Weierstrass, who popularised it in his lectures in the nineteenth century.

Where are they used?

Integrals of squares of sine and cosine give the average power of an AC signal: the average of sin2 is 1/2, so the effective (rms) voltage is the amplitude divided by √2. The orthogonality integrals of Example 6 are the foundation of Fourier analysis. The integral of 1/(a + b cos x) appears in orbital mechanics (Kepler’s equation) and in the computation of arc length and areas in polar coordinates.

Which mistakes are common?

Forgetting dx = 2 dt/(1 + t2)

When using the Weierstrass substitution, replace dx too. This factor often cancels with the denominator.

Using the Weierstrass substitution when simpler methods exist

For ∫ sin x cos2x dx, the substitution u = cos x is much faster.

Wrong sign with u = cos x

du = −sin x dx, so the minus sign must be included.

Ignoring the domain of the substitution

t = tan(x/2) is undefined at x = π + 2kπ. For intervals crossing this point, the result may need to be adjusted by a constant.