We are told that
∫esecx(secxtanxf(x)+(secxtanx+sec2x))dx=esecxf(x)+C.
The antiderivative on the right is already exhibited.
Hence its derivative must reproduce the integrand on the left.
So we differentiate esecxf(x) with respect to x.
First, we recall two basic rules:
1. The product rule: dxd[u(x)v(x)]=u′(x)v(x)+u(x)v′(x).
2. The chain rule for the exponential function: dxdeg(x)=eg(x)g′(x).
We take u(x)=esecx and v(x)=f(x).
Using the product rule we write
dxd(esecxf(x))=dxd(esecx)f(x)+esecxf′(x).
Now, dxd(esecx)=esecxdxd(secx) by the chain rule,
and we know dxd(secx)=secxtanx.
Therefore
dxd(esecx)=esecxsecxtanx.
Substituting this result back, we get
dxd(esecxf(x))=esecxsecxtanxf(x)+esecxf′(x).
Thus the derivative equals
esecx(secxtanxf(x)+f′(x)).
This expression must coincide with the given integrand
esecx(secxtanxf(x)+(secxtanx+sec2x)).
Matching the two, we see that the coefficients of the common factor esecx must be equal, so
secxtanxf(x)+f′(x)=secxtanxf(x)+secxtanx+sec2x.
The secxtanxf(x) terms cancel on both sides, leaving the simple differential equation
f′(x)=secxtanx+sec2x.
Now we integrate both sides with respect to x to obtain f(x).
We treat the two terms separately:
• We know ∫secxtanxdx=secx+C1 because dxd(secx)=secxtanx.
• We also know ∫sec2xdx=tanx+C2 because dxd(tanx)=sec2x.
Adding the antiderivatives, we find
f(x)=secx+tanx+C,
where C is an arbitrary constant.
Any constant can be absorbed into the general constant of integration in the original integral,
so we may choose any convenient constant.
Among the given options, the expression matching this form is
f(x)=secx+tanx+21,
which is Option B.
Hence, the correct answer is Option B.