We start with the given integral
I=∫cos2θ(tan2θ+sec2θ)dθ.
First we rewrite the terms inside the integrand by using the double-angle formulas
tan2θ=1−tan2θ2tanθ,sec2θ=cos2θ1=1+tan2θ1−tan2θ1=1−tan2θ1+tan2θ.
Adding these two expressions we obtain
tan2θ+sec2θ=1−tan2θ2tanθ+1−tan2θ1+tan2θ=1−tan2θ2tanθ+1+tan2θ=1−tan2θ(tanθ+1)2.
Substituting this result into the original integrand, we get
cos2θ(tan2θ+sec2θ)1=cos2θ1(tanθ+1)21−tan2θ.
Because cos2θ1=sec2θ, the integrand becomes
sec2θ(tanθ+1)21−tan2θ.
Now we perform the substitution t=tanθ, so that dt=sec2θdθ. With this substitution the integral simplifies to
I=∫(t+1)21−t2dt.
Since 1−t2=(1−t)(1+t), we can cancel one factor of 1+t with the denominator:
(t+1)21−t2=(t+1)2(1−t)(1+t)=t+11−t.
Next we divide the numerator by the denominator:
t+11−t=−1+t+12,because −1⋅(t+1)+2=1−t.
Thus the integral becomes
I=∫(−1+t+12)dt=∫(−1)dt+2∫t+1dt.
Evaluating each part gives
∫(−1)dt=−t,2∫t+1dt=2ln∣t+1∣.
Therefore
I=−t+2ln∣t+1∣+C.
Finally, recalling that t=tanθ, we have
I=−tanθ+2loge∣1+tanθ∣+C.
Comparing this with the required form λtanθ+2loge∣f(θ)∣+C, we identify
λ=−1,f(θ)=1+tanθ.
Hence, the correct answer is Option C.