Find $$ \int e^{x \sin x+\cos x} \left(\frac{x^4\cos^3 x-x \sin x+\cos x}{x^2\cos^2 x}\right) \, dx$$
My attempt:I tried putting $x \sin x+\cos x=t$ and cannot express it in the form of $\int e^t(f(t)+f'(t)) \, dt$
Find $$ \int e^{x \sin x+\cos x} \left(\frac{x^4\cos^3 x-x \sin x+\cos x}{x^2\cos^2 x}\right) \, dx$$
My attempt:I tried putting $x \sin x+\cos x=t$ and cannot express it in the form of $\int e^t(f(t)+f'(t)) \, dt$
On
You have the answer (without solution) as an answer and a very god hint. Here goes a way of thinking:
If we should have any chance to get this one, I think the primitive has to be in the form $$ e^{x\sin x+\cos x}f(x) $$ for some function $f$. Moreover, $$ De^{x\sin x+\cos x}f(x)=e^{x\sin x+\cos x}(f'(x)+x\cos x f(x)), $$ so our $f$ must satisfy $$ f'(x)+x\cos x f(x)=\frac{x^4\cos^3 x-x \sin x+\cos x}{x^2\cos^2 x}. $$ We observe that he first term in the right-hand side reads (upon division) $x^2\cos x$. By comparing, this suggests that our function $f$ could be written $$ f(x)=x+g(x) $$ for some function $g$. But then $g$ should satisfy $$ 1+g'(x)+x\cos x g(x)=\frac{-x \sin x+\cos x}{x^2\cos^2 x}, $$ or, moving the $1$ to the right-hand side, $$ g'(x)+x\cos x g(x)=\frac{-x \sin x+\cos x}{x^2\cos^2 x}-1. $$ Next, the $x^2\cos^2x$ in the denominator suggests that the function $g$ can be written $$ g(x)=\frac{h(x)}{x\cos x}, $$ for some function $h$. Differentiating gives $$ g'(x)+x\cos x g(x)=\frac{h'(x)x\cos x-h(x)(\cos x-x\sin x)}{x^2\cos^2x}+h(x). $$ Very lucky shot! With $h(x)=-1$, we are all set. Thus, a primitive is $$ e^{x\sin x+\cos x}\Bigl(x-\frac{1}{x\cos x}\Bigr) $$
\begin{align} & \int e^{x\sin x+\cos x}(\frac{x^4\cos^3x-x\sin^2x+\cos x}{x^2\cos^2x})dx\\ & \hspace{5mm} =\int e^{x\sin x+\cos x}(x^2\cos x-\frac{x\sin^2x-\cos x}{x^2\cos^2x})dx\\ & \hspace{5mm} =\int e^{x\sin x+\cos x}(x^2\cos x-\frac{x\tan^2x-\sec x}{x^2})dx \end{align}
Realize that $\frac{x\tan^2x-\sec x}{x^2}=\frac{d}{dx}\frac{\sec x}{x}$ and that you can make $\frac{\sec x}{x}$ appear elsewhere by factoring $x^2\cos x-1$ into $(x-\frac{\sec x}{x})(x\cos x)$. So the above is equal to:
\begin{align} & \int e^{x\sin x+\cos x} \left((x-\frac{\sec x}{x})(x\cos x)+1-\frac{x\tan^2x-\sec x}{x^2}\right) \, dx\\ &=\int \left[e^{x\sin x+\cos x}\left(x-\frac{\sec x}{x}\right)(x\cos x)+e^{x\sin x+\cos x}\left(1-\frac{x\tan^2x-\sec x}{x^2}\right)\right]dx \end{align}
Now realize that $e^{x\sin x+\cos x}(x\cos x)=\frac{d}{dx}e^{x\sin x+\cos x}$. The above is equal to: $$\int \left[\left(x-\frac{\sec x}{x}\right)\frac{d}{dx}(e^{x\sin x+\cos x})+e^{x\sin x+\cos x}\frac{d}{dx}\left(x-\frac{\sec x}{x}\right)\right]\,dx $$
Now, this looks exactly looks like the product rule with $u=x-\frac{\sec x}{x}$ and $v=e^{x\sin x+\cos x}$. So the integral is equal to $$(x-\frac{\sec x}{x})e^{x\sin x+\cos x}+C$$
(To be honest, I did use WolframAlpha to evaluate the integral and work backward to take the derivative by hand, and then reverse each step, but I don't see any other way of evaluating such a difficult integral by hand...)