Step 1: Understanding the Concept
Rewrite as \(\frac{y+1}{y}\,dy=-e^{x}(\cos^2x-\sin 2x)\,dx\).
Step 2: Spot the derivative
\(\frac{d}{dx}(e^{x}\cos^2x)=e^{x}\cos^2x-e^{x}\sin 2x=e^{x}(\cos^2x-\sin2x)\).
Step 3: Integrate
\(y+\log y=-e^{x}\cos^2x+k\), i.e. \(y+\log y+e^{x}\cos^2x=k\).
Step 4: Use the condition
At \(x=0,y=1\): \(1+0+1=k\), so \(k=2\). The solution is \(y+\log y+e^{x}\cos^2x=2\), option (D).
Final Answer:
The solution is y plus log y plus e to the x cos squared x equals 2.
\[ \boxed{\text{(D) }y+\log y+\mathrm{e}^{x}\cos^{2}x=2} \]