I'm stuck with this problem, and even after numerous tries, I can't seem to solve it. Please help me with this: $$\int{e^{\sin x}\biggl(\frac{x\cos^2{x}-\sin{x}}{\cos^2{x}}\biggr) dx}$$
Also, I'm always doubtful about how to proceed with indefinite integration problems which involve substitutions. While I know that they have to be solved by comparing them to some standard forms, I feel like there's more to it.
Could you please tell me how I should proceed and what's the catch in such problems?
I'd like to state that I know that we try to simplify the expression by substituting with a larger expression's elemental change, i.e $df(x)$.
Let us assume that the answer in the book is correct and let us compare
$$I=\frac d {dx} \left(e^{\sin(x)}(x - \sec(x))\right) \qquad \text{to} \qquad J=e^{\sin (x)}\left(\frac{x\cos^2(x)-\sin(x)}{\cos^2(x)}\right)$$ So $$I=e^{\sin (x)} (x \cos (x)-\tan (x) \sec (x))=e^{\sin (x)}\left(\frac{x\cos^\color{red}{3}(x)-\sin(x)}{\cos^2(x)}\right)$$
One more typo in a textbook !
The problem should be $$\int e^{\sin (x)}\left(\frac{x\cos^\color{red}{3}(x)-\sin(x)}{\cos^2(x)}\right)\,dx$$
Try this to confirm.
Edit
Using series expansion around $x=0$ $$I=-\frac{4 x^3}{3}-\frac{4 x^4}{3}-\frac{17 x^5}{15}+O\left(x^6\right)$$ $$J=-\frac{5 x^3}{6}-\frac{5 x^4}{6}-\frac{37 x^5}{40}+O\left(x^6\right)$$ are "quite" different.