For trigonometric integrals, substitution is a powerful tool. Here, we used \( u = 1 + \sin x \) to simplify the expression and handle the powers of sine and cosine functions.
Step 1: Notice that the structure of the integral suggests using substitution and simplifying the expression. Let
\[
u = 1 + \sin x, \quad du = \cos x \, dx.
\]
Rewriting the integral with respect to \( u \), we have:
\[
\int \frac{(\sin^4 x + 2\cos^2x - 1) \cos x}{(1 + \sin x)^6} \, dx = - \frac{\cos^6 x}{6(1 + \sin x)^6} + c.
\]
\bigskip