Solution:
Key idea: The numerator sec2θdθ is the differential of tanθ, so t=tanθ gives a rational function of t, which we split into partial fractions.
Step 1 — Substitute t=tanθ.
We put tanθ=t, so sec2θdθ=dt, and factorise t3+4t=t(t2+4).
I=∫t(t2+4)dt
Step 2 — Split into partial fractions.
We write t(t2+4)1=tA+t2+4Bt+C, so 1=A(t2+4)+(Bt+C)t.
Putting t=0 gives A, and comparing the t2 and t terms gives B and C.
t=0:1At2 terms:A+BBt terms:C=4A=41=0=−41=0
Step 3 — Integrate.
We use ∫t2+4tdt=21log(t2+4).
I=41∫tdt−41∫t2+4tdt=41log∣t∣−81log(t2+4)+C
Step 4 — Combine the logs and put back t=tanθ.
Since 81log(t2+4)=41logt2+4, the two terms combine into one log.
I=41logt2+4t+C=41logtan2θ+4tanθ+C
Therefore, ∫tan3θ+4tanθsec2θdθ=41logtan2θ+4tanθ+C, where tanθ is defined and non-zero.