Solution:
Concept: If f is differentiable, then ∫ex[f(x)+f′(x)]dx=exf(x)+C. To see why, differentiate exf(x) by the product rule: the result is exf(x)+exf′(x), which is exactly the integrand. So whenever the bracket is a function plus its own derivative, the answer is ex times that function.
Step 1 — Note where the integrand is defined.
The term log(secx+tanx) needs secx+tanx>0. This holds, for example, on −2π<x<2π, where secx+tanx=cosx1+sinx and both 1+sinx and cosx are positive.
Step 2 — Choose f(x) and differentiate it.
We take f(x)=log(secx+tanx) and use the chain rule: the derivative of logg is gg′.
f′(x)=secx+tanxsecxtanx+sec2x
Step 3 — Simplify the derivative.
We take out the common factor secx in the numerator; the bracket that remains cancels with the denominator.
f′(x)=secx+tanxsecx(tanx+secx)
f′(x)=secx
Step 4 — Match the pattern.
The bracket secx+log(secx+tanx) is f′(x)+f(x), so the integral is exf(x).
I=exlog(secx+tanx)+C
Step 5 — Check by differentiating.
The derivative of exlog(secx+tanx) is exlog(secx+tanx)+exsecx, which is the integrand.
Therefore, ∫ex[secx+log(secx+tanx)]dx=exlog(secx+tanx)+C, where secx+tanx>0 (for example −2π<x<2π).