Let \( I = \int \frac{\cos 2x}{(\sin x + \cos x)^2} \, dx \).
Now, use the identity \( \cos 2x = \cos^2 x - \sin^2 x \) to express the numerator.
Also, observe that the denominator can be simplified using substitution. Let:
\[
u = \sin x + \cos x \quad \Rightarrow \quad du = (\cos x - \sin x) \, dx
\]
With this substitution, we get:
\[
I = \int \frac{du}{u^2}
\]
The integral of \( \frac{1}{u^2} \) is \( -\frac{1}{u} \), so the solution is:
\[
I = -\frac{1}{\sin x + \cos x} + C
\]