Official solution
\[{{dy} \over {dx}} + 2{\sin ^2}x = 1 + y\cos 2x\]
\[ \Rightarrow {{dy} \over {dx}} + ( - \cos 2x)y = \cos 2x\]
\[I.F. = {e^{\int { - \cos 2xdx} }} = {e^{ - {{\sin 2x} \over 2}}}\]
Solution of D.E.
\[y\left( {{e^{ - {{\sin 2x} \over 2}}}} \right) = \int {(\cos 2x)\left( {{e^{ - {{\sin 2x} \over 2}}}} \right)} dx + c\]
\[ \Rightarrow y\left( {{e^{ - {{\sin 2x} \over 2}}}} \right) = - {e^{ - {{\sin 2x} \over 2}}} + c\]
Given
\[y\left( {{\pi \over 4}} \right) = 0\]
\[ \Rightarrow 0 = - {e^{{{ - 1} \over 2}}} + c \Rightarrow c = {e^{{{ - 1} \over 2}}}\]
\[ \Rightarrow y\left( {{e^{ - {{\sin 2x} \over 2}}}} \right) = - {e^{ - {{\sin 2x} \over 2}}} + {e^{{{ - 1} \over 2}}}\]
at x = 0
\[y = - 1 + {e^{{{ - 1} \over 2}}}\]
\[ \Rightarrow y(0) = - 1 + {e^{{{ - 1} \over 2}}} \Rightarrow {(y(0) + 1)^2} = {e^{ - 1}}\]