Why These Integrals Invite Errors
Integrals involving powers of \(\tan x\) and \(\sec x\) often become manageable after using the identities \(\frac{d}{dx}\tan x=\sec^2 x\), \(\frac{d}{dx}\sec x=\sec x\tan x\), and \(\tan^2 x=\sec^2 x-1\). The difficulty is not merely remembering these facts. A method works only when the factors left in the integrand fit the substitution being used.
For example, if \(u=\tan x\), then \(du=\sec^2 x\,dx\). If \(u=\sec x\), then \(du=\sec x\tan x\,dx\). Replacing a factor of \(dx\) by \(du\) without matching the full differential is a frequent source of incorrect answers. Likewise, a familiar parity pattern is a guide to choosing a method, not permission to skip the algebra.
Substitution Must Match the Differential
A substitution is useful when the integrand can be expressed as \(F(u)\,du\), where \(u\) is a function of \(x\). The differential is part of the substitution: for \(u=\tan x\), the factor is \(\sec^2 x\,dx\), while for \(u=\sec x\), it is \(\sec x\tan x\,dx\). A missing factor cannot simply be ignored.
Worked Example: Correcting a Mismatched Differential
Consider \(\int \tan^3 x\sec^2 x\,dx\), on an interval where \(\cos x\ne 0\). A faulty solution might set \(u=\sec x\), note that \(du=\sec x\tan x\,dx\), and then incorrectly replace \(\tan x\,dx\) by \(du\). That replacement omits a factor of \(\sec x\), so it is not a valid change of variables.
The straightforward substitution is \(u=\tan x\), for which \(du=\sec^2 x\,dx\). Thus
Check by differentiation:
The secant substitution can also be made correctly, though it is less direct here. Factor the complete differential \(\sec x\tan x\,dx\):
Consequently,
This second form also checks: its derivative is \(\sec^4 x\tan x-\sec^2 x\tan x =\sec^2 x\tan x(\sec^2 x-1) =\sec^2 x\tan^3 x\). The point is not that \(u=\sec x\) is forbidden. The point is that its full differential must be accounted for.
Use Trigonometric Identities with the Correct Sign
The identity \(\sec^2 x=1+\tan^2 x\) rearranges to \(\tan^2 x=\sec^2 x-1\), not \(\sec^2 x+1\). A sign error here can produce a plausible-looking expression whose derivative differs from the integrand.
Worked Example: Correcting a Sign Error
Evaluate \(\int \tan^2 x\sec^2 x\,dx\). A faulty rewrite uses \(\tan^2 x=\sec^2 x+1\), turning the integral into \(\int(\sec^4 x+\sec^2 x)\,dx\). Using \(u=\tan x\), one has \(\int\sec^4 x\,dx=\int(1+u^2)\,du =\tan x+\tan^3 x/3\), and \(\int\sec^2 x\,dx=\tan x\). The faulty result is therefore \(2\tan x+\tan^3 x/3+C\).
Differentiate that result:
The extra \(2\sec^2 x\) shows that it is not an antiderivative of the given integrand. Use the correct substitution directly: with \(u=\tan x\), \(du=\sec^2 x\,dx\), so
The check is \(\frac{d}{dx}(\tan^3 x/3)=\tan^2 x\sec^2 x\), exactly the original integrand.
Parity Is a Guide, Not a Substitute for Checking
For nonnegative integer powers, certain parity patterns suggest convenient ways to expose a derivative factor. An odd power of \(\tan x\) can leave one \(\tan x\) available, while even powers of \(\tan x\) can be rewritten using \(\tan^2 x=\sec^2 x-1\). An odd power of \(\sec x\) can leave a \(\sec x\tan x\,dx\) factor when a tangent factor is also present. The remaining factors must still become an expression in the chosen substitution.
A common mistake is to memorize a parity rule and then claim that the substitution has worked before checking the leftover factors. For instance, with \(u=\tan x\), the differential is \(\sec^2 x\,dx\); any remaining secant factor must still be expressed correctly in terms of \(u\). With \(u=\sec x\), the differential is \(\sec x\tan x\,dx\); a remaining tangent factor is not automatically a polynomial in \(u\).
Worked Example: Using the Matching Parity Pattern
Consider \(\int \tan^3 x\sec^3 x\,dx\). Both powers are odd, so the factor \(\sec x\tan x\,dx\) is available. Let \(u=\sec x\), so \(du=\sec x\tan x\,dx\). The remaining factors are \(\tan^2 x\sec^2 x\), and \(\tan^2 x=u^2-1\), \(\sec^2 x=u^2\). Therefore,
To check, differentiate:
This recovers the integrand. The parity observation helped identify a useful factor, but the substitution was justified by rewriting every remaining factor in \(u\).
Logarithmic Antiderivatives Need Domain Care
A logarithm often appears when the integrand has the form \(g'(x)/g(x)\). For real-valued antiderivatives, the relevant formula on an interval where \(g(x)\ne 0\) is \(\int g'(x)/g(x)\,dx=\ln|g(x)|+C\). The absolute value matters when \(g\) can be negative. The formula follows from \(\frac{d}{dx}\ln|g(x)|=g'(x)/g(x)\) wherever \(g(x)\ne0\).
In particular, \(\sec x\) has the antiderivative \(\ln|\sec x+\tan x|\). Here is the derivation, including why the logarithm is defined on each interval where \(\cos x\ne0\).
Since \((\sec x+\tan x)(\sec x-\tan x)=\sec^2 x-\tan^2 x=1\), the quantity \(\sec x+\tan x\) is nonzero wherever \(\sec x\) and \(\tan x\) are defined. Thus this multiplication is valid.
The derivative of \(\sec x+\tan x\) is \(\sec x\tan x+\sec^2 x\), which is the numerator produced by the multiplication.
The resulting quotient is \(g'(x)/g(x)\) for \(g(x)=\sec x+\tan x\), so its antiderivative is \(\ln|g(x)|+C\).
Worked Example: Correcting a Logarithmic Antiderivative
A proposed antiderivative for \(\int\sec x\,dx\) is sometimes written as \(\ln(\sec x+\tan x)\), without absolute values. On intervals where \(\sec x+\tan x<0\), that expression is not real-valued, so it cannot serve as a real antiderivative there. The corrected result is \(\ln|\sec x+\tan x|+C\), on any interval where \(\cos x\ne0\).
Check the corrected expression. Since \(\sec x+\tan x\ne0\) on such an interval,
The check establishes both the derivative and the reason the logarithm applies. Dropping the absolute value may happen to work on intervals where the argument is positive, but it does not give a real-valued formula on every interval of definition.
A Reliable Error-Checking Routine
When an answer to a tangent-secant integral looks plausible, test the steps that are most likely to hide an error. In particular, confirm the trigonometric identity, the full differential, and the derivative of the final expression. The following routine is short enough to use while solving:
- State the substitution. Write \(u=\tan x\) or \(u=\sec x\), as appropriate.
- Write its differential. Use \(du=\sec^2 x\,dx\) or \(du=\sec x\tan x\,dx\).
- Rewrite every leftover factor. Use \(\tan^2 x=\sec^2 x-1\) or \(\sec^2 x=1+\tan^2 x\), with the correct sign.
- Check the domain. Work on intervals where the original integrand is defined, and use absolute values in real logarithmic antiderivatives when needed.
- Differentiate the final answer. Simplify until it matches the original integrand exactly.
Differentiation is an especially effective check because an indefinite integral claims that the proposed expression has a particular derivative. A mismatch is decisive: the expression is not an antiderivative, regardless of how familiar the intermediate steps looked.
Check Your Understanding
For each question, identify the step that needs checking before accepting the result.
- For \(u=\sec x\), what complete factor must appear with \(dx\) to produce \(du\)?
- Rewrite \(\tan^2 x\) in terms of \(\sec^2 x\). What sign is required?
- Why does the substitution \(u=\tan x\) fit \(\int \tan^3 x\sec^2 x\,dx\) directly?
- What is the real-valued antiderivative of \(\sec x\) on an interval where \(\cos x\ne0\), and why is the absolute value used?
- What calculation can confirm that a proposed antiderivative is correct?