Solution:
Key idea: Use 1+tan2θ=sec2θ to create sec2θdθ, put t=tanθ, and split the resulting rational function into partial fractions using 1+t3=(1+t)(t2−t+1).
Step 1 — Create sec2θ in the numerator.
We take out tanθ from the numerator and use 1+tan2θ=sec2θ.
tanθ+tan3θ=tanθ(1+tan2θ)=tanθsec2θ
Step 2 — Substitute t=tanθ.
We put tanθ=t, so sec2θdθ=dt, and factorise the sum of cubes.
I=∫(1+t)(t2−t+1)tdt
Step 3 — Set up and solve the partial fractions.
We write (1+t)(t2−t+1)t=1+tA+t2−t+1Bt+C, so t=A(t2−t+1)+(Bt+C)(1+t).
Then we put t=−1 and compare coefficients.
t=−1:−1At2 terms:A+BBconstants:A+CC=3A=−31=0=31=0=31
Step 4 — Split the quadratic part.
The derivative of t2−t+1 is 2t−1, and 31(t+1)=61(2t−1)+21.
t2−t+131(t+1)=61⋅t2−t+12t−1+21⋅t2−t+11
Step 5 — Complete the square for the last piece.
Here t2−t+1=(t−21)2+(23)2, so the tan−1 form applies with a=23.
21∫t2−t+1dt=21⋅32tan−132t−1=31tan−132t−1
Step 6 — Integrate and put back t=tanθ.
The quadratic t2−t+1 is always positive, so its log needs no modulus.
I=−31log∣1+t∣+61log(t2−t+1)+31tan−132t−1+C=−31log∣1+tanθ∣+61log(tan2θ−tanθ+1)+31tan−132tanθ−1+C
Therefore, ∫1+tan3θtanθ+tan3θdθ=−31log∣1+tanθ∣+61log(tan2θ−tanθ+1)+31tan−132tanθ−1+C, where tanθ is defined and tanθ=−1.