Let \( I = \int e^{\sin x} \cdot \frac{x \cos^3 x - \sin x}{\cos^2 x} \, dx \).
Rewrite the integrand:
\[
\frac{x \cos^3 x}{\cos^2 x} - \frac{\sin x}{\cos^2 x} = x \cos x - \tan x \cdot \sin x
\]
Then let us use substitution:
Let \( u = \sin x \Rightarrow du = \cos x dx \). Further, recognizing the derivative of \( x \cos x \) terms, the expression matches:
\[
\frac{d}{dx} \left( e^{\sin x} (x - \sec x) \right)
\]
Hence the result is:
\[
e^{\sin x}(x - \sec x) + C
\]