Tutorials › Calculus II › Evaluating Higher Tangent Powers By Recurrence

Tangent and Secant Powers · Tutorial 136 of 998

Evaluating Higher Tangent Powers By Recurrence

Use the tangent-power recurrence to reduce higher powers to elementary terms, then verify the resulting antiderivatives.

Intermediate 9 min read

What You'll Learn

  • State the tangent-power recurrence and its domain conditions
  • Reduce even powers to the integral of 1 and odd powers to the integral of tangent
  • Evaluate fourth-, fifth-, and sixth-power tangent integrals step by step
  • Track signs correctly as the recurrence is applied
  • Check each result by differentiating it

Why Reduce a Tangent Power?

Integrals such as \(\int \tan^6 x\,dx\) can look difficult because the power is high. The useful observation is that tangent and secant are related by \(\sec^2 x=1+\tan^2 x\), while the derivative of \(\tan x\) is \(\sec^2 x\). Together, these facts let us lower the tangent power by two at each step.

The recurrence does not immediately give a final answer for every power. It gives a reliable sequence of simpler integrals, ending at one of two basic cases. An even power eventually reduces to \(\int 1\,dx\); an odd power eventually reduces to \(\int\tan x\,dx\). Keeping track of the subtraction in the recurrence is essential.

The Recurrence and Its Base Integrals

Recurrence: For an integer \(n\ge 2\), on any interval where \(\cos x\ne 0\), let \(I_n=\int \tan^n x\,dx\). Then $$ I_n=\frac{\tan^{n-1}x}{n-1}-I_{n-2}. $$ The base antiderivatives are \(I_0=x\) and \(I_1=-\ln|\cos x|\). Each antiderivative is understood up to an additive constant.

The restriction \(\cos x\ne 0\) matters because tangent is undefined when cosine is zero. The antiderivative formula is used on intervals that do not cross such points. The logarithm in the odd base case is defined there because \(\cos x\) does not vanish.

To see why the recurrence works, use \(\tan^2 x=\sec^2 x-1\) to separate off two powers:

$$ \tan^n x =\tan^{n-2}x(\sec^2 x-1) =\tan^{n-2}x\sec^2 x-\tan^{n-2}x. $$

Integrating both terms gives \(\int \tan^{n-2}x\sec^2 x\,dx-I_{n-2}\). In the first integral, the substitution \(u=\tan x\), \(du=\sec^2 x\,dx\), changes the integrand into \(u^{n-2}\,du\). Since \(n\ge2\), its antiderivative is \(u^{n-1}/(n-1)\). Substituting back proves the recurrence.

$$ \int \tan^{n-2}x\sec^2 x\,dx =\int u^{n-2}\,du =\frac{u^{n-1}}{n-1} =\frac{\tan^{n-1}x}{n-1}. $$

The recurrence lowers the index by two, so it must eventually reach \(I_0\) or \(I_1\). This explains the parity pattern: even powers finish with \(x\), while odd powers finish with \(-\ln|\cos x|\).

Worked Example: Evaluating a Fourth Power

Worked Example: Evaluating \(\int \tan^4 x\,dx\)

Apply the recurrence with \(n=4\). The denominator is \(n-1=3\), and the remaining integral has power \(4-2=2\):

$$ I_4=\frac{\tan^3 x}{3}-I_2. $$

Apply it once more to \(I_2\), then use the base integral \(I_0=x\):

$$ I_2=\frac{\tan x}{1}-I_0 =\tan x-x. $$

Substitute this result into the expression for \(I_4\), distributing the minus sign across both terms:

$$ I_4 =\frac{\tan^3 x}{3}-(\tan x-x) =\frac{\tan^3 x}{3}-\tan x+x+C. $$

Check by differentiation. The derivative of the proposed antiderivative is

$$ \frac{d}{dx}\left(\frac{\tan^3 x}{3}-\tan x+x\right) =\tan^2 x\sec^2 x-\sec^2 x+1 =\sec^2 x(\tan^2 x-1)+1. $$

Using \(\sec^2 x=1+\tan^2 x\), the last expression is \(\tan^4 x\): indeed, \((1+\tan^2 x)(\tan^2 x-1)+1=\tan^4 x-1+1=\tan^4 x\). The derivative matches the integrand.

Worked Example: Evaluating an Odd Power

Worked Example: Evaluating \(\int \tan^5 x\,dx\)

Since \(5\) is odd, repeated reduction will end at \(I_1\). First reduce \(I_5\):

$$ I_5=\frac{\tan^4 x}{4}-I_3. $$

Reduce \(I_3\), then insert the base case \(I_1=-\ln|\cos x|\):

$$ I_3=\frac{\tan^2 x}{2}-I_1 =\frac{\tan^2 x}{2}+\ln|\cos x|. $$

Now substitute the complete expression for \(I_3\) into \(I_5\). The minus sign applies to both terms in \(I_3\):

$$ I_5 =\frac{\tan^4 x}{4} -\left(\frac{\tan^2 x}{2}+\ln|\cos x|\right) =\frac{\tan^4 x}{4}-\frac{\tan^2 x}{2}-\ln|\cos x|+C. $$

Differentiate to check the answer. Since \(\frac{d}{dx}\ln|\cos x|=-\tan x\) wherever \(\cos x\ne0\),

$$ \frac{d}{dx}\left(\frac{\tan^4 x}{4}-\frac{\tan^2 x}{2}-\ln|\cos x|\right) =\tan^3 x\sec^2 x-\tan x\sec^2 x+\tan x. $$

Group the last two terms and use \(\sec^2 x-1=\tan^2 x\):

$$ \tan^3 x\sec^2 x-\tan x(\sec^2 x-1) =\tan^3 x\sec^2 x-\tan^3 x =\tan^3 x(\sec^2 x-1) =\tan^5 x. $$

The derivative is the original integrand, as required.

Worked Example: Evaluating a Sixth Power

Worked Example: Evaluating \(\int \tan^6 x\,dx\)

Reduce \(I_6\) to \(I_4\), then use the fourth-power result already derived:

$$ I_6=\frac{\tan^5 x}{5}-I_4 =\frac{\tan^5 x}{5}-\left(\frac{\tan^3 x}{3}-\tan x+x\right). $$

Distribute the minus sign and collect the terms:

$$ I_6 =\frac{\tan^5 x}{5}-\frac{\tan^3 x}{3}+\tan x-x+C. $$

For a direct check, differentiate each term:

$$ \frac{d}{dx}\left(\frac{\tan^5 x}{5}-\frac{\tan^3 x}{3}+\tan x-x\right) =\tan^4 x\sec^2 x-\tan^2 x\sec^2 x+\sec^2 x-1. $$

Factor \(\sec^2 x\) from the first three terms and then use \(\sec^2 x=1+\tan^2 x\):

$$ \sec^2 x(\tan^4 x-\tan^2 x+1)-1 =(1+\tan^2 x)(\tan^4 x-\tan^2 x+1)-1. $$

Expanding the product gives \(\tan^6 x+1\), so subtracting \(1\) leaves \(\tan^6 x\). Thus the differentiated expression agrees with the integrand.

A Reliable Reduction Process

For a specified integer power, organize the work so that each use of the recurrence is visible. This makes the eventual base case and the signs easier to track.

1
Check the power and domain.
Confirm that the exponent is an integer at least \(2\), and work on an interval where \(\cos x\ne0\).
2
Reduce by two.
Replace \(I_n\) with \(\tan^{n-1}x/(n-1)-I_{n-2}\), keeping the subtraction explicit.
3
Continue to a base case.
Stop at \(I_0=x\) for an even power or \(I_1=-\ln|\cos x|\) for an odd power.
4
Simplify and check.
Substitute the lower-power results, distribute every minus sign, and differentiate the final expression.

At each step, the power in the explicit tangent term is one less than the current index, while the integral that remains has index two less. Writing both parts before proceeding helps prevent an incorrect denominator or a missed sign.

Common Pitfall: Losing a Minus Sign

A frequent error is to turn the recurrence into addition. For example, the recurrence for \(I_4\) is \(I_4=\tan^3 x/3-I_2\), not \(\tan^3 x/3+I_2\). Using the incorrect sign produces

$$ \frac{\tan^3 x}{3}+I_2 =\frac{\tan^3 x}{3}+\tan x-x. $$

This is not an antiderivative of \(\tan^4 x\). Differentiating it gives \(\tan^2 x\sec^2 x+\sec^2 x-1\), which simplifies to \(\tan^4 x+2\tan^2 x\), not \(\tan^4 x\). The correction is to retain the subtraction from the recurrence and distribute it carefully:

$$ \frac{\tan^3 x}{3}-I_2 =\frac{\tan^3 x}{3}-(\tan x-x) =\frac{\tan^3 x}{3}-\tan x+x. $$

The differentiation check detects the error immediately. It is especially useful after several reductions, when nested parentheses can obscure the signs.

Why the Recurrence Is Useful

The recurrence replaces a higher-power integral with an elementary tangent term and an integral of lower power. Repeating it gives a systematic method for any specified nonnegative integer power, without requiring a new strategy for each exponent. The parity of the exponent tells you which base case will appear, and differentiation confirms that the accumulated terms are correct.

Keep the scope of the formula in view: it evaluates powers of tangent by reducing them to lower tangent powers. The recurrence does not remove the need to respect where tangent is defined, and the logarithmic base term must retain its absolute value. On any interval avoiding zeros of cosine, the resulting antiderivative is valid up to an arbitrary constant.

Check Your Understanding

Use the recurrence and verify your results by differentiation.

  1. Write the recurrence for \(I_n\), including the condition on \(n\) and the domain restriction.
  2. Reduce \(I_2\) to its base integral and state the resulting antiderivative.
  3. Which base integral is reached when reducing an odd power, and which when reducing an even power?
  4. Find \(\int \tan^3 x\,dx\) by recurrence. What sign appears before the logarithmic term?
  5. Explain why replacing the subtraction in the recurrence by addition cannot give the correct \(I_4\).

Test yourself: Calculus II final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon