Spotting the Differential
Integrals such as \(\int\tan^2x\sec^2x\,dx\) look like products of trigonometric functions, but one substitution turns them into elementary power integrals. The key observation is that \(\frac{d}{dx}\tan x=\sec^2x\). Whenever the integrand contains the factor \(\sec^2x\) and everything else is a function of \(\tan x\), the factor \(\sec^2x\,dx\) is exactly \(du\) for \(u=\tan x\).
This tutorial treats the case where the power of tangent is even, \(\tan^{2k}x\), but the method does not depend on parity. The even case is singled out because it contrasts with the next tutorials, where the power of tangent is odd and a different factor of the integrand is reserved.
Deriving the Formula
Let \(u=\tan x\), so \(du=\sec^2x\,dx\). Then
The substitution is valid on any interval where \(\tan x\) is defined, that is, on each interval between consecutive vertical asymptotes \(x=\frac\pi2+n\pi\). A definite integral must not cross an asymptote.
Checking with the Chain Rule
Differentiate \(\frac{\tan^{2k+1}x}{2k+1}\). The outer power rule gives \(\tan^{2k}x\), and the chain rule multiplies by \(\frac{d}{dx}\tan x=\sec^2x\). The result is \(\tan^{2k}x\sec^2x\), the original integrand. This check is quick enough to do mentally for every problem of this type.
Worked Examples
Worked Example: Tangent Squared
Find \(\int\tan^2x\sec^2x\,dx\).
Take \(u=\tan x\) and \(du=\sec^2x\,dx\). The integral is \(\int u^2\,du=\frac{u^3}{3}\), so
No trigonometric identity is needed, because the integrand already contains the differential.
Worked Example: Tangent to the Fourth Power on [0, π/3]
Evaluate \(\int_0^{\pi/3}\tan^4x\sec^2x\,dx\).
The antiderivative is \(\frac{\tan^5x}{5}\). At \(x=\frac\pi3\), \(\tan x=\sqrt3\) and \((\sqrt3)^5=9\sqrt3\). At \(x=0\) the value is \(0\). Hence
Equivalently, the substitution changes the limits to \(u=0\) and \(u=\sqrt3\), and \(\int_0^{\sqrt3}u^4\,du=\frac{(\sqrt3)^5}{5}\).
Worked Example: A Scaled Argument
Find \(\int\tan^2(3x)\sec^2(3x)\,dx\).
Let \(u=\tan3x\). Then \(du=3\sec^2(3x)\,dx\), so \(\sec^2(3x)\,dx=\frac{du}{3}\). The integral becomes \(\frac13\int u^2\,du=\frac{u^3}{9}\):
The extra factor \(\frac13\) from the chain rule combines with \(\frac13\) from the power rule to give \(\frac19\).
Worked Example: A Symmetric Interval
Evaluate \(\int_{-\pi/4}^{\pi/4}\tan^4x\sec^2x\,dx\).
The integrand is even, since \(\tan^4x\) and \(\sec^2x\) are both even. The antiderivative \(\frac{\tan^5x}{5}\) is odd, so the definite integral is
The interval \([-\frac\pi4,\frac\pi4]\) contains no vertical asymptote, so the substitution is legitimate throughout.
A Reliable Procedure
Look for \(\sec^2x\,dx\) in the integrand.
Set \(u=\tan x\) and rewrite the remaining factors as powers of \(u\).
Use \(\int u^n\,du=\frac{u^{n+1}}{n+1}\).
Replace \(u\) by \(\tan x\).
Differentiate with the chain rule; the factor \(\sec^2x\) must reappear.
Common Mistakes
A frequent error is to treat \(\int\tan^2x\sec^2x\,dx\) as if the identity \(\tan^2x=\sec^2x-1\) were required. That would work, but it is much longer than the substitution. Another mistake is to forget to divide by the new exponent, writing \(\tan^3x\) instead of \(\frac{\tan^3x}{3}\). A third is to confuse this integral with \(\int\tan^2x\,dx=\tan x-x+C\), which lacks the factor \(\sec^2x\) and therefore needs the identity.
Finally, a definite integral that crosses a vertical asymptote of \(\tan x\), such as \(\int_0^{\pi}\tan^2x\sec^2x\,dx\), cannot be evaluated by simply substituting the endpoints, because the integrand is not defined at \(x=\frac\pi2\). That integral diverges.
Quick Reference
| Integrand | Antiderivative |
|---|---|
| \(\tan^2x\sec^2x\) | \(\frac{\tan^3x}{3}\) |
| \(\tan^4x\sec^2x\) | \(\frac{\tan^5x}{5}\) |
| \(\tan^6x\sec^2x\) | \(\frac{\tan^7x}{7}\) |
| \(\sec^2x\) | \(\tan x\) |
Interpreting the Result
The integrand \(\tan^{2k}x\sec^2x\) is non-negative, so its antiderivative \(\frac{\tan^{2k+1}x}{2k+1}\) is increasing on each interval of continuity. Near \(x=\frac\pi2\), \(\tan x\) grows without bound and so do the integrals: the area under the curve from \(0\) to \(t\) is \(\frac{\tan^{2k+1}t}{2k+1}\), which tends to infinity as \(t\to\frac\pi2^-\). Higher powers grow even faster in relative terms, but all of them diverge.
Because the substitution turns every such integral into a power integral, it also shows the structure: the family \(\tan^{2k}x\sec^2x\) is the family \(u^{2k}\) in disguise, with \(u=\tan x\) acting as a new coordinate along the interval.
A Numerical Spot Check
Check \(\int_0^{\pi/4}\tan^2x\sec^2x\,dx=\frac13\) with the trapezoid rule on two intervals. The heights at \(0\), \(\frac\pi8\), and \(\frac\pi4\) are \(0\), \(\tan^2\frac\pi8\sec^2\frac\pi8\approx0.1716\cdot1.1716=0.2010\), and \(1\cdot2=2\). The estimate \(\frac{\pi}{8}\bigl(\frac{0+0.2010}{2}+\frac{0.2010+2}{2}\bigr)\approx0.4716\) is above \(\frac13\), as expected for a convex integrand and a coarse rule.
Practice Problems with Answers
Try each problem before reading the answer. Every answer below was checked by differentiation or by numerical integration.
- Find an antiderivative of \(\tan^2x\sec^2x\). Hint: set \(u=\tan x\). Answer: \(\frac{\tan^3x}{3}\)
- Evaluate \(\int_0^{\pi/4}\tan^2x\sec^2x\,dx\). Hint: \(\tan\frac\pi4=1\). Answer: \(\frac13\)
- Evaluate \(\int_0^{\pi/3}\tan^4x\sec^2x\,dx\). Hint: \(\tan\frac\pi3=\sqrt3\). Answer: \(\frac{9\sqrt3}{5}\)
- Find an antiderivative of \(\tan^2(3x)\sec^2(3x)\). Hint: include the chain-rule factor \(\frac13\). Answer: \(\frac{\tan^3(3x)}{9}\)
Extending the Idea: Even Powers of Secant
The same substitution handles integrands that do not visibly contain \(\tan x\). Consider \(\int\sec^4x\,dx\). Reserve one factor \(\sec^2x\,dx=du\) and rewrite the other using the identity \(\sec^2x=1+\tan^2x\). Then
In the same way, \(\int\tan^2x\sec^4x\,dx=\int u^2(1+u^2)\,du=\frac{\tan^3x}{3}+\frac{\tan^5x}{5}+C\). In both cases the integrand is a polynomial in \(u\) after the substitution, so the integral reduces to power rule. The definite integral \(\int_0^{\pi/4}\sec^4x\,dx\) equals \(1+\frac13=\frac43\), because \(\tan\frac\pi4=1\).
Why the Substitution Works Without Identities Here
In the main examples no trigonometric identity was needed. This is the signature of the \(\tan x\) and \(\sec^2x\) pairing: the differential is already present, so the substitution is immediate. Identities enter only when the integrand has a different shape, such as an even power of secant alone. A useful habit is to scan the integrand for the differential first and reach for identities only when that scan fails.
Domain and Branch Considerations
The function \(\tan x\) has period \(\pi\) and vertical asymptotes at odd multiples of \(\frac\pi2\). An antiderivative like \(\frac{\tan^3x}{3}\) is therefore defined and differentiable on each interval \((-\frac\pi2+n\pi,\frac\pi2+n\pi)\) separately, and the constant \(C\) may differ on different intervals. For a definite integral, check that the endpoints lie in the same interval of continuity before applying the Fundamental Theorem of Calculus.
Choosing Between Substitution and Identities
For \(\int\tan^2x\sec^2x\,dx\) there is a longer route: expand \(\tan^2x=\sec^2x-1\) and integrate \(\sec^4x-\sec^2x\). That route works but requires the secant fourth-power integral, which is itself a substitution problem. Comparing the two routes shows why the direct substitution is preferred: it uses one idea, and the answer \(\frac{\tan^3x}{3}\) can be checked in a single step. Both routes give the same function up to a constant, since \(\tan x+\frac{\tan^3x}{3}-\tan x=\frac{\tan^3x}{3}\).
Where This Fits in the Course
This tutorial belongs to the module “Tangent and Secant Powers”. The tutorial just before it is “Derivative Identities Behind Tangent And Secant Integrals,” and the one that follows is “Odd Tangent Powers Paired With Secant Factors.” It is the simplest case of the substitution strategies that the rest of the module builds on, and the habit of scanning for the differential first will serve you in every trigonometric integral that follows.
Check Your Understanding
Use the method and examples above to answer these questions.
- Why is \(\sec^2x\,dx\) equal to \(du\) when \(u=\tan x\)?
- Find \(\int\tan^6x\sec^2x\,dx\).
- Evaluate \(\int_0^{\pi/4}\tan^2x\sec^2x\,dx\).
- Why can the definite integral \(\int_0^{\pi}\tan^2x\sec^2x\,dx\) not be evaluated directly?
- Differentiate \(\frac{\tan^3x}{3}\) and show the result is the integrand.