Concept:
Use the substitution \(u=1+\sin x\). The derivative \(du=\cos x\,dx\) appears naturally in the integrand, allowing us to convert the trigonometric integral into a simple algebraic integral.
Step 1: Rewrite the numerator.
\[
I=\int \frac{\cos^3 x}{(1+\sin x)^4}\,dx
=\int \frac{\cos^2x\cos x}{(1+\sin x)^4}\,dx
\]
Using
\[
\cos^2x=1-\sin^2x,
\]
we get
\[
I=\int \frac{(1-\sin^2x)\cos x}{(1+\sin x)^4}\,dx.
\]
Factor the numerator:
\[
1-\sin^2x=(1-\sin x)(1+\sin x).
\]
Hence,
\[
I=\int \frac{(1-\sin x)\cos x}{(1+\sin x)^3}\,dx.
\]
Step 2: Apply substitution.
Let
\[
u=1+\sin x.
\]
Then
\[
du=\cos x\,dx,
\qquad
1-\sin x=2-u.
\]
Substituting,
\[
I=\int \frac{2-u}{u^3}\,du.
\]
\[
I=\int \left(\frac{2}{u^3}-\frac{1}{u^2}\right)du.
\]
Step 3: Integrate term-by-term.
\[
I
=
2\int u^{-3}\,du
-
\int u^{-2}\,du.
\]
\[
I
=
2\left(\frac{u^{-2}}{-2}\right)
-
\left(\frac{u^{-1}}{-1}\right)
+c.
\]
\[
I
=
-\frac{1}{u^2}
+\frac{1}{u}
+c.
\]
Substituting \(u=1+\sin x\),
\[
I
=
-\frac{1}{(1+\sin x)^2}
+\frac{1}{1+\sin x}
+c.
\]
\[
I
=
\frac{\sin x}{(1+\sin x)^2}
+c.
\]
Step 4: Express the result in the form of the options.
Using
\[
\cos^2x=(1-\sin x)(1+\sin x),
\]
we have
\[
\frac{\sin x}{(1+\sin x)^2}
=
-\frac{\cos^4x}{4(1+\sin x)^4}
+\text{constant}.
\]
Therefore, the antiderivative can be written as
\[
\boxed{
I=
-\frac{\cos^4x}{4(1+\sin x)^4}+c
}
\]
which matches option (D).