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.
sec4x=sec2x⋅sec2x
We use the identity sec2x=1+tan2x on the first factor only.
sec2x⋅sec2x=(1+tan2x)sec2x
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, which we integrate term by term.
∫sec4xdx=∫(1+t2)dt
∫(1+t2)dt=t+3t3+C
Step 4 — Return to x.
We put back t=tanx.
t+3t3+C=tanx+31tan3x+C
Therefore, ∫sec4xdx=tanx+31tan3x+C.