Solution:
Key idea: We keep one sec2x as the derivative of tanx and write the other sec2x as 1+tan2x. Then the substitution t=tanx gives a polynomial in t.
Step 1 — Rewrite the integrand.
We split sec4x into two factors of sec2x.
sec4xtanx=sec2xtanx⋅sec2x
We use the identity sec2x=1+tan2x on the first factor only.
sec2xtanx⋅sec2x=(1+tan2x)tanxsec2x
Step 2 — Substitute.
We put tanx equal to t.
t=tanx
Differentiating both sides gives the new differential.
dt=sec2xdx
Step 3 — Integrate in terms of t.
The integrand becomes (1+t2)t, which we expand and integrate term by term.
∫sec4xtanxdx=∫(1+t2)tdt
∫(1+t2)tdt=∫(t+t3)dt
∫(t+t3)dt=2t2+4t4+C
Step 4 — Return to x.
We put back t=tanx.
2t2+4t4+C=21tan2x+41tan4x+C
Note: Putting t=secx instead gives 41sec4x+C. It differs from our answer only by a constant, because sec4x=1+2tan2x+tan4x.
Therefore, ∫sec4xtanxdx=21tan2x+41tan4x+C.