# How to Integrate Tan(x)^4 and Tan(x)^5 -- Tan^4(x) and Tan^5(x)

TR Smith is a product designer and former teacher who uses math in her work every day.

The fourth and fifth powers of the tangent function can be written either as tan(x)^4 and tan(x)^5, or as tan^4(x) and tan^5(x). To integrate these functions, you need to apply trigonometric identities and use either the substitution u = tan(x) or w = sec(x). This tutorial will also show how to extend the method to higher powers of tangent. See also how to integrate tan(x)^2, tan(x)^3, tan(x)sec(x)^2, and sec(x)^3.

## How to Find the Antiderivative of Tan(x)^4

Using the trig identity tan(x)^2 = sec(x)^2 - 1, we can rewrite the integral of tan(x)^4 as

∫ tan(x)^4 dx
= ∫ [sec(x)^2 - 1]^2 dx
= ∫ sec(x)^4 - 2sec(x)^2 + 1 dx
= ∫ [tan(x)^2 + 1]sec(x)^2 - 2sec(x)^2 + 1
= ∫ tan(x)^2sec(x)^2 - sec(x)^2 + 1

This is equivalent to the sum of the integrals

∫ tan(x)^2 * sec(x)^2 dx - ∫ sec(x)^2 dx + ∫ 1 dx

The integral of sec(x)^2 is tan(x), and the integral of 1 is x. The only piece that's missing is the first part. Using the substitution u = tan(x) and du = sec(x)^2 dx, the first piece can be transformed into a simpler integral to give us

∫ tan(x)^2 * sec(x)^2 dx
= ∫ u^2 du
= (1/3)u^3 + C
= (1/3)tan(x)^3 + C

Putting everything together gives us the complete integral of tan(x)^4:

∫ tan(x)^4 dx = (1/3)tan(x)^3 - tan(x) + x + C

## How to Find the Antiderivative of Tan(x)^5

As in the previous integral calculation, we can start by applying the identity tan(x)^2 = sec(x)^2 - 1. This gives us

∫ tan(x)^5 dx
= ∫ tan(x)tan(x)^4 dx
= ∫ tan(x)[sec(x)^2 - 1]^2 dx
= ∫ tan(x)sec(x)^4 - 2tan(x)sec(x)^2 + tan(x) dx
= ∫ tan(x)sec(x)^4 dx - 2*∫ tan(x)sec(x)^2 dx + ∫ tan(x)dx

Let's integrate these three functions one at a time. For the first, we will use the substitution w = sec(x) and dw = sec(x)tan(x) dx. This gives us

∫ tan(x)sec(x)^4 dx
= ∫ tan(x)sec(x) * sec(x)^3 dx
= ∫ w^3 dw
= (1/4)w^4 + C
= (1/4)sec(x)^4 + C

For the second piece, we will use the same substitution w = sec(x) and dw = sec(x)tan(x) dx. This gives us

-2*∫ tan(x)sec(x)^2 dx
= -2*∫ tan(x)sec(x) * sec(x) dx
= -2*∫ w dw
= -w^2 + C
= -sec(x)^2 + C

And finally, for the third piece, the integral of tangent is Ln|cos(x)| + C. Putting all the pieces together gives us the complete integral of tan(x)^5:

∫ tan(x)^5 dx = (1/4)sec(x)^4 - sec(x)^2 + Ln|cos(x)| + C

## How to Integrate Tan(x)^[2n] and Tan(x)^[2n+1] -- Even and Odd Powers of Tangent

To integrate tan(x)^m, where m is an odd number, rewrite the integral as

∫ tan(x)^m dx
= ∫ tan(x)tan(x)^[m-1] dx
= ∫ tan(x)[sec(x)^2 - 1]^[(m-1)/2] dx

When you expand the expression in the integrand, you will get terms of the form

∫ tan(x) sec(x)^k dx
= ∫ sec(x)^[k-1] * tan(x)sec(x) dx

These can be worked out with the substitution w = sec(x) and dw = tan(x)sec(x) dx. For example, the integral of tan(x)^9 is

∫ tan(x)^9 dx =
(1/8)sec(x)^8 - (2/3)sec(x)^6 + (3/2)sec(x)^4 - 2sec(x)^2 - Ln|cos(x)| + C

To integrate tan(x)^p, where p is an even number, rewrite the integral as

∫ tan(x)^p dx
= ∫ tan(x)^[p-2] * [sec(x)^2 - 1] dx
= ∫ tan(x)^[p-2] * sec(x)^2 dx - ∫ tan(x)^[p-2] dx

The first part can be worked out using the substitution u = tan(x) and du = sec(x)^2 dx. The second part can be reduced further using the same trick, i.e., replacing one factor of tan(x)^2 with sec(x)^2 - 1. For example, the integral of tan(x)^8 is

∫ tan(x)^8 =
(1/7)tan(x)^7 - (1/5)tan(x)^5 + (1/3)tan(x)^3 - tan(x) + x + C

## Example Integration Problem

Find the exact area under the curve y = tan(x)^4 from x = 0 to x = 1. To solve this problem, we need to find the antiderivative of tan(x)^4. Using the work we did in the section above, we get

∫ tan(x)^4 dx
= (1/3)tan(x)^3 - tan(x) + x

Plugging in x = 1 and x = 0 into this expression and subtracting gives the exact area under the curve.

[(1/3)tan(1)^3 - tan(1) + 1] - [(1/3)tan(0)^3 - tan(0) + 0]

= (1/3)tan(1)^3 - tan(1) + 1, where tangent is in radians

≈ 0.701766

4

0

2

0

0

9

13

30