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 — Rewrite the fraction.
The integrand needs 1−cos2x=0, so x=nπ. We use 1−cos2x=2sin2x and sin2x=2sinxcosx, and split the fraction.
1−cos2x2−sin2x=2sin2x2−2sin2x2sinxcosx
1−cos2x2−sin2x=cosec2x−cotx
Step 2 — Choose f(x).
We take f(x)=−cotx; since the derivative of cotx is −cosec2x, we get the other term.
f′(x)=cosec2x
Step 3 — Match the pattern.
The integrand is ex[f(x)+f′(x)], so the integral is exf(x).
I=−excotx+C
Step 4 — Check by differentiating.
The derivative of −excotx is −excotx+excosec2x, which is the integrand written as in Step 1.
Therefore, ∫ex1−cos2x2−sin2xdx=−excotx+C, for x=nπ.