On this page
tan⁴x is not on the list of standard integrals, and putting u = tan x straight away leaves you with an awkward fraction, ∫u⁴/(1 + u²) du. The move that does work is a single identity, used again and again: tan²x = sec²x − 1. Each time you use it, you split off a piece of the form tanⁿx sec²x, which a substitution finishes in one line.
Why does tan²x = sec²x − 1 make tan⁴x easy?
Two facts do all the work. First, the derivative of tan x is sec²x, as stated in OpenStax Calculus Volume 1, section 3.5. So any integrand shaped like tanⁿx sec²x becomes ∫uⁿ du once you put u = tan x.
Second, sec²x and tan²x always differ by exactly 1. That is the identity 1 + tan²x = sec²x rearranged, and it is the gap you see between the two curves in the diagram above. Swapping one tan²x for (sec²x − 1) turns a power of tan into one piece you can integrate straight away and one smaller power of tan.
How do you integrate tan⁴x step by step?
Split off one tan²x: tan⁴x = tan²x · tan²x = tan²x(sec²x − 1) = tan²x sec²x − tan²x.
Integrate the first piece with u = tan x, du = sec²x dx: ∫tan²x sec²x dx = ∫u² du = (1/3)tan³x.
The leftover is ∫tan²x dx. Peel again: tan²x = sec²x − 1.
Integrate that: ∫(sec²x − 1) dx = tan x − x.
Put it together, minding the minus sign from step 1: ∫tan⁴x dx = (1/3)tan³x − (tan x − x) + C = (1/3)tan³x − tan x + x + C.
This matches the result in OpenStax Calculus Volume 2, section 3.2 on trigonometric integrals, by Gilbert Strang and Edwin Herman. A common slip comes in step 5: writing − tan x − x, because the minus sign in front of ∫tan²x has to apply to both of its terms.
To check your answer, differentiate it. The derivative of (1/3)tan³x − tan x + x is tan²x sec²x − sec²x + 1. Factor the first two terms: sec²x(tan²x − 1) + 1. Write sec²x as tan²x + 1 and you get (tan²x + 1)(tan²x − 1) + 1 = tan⁴x − 1 + 1 = tan⁴x.
What changes for tan³x, the odd case?
Peel in the same way: tan³x = tan x · tan²x = tan x(sec²x − 1) = tan x sec²x − tan x. The first piece is fine: with u = tan x it gives (1/2)tan²x. But this time the leftover is a single tan x, not a constant. You can't peel it any further, so you need its standard integral, ∫tan x dx = ln|sec x| + C.
That gives ∫tan³x dx = (1/2)tan²x − ln|sec x| + C, which is the same answer OpenStax works out in its trigonometric integrals section. The modulus matters, because sec x is negative on part of the domain. Our post on why the integral of 1/x is ln|x| explains where it comes from, and how to integrate sec x and cosec x covers the related log forms.
You may also see (1/2)sec²x − ln|sec x| + C. It is not wrong: because sec²x = tan²x + 1, the two answers differ only by a constant.
Is there a formula for any power of tan x?
Yes. Applying the peel once to tanⁿx gives the reduction formula listed in the same OpenStax section: ∫tanⁿx dx = (1/(n − 1))tanⁿ⁻¹x − ∫tanⁿ⁻²x dx. Each step lowers the power by 2, so where you end up depends on whether you started with an even or odd power.
Even power (tan⁴x, tan⁶x): you end at ∫1 dx = x, so the answer has a plain x term with alternating signs.
Odd power (tan³x, tan⁵x): you end at ∫tan x dx, so the answer has a ln|sec x| term.
For example, tan⁶x gives (1/5)tan⁵x − (1/3)tan³x + tan x − x + C. If you want to see how formulas like this are built, read how to derive a reduction formula, step by step.
How should you practise this?
In one sitting, work through tan²x, tan³x, tan⁴x, tan⁵x and tan⁶x in that order. Write out every peel instead of jumping to the formula, and differentiate each answer to check it. Then mix in look-alikes such as tan²x sec²x, which needs one substitution and no peel.
If you make the same sign mistake twice, a step-by-step solver can show you where it happens. The Fermi Problem Library has worked problems with a solver that explains the reasoning rather than just printing an answer. If the identities themselves are shaky, the Fermi Concept Library has a lesson for each concept in mathematics, so you can go back to sec²x and its derivative before you return to the powers.



