Integrals of Powers of Secant and Tangent
\(\int \tan^m x \sec^n x\,dx\) yields to the same reserve-a-factor strategy you used for sines and cosines — but the identity that does the converting is now \(1 + \tan^2 x = \sec^2 x\), and there are two factors worth reserving: \(\sec^2 x\) or \(\sec x\tan x\).
By the end you'll be able to look at the powers in \(\int \tan^m x \sec^n x\,dx\), decide which factor to reserve for \(du\) (even secant → \(\sec^2 x\); odd tangent → \(\sec x\tan x\)), and finish the u-substitution.
Predict: for \(\int \tan^3 x \sec^3 x\,dx\), which factor do you reserve — \(\sec^2 x\) or \(\sec x\tan x\)? The sliders start at exactly those powers — check your answer against the green reserved tile, then toggle the powers and watch the split change.
The integrand is split into tiles: the reserved factor becomes \(du\), and any converted leftover is rewritten with \(1 + \tan^2 x = \sec^2 x\) so everything else is a polynomial in \(u\). Hover or focus a tile for its role.
∫tan³x sec³x dx — odd tangent power (m = 3): reserve sec x·tan x, set u = sec x. Result: sec⁵x/5 − sec³x/3 + C
Integrals of products of powers of tangent and secant are evaluated by reserving a \(\sec^2 x\) (for even secant powers) or a \(\sec x\tan x\) factor (for odd tangent powers) for a u-substitution, using the identity \(1 + \tan^2 x = \sec^2 x\) to convert the rest.
Why these two factors?
Everything hinges on two derivatives: \(\frac{d}{dx}\tan x = \sec^2 x\) and \(\frac{d}{dx}\sec x = \sec x\tan x\). If you can peel exactly one of those off the integrand, it plays the role of \(du\) — and the identity \(1 + \tan^2 x = \sec^2 x\) lets you rewrite whatever is left entirely in terms of your chosen \(u\). That's the whole game: reserve, convert, substitute.
Case 1 — the secant power \(n\) is even (and positive). Reserve \(\sec^2 x\) as \(du\) (so \(u = \tan x\)), and convert the remaining even secant power using \(\sec^2 x = 1 + \tan^2 x\): \(\sec^n x = (1+\tan^2 x)^{(n-2)/2}\sec^2 x\). Case 2 — the tangent power \(m\) is odd (with at least one secant present). Reserve \(\sec x\tan x\) as \(du\) (so \(u = \sec x\)), and convert the remaining even tangent power using the rearranged identity \(\tan^2 x = \sec^2 x - 1\): \(\tan^m x\sec^n x = (\sec^2 x - 1)^{(m-1)/2}\sec^{n-1} x\cdot(\sec x\tan x)\). Watch the sign — the identity flips depending on which side you solve for.
Your decision procedure, in order: (1) Is \(n\) even and \(\ge 2\)? Reserve \(\sec^2 x\), set \(u = \tan x\). (2) Else, is \(m\) odd with a secant available? Reserve \(\sec x\tan x\), set \(u = \sec x\). (3) Neither? You're in a leftover case — even tangent power with odd secant power, like \(\int \sec x\,dx\) or \(\int \sec^3 x\,dx\). Those need different tools: the multiply-by-conjugate trick for \(\int\sec x\,dx\), or integration by parts plus the solve-for-the-integral trick for \(\int\sec^3 x\,dx\). If both cases apply (odd \(m\) AND even \(n\)), either route works — pick whichever leaves less algebra.
Evaluate \(\int \tan^2 x\sec^4 x\,dx\). The secant power (4) is even, so reserve \(\sec^2 x\) and convert the rest: \(\sec^4 x = (1+\tan^2 x)\sec^2 x\). Then \[\int\tan^2 x\sec^4 x\,dx = \int \tan^2 x(1+\tan^2 x)\sec^2 x\,dx.\] Let \(u = \tan x\), \(du = \sec^2 x\,dx\): \[\int u^2(1+u^2)\,du = \int(u^2+u^4)\,du = \frac{u^3}{3}+\frac{u^5}{5}+C.\] Back-substitute: \(\displaystyle\int\tan^2 x\sec^4 x\,dx = \frac{\tan^3 x}{3} + \frac{\tan^5 x}{5} + C\).
Evaluate \(\int \tan^3 x\sec^3 x\,dx\). The tangent power (3) is odd and a secant is present, so reserve \(\sec x\tan x\): \[\tan^3 x\sec^3 x = (\sec^2 x - 1)\sec^2 x\cdot(\sec x\tan x).\] Let \(u = \sec x\), \(du = \sec x\tan x\,dx\), so the integral becomes \(\int(u^4 - u^2)\,du\). Now finish it: integrate, then back-substitute — \(\int(u^4-u^2)\,du = \) ____
Reveal the answer
\(\int(u^4-u^2)\,du = \frac{u^5}{5}-\frac{u^3}{3}+C\), so \(\displaystyle\int\tan^3 x\sec^3 x\,dx = \frac{\sec^5 x}{5} - \frac{\sec^3 x}{3} + C\). Set m = 3, n = 3 in the explorer above and compare tile by tile.
More info — the same move you made with sines and cosines
In the previous lesson you reserved one \(\sin x\) (or \(\cos x\)) from an odd power and converted the even remainder with \(\sin^2 x + \cos^2 x = 1\). This lesson is the same strategy wearing different clothes: divide the Pythagorean identity by \(\cos^2 x\) and you get \(\tan^2 x + 1 = \sec^2 x\) — the converter used here. The only new wrinkle is that tangent/secant offer TWO possible \(du\) factors (\(\sec^2 x\) and \(\sec x\tan x\)) instead of one, so the parity check happens on two exponents instead of one. Paul's Online Math Notes (Dive deeper below) runs both families side by side if you want the parallel laid out fully.
Check your understanding
Evaluate \(\int \tan x \sec^3 x\,dx\).
For \(\int \tan^2 x \sec^6 x\,dx\), which factor do you reserve for \(du\), and why?
Why does \(\int \sec^3 x\,dx\) NOT fit either reserve-a-factor pattern?
The reserve-a-factor strategy works for sine/cosine integrals and for tangent/secant integrals. Which pairing of integral and reserved factor is correct?
Recap
- The strategy for \(\int\tan^m x\sec^n x\,dx\): reserve a factor that equals \(du\), convert the rest with \(1 + \tan^2 x = \sec^2 x\), substitute.
- Even secant power (\(n\) even, \(\ge 2\)): reserve \(\sec^2 x\), set \(u = \tan x\), rewrite \(\sec^{n-2} x = (1+\tan^2 x)^{(n-2)/2}\).
- Odd tangent power (\(m\) odd, secant present): reserve \(\sec x\tan x\), set \(u = \sec x\), rewrite \(\tan^{m-1} x = (\sec^2 x - 1)^{(m-1)/2}\).
- Leftover cases (even tangent, odd secant — e.g. \(\int\sec x\,dx\), \(\int\sec^3 x\,dx\)) don't fit either pattern: they use the conjugate trick or integration by parts with the solve-for-the-integral trick.
Dive deeper
- Paul's Online Math Notes — Integrals Involving Trig Functions Practice identifying which factor to reserve using the even-secant/odd-tangent cases.
- OpenStax Calculus Volume 2 — 3.2 Trigonometric Integrals Study the reduction formulas for lowering powers of sec x and tan x.
Sources
- Integrals of Powers of Secant and Tangent