JOVANA
Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

Powers & Products of Trig Functions; the Weierstrass Substitution

A reliable recipe for integrating any power or product of sines, cosines, secants, and tangents — and one master substitution that turns every rational function of sin and cos into ordinary algebra.

Why trig integrals need their own toolkit

The previous guide used trigonometric substitution to remove roots like sqrt(a^2 - x^2). This one is its mirror image: here you already have sines and cosines and you want to integrate them. An integral such as 'integral of sin^4(x) cos^2(x) dx' looks harmless, but a blind u-substitution stalls — the derivative of sin is cos, so the cosines and sines tangle instead of cancelling. The fix is not cleverness but bookkeeping: a small set of powers-of-trig patterns covers essentially every case.

Two identities do almost all the work. The Pythagorean identity sin^2 + cos^2 = 1 (and its cousins 1 + tan^2 = sec^2, 1 + cot^2 = csc^2) lets you convert between functions, and the double-angle / power-reduction identities cos^2(x) = (1 + cos 2x)/2 and sin^2(x) = (1 - cos 2x)/2 let you trade a square for a lower-power expression in 2x. Knowing which identity to reach for, and when, is the whole skill — and it depends on whether your exponents are odd or even.

Powers of sine and cosine: odd is easy, even needs halving

For 'integral of sin^m(x) cos^n(x) dx', look at the parities of m and n. If either exponent is odd, you win immediately: peel off one factor of that odd function to be the dx-partner, and use sin^2 + cos^2 = 1 to rewrite the remaining even power in terms of the other function. For 'integral of sin^5(x) cos^2(x) dx', split sin^5 = sin^4 * sin = (1 - cos^2 x)^2 * sin x; now let u = cos x, du = -sin x dx, and you are integrating a plain polynomial in u — the same substitution you learned in Volume I, finally with a clear target.

If both exponents are even, no single factor can become du, so you climb down instead. Apply the power-reduction identities to halve every even power, multiply everything out, and you get a sum of cosines of 2x, 4x, and so on — each of which integrates in one line. 'integral of sin^2 x dx' becomes 'integral of (1 - cos 2x)/2 dx = x/2 - sin(2x)/4 + C'. Higher even powers just mean applying the halving twice; it is repetitive, never hard.

Secants and tangents: a different pairing

The tangent-secant family plays by similar rules, anchored on two facts: the derivative of tan x is sec^2 x, and the derivative of sec x is sec x tan x. So for 'integral of tan^m(x) sec^n(x) dx', an even power of sec (n even, n >= 2) lets you peel off sec^2 x for the du-partner and convert the rest with sec^2 = 1 + tan^2, then set u = tan x. An odd power of tan together with at least one sec lets you peel off sec x tan x and convert the remaining even tan power, then set u = sec x.

The awkward leftover cases — an odd power of tangent with no secant, or an odd power of secant alone — do not yield to a clean substitution. 'integral of sec x dx = ln|sec x + tan x| + C' is the famous trick (multiply and divide by sec x + tan x so the numerator becomes the derivative of the denominator), and 'integral of sec^3 x dx' is the textbook case for a reduction formula or integration by parts — exactly the recursion machinery the next guide builds. Recognizing that a problem belongs to this harder pocket is itself progress.

The Weierstrass substitution: one trick to rule them all

What about something like 'integral of dx/(2 + cos x)', where there is no power to peel and no factor to save? Here the Weierstrass substitution — the tangent half-angle substitution t = tan(x/2) — is a genuine universal solvent. The magic is that it converts every rational expression in sin x and cos x into a rational function of the single algebraic variable t, with no trig left at all. You then finish with the workhorses of the previous guide: partial fractions applied to an integral of a rational function.

Let t = tan(x/2).  Then the three pieces become:

  sin x = 2t / (1 + t^2)
  cos x = (1 - t^2) / (1 + t^2)
  dx    = 2 / (1 + t^2) dt

Example:  integral of dx / (2 + cos x)
  2 + cos x = 2 + (1 - t^2)/(1 + t^2) = (3 + t^2)/(1 + t^2)
  integral becomes  integral of [2/(1+t^2)] * [(1+t^2)/(3+t^2)] dt
                  = integral of 2/(3 + t^2) dt
                  = (2/sqrt(3)) arctan(t/sqrt(3)) + C
  back-substitute t = tan(x/2):
                  = (2/sqrt(3)) arctan( tan(x/2)/sqrt(3) ) + C
The three half-angle formulas, and a full worked integral from start to finish.

Where do those formulas come from? They are pure double-angle bookkeeping. Writing x = 2 * (x/2) and using the double-angle identities, sin x = 2 sin(x/2) cos(x/2) and cos x = cos^2(x/2) - sin^2(x/2); dividing top and bottom by cos^2(x/2) turns every term into tan(x/2) = t, which is where the 1 + t^2 denominators are born. And dx follows because t = tan(x/2) gives dt/dx = (1/2) sec^2(x/2) = (1/2)(1 + t^2), so dx = 2/(1 + t^2) dt.

The procedure, and its honest limits

  1. Set t = tan(x/2) and write down dt = (1/2)(1 + t^2) dx, i.e. dx = 2/(1 + t^2) dt.
  2. Replace every sin x by 2t/(1 + t^2) and every cos x by (1 - t^2)/(1 + t^2); the integrand becomes a rational function of t.
  3. Simplify and integrate that rational function — usually by partial fractions, sometimes by a quick arctan or log.
  4. Substitute t = tan(x/2) back in; for a definite integral, instead convert the limits (x = 0 gives t = 0, and watch out near x = pi).

Step back and the whole landscape is one connected idea: every method here ends by reducing a trig integral to something elementary you can already do — a polynomial in u, a sum of cosines, or a rational function. None of these antiderivatives is mysterious or non-elementary; they always exist in closed form. What you are building is judgment — recognizing at a glance which lever (parity, identity, or half-angle) opens a given integral with the least work.