TITLE: How to integrate $e^{\sin x}(x \cos x - \tan x \sec x)$
QUESTION [7 upvotes]: How would on find the indefinite integral $e^{\sin x}(x \cos x - \tan x \sec x)$
Our professor gave it to us as a review question. He told us it was from an exam several years ago as extra credit, however no one answered it correctly.
I have been working on it for hours and cannot make a dent, I haven't made any progress! It isn't really important because there are no points awarded for it, however I would like to know how to do it

Solution based on input from Doc:

$\int e^{\sin x}(x \cos x -\tan x \sec x)\;dx$$\int (e^{\sin x}\cos x)(x)\;dx - \int e^{\sin x}( \tan x \sec x)\;dx$$\int (e^{\sin x})'(x)\;dx - \int e^{\sin x}(\sec x)'\;dx$$ e^{\sin x}x-\int e^{\sin x}\;dx - (e^{\sin x}\sec x-\int \cos x e^{\sin x}\sec x\;dx)$$ e^{\sin x}x-\int e^{\sin x}\;dx - e^{\sin x}\sec x+\int e^{\sin x}\;dx$$ e^{\sin x}x - e^{\sin x}\sec x+C$$ e^{\sin x}(x - \sec x)+C$

REPLY [4 votes]: Do it in two parts.  
For $\int e^{\sin{x}}x\cos{x}dx$ use integration by parts with $u=x$ and $dv=e^{\sin{x}}\cos{x}\, dx$.
For  $\int e^{\sin{x}}\tan{x}\sec{x}dx$ use integration by parts with $u=\sin{x}$ and $dv=\tan{x}\sec{x}\, dx$