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 logsinx needs sinx>0, for example 0<x<π; we work on such an interval.
Step 2 — Choose f(x).
We try the term that is not an obvious derivative, f(x)=logsinx, and differentiate it by the chain rule.
f(x)=logsinx
f′(x)=sinxcosx
f′(x)=cotx
Step 3 — Match the pattern.
The bracket cotx+logsinx is exactly f′(x)+f(x), so the integral has the form ∫ex[f(x)+f′(x)]dx.
I=∫ex[f(x)+f′(x)]dx
I=exlogsinx+C
Step 4 — Check by differentiating.
By the product rule, the derivative of exlogsinx is exlogsinx+excotx, which is the integrand.
Therefore, ∫ex(cotx+logsinx)dx=exlogsinx+C, where sinx>0.