Solution:
We use the result
∫ex[f(x)+f′(x)]dx=exf(x)+C
Using sinx=2sin2xcos2x and 1+cosx=2cos22x,
1+cosx1+sinx=2cos22x1+2sin2xcos2x
=21sec22x+tan2x
So the integral becomes
∫ex(1+cosx1+sinx)dx=∫ex[tan2x+21sec22x]dx
Let f(x)=tan2x. Then
f′(x)=21sec22x
So the integrand is of the form ex[f(x)+f′(x)].
Therefore,
∫ex(1+cosx1+sinx)dx=extan2x+C