Solution:
Key idea: We write tan2x=sec2x−1 twice, so that every term is either tan2xsec2x (substitute t=tanx) or a standard integral.
Step 1 — Rewrite tan4x.
We replace one factor tan2x by sec2x−1.
tan4x=tan2x(sec2x−1)
tan2x(sec2x−1)=tan2xsec2x−tan2x
We replace the last tan2x by sec2x−1 as well.
tan2xsec2x−tan2x=tan2xsec2x−sec2x+1
Step 2 — Integrate the first term by substitution.
We put tanx equal to t.
t=tanx
Differentiating both sides gives the new differential.
dt=sec2xdx
So the first term becomes a power of t.
∫tan2xsec2xdx=∫t2dt
∫t2dt=3t3
We put back t=tanx.
3t3=31tan3x
Step 3 — Integrate the remaining terms.
The integrals of sec2x and 1 are tanx and x.
∫(−sec2x+1)dx=−tanx+x
Step 4 — Add the parts.
We add Steps 2 and 3 and one constant of integration C.
∫tan4xdx=31tan3x−tanx+x+C
Therefore, ∫tan4xdx=31tan3x−tanx+x+C.