2.7   ODE No. 7

\[ y'(x)+y(x) \cos (x)-e^{-\sin (x)}=0 \] Mathematica : cpu = 0.0881956 (sec), leaf count = 23


\[\left \{\left \{y(x)\to x e^{-\sin (x)}+c_1 e^{-\sin (x)}\right \}\right \}\] Maple : cpu = 0.008 (sec), leaf count = 13


\[y \relax (x ) = \left (x +c_{1}\right ) {\mathrm e}^{-\sin \relax (x )}\]

Hand solution

\begin {equation} \frac {dy}{dx}+y\relax (x) \cos \relax (x) =e^{-\sin \left ( x\right ) }\tag {1} \end {equation}

Integrating factor \(\mu =e^{\int \cos dx}=e^{\sin x}\). Hence (1) becomes

\[ \frac {d}{dx}\left (\mu y\relax (x) \right ) =\mu e^{-\sin \left ( x\right ) }\]

Replacing \(\mu \) by \(e^{\sin x}\) and integrating both sides

\begin {align*} e^{\sin x}y\relax (x) & =\int e^{\sin x}e^{-\sin \relax (x) }dx+C\\ e^{\sin x}y\relax (x) & =\int dx+C\\ e^{\sin x}y\relax (x) & =x+C\\ y\relax (x) & =xe^{-\sin x}+Ce^{-\sin \relax (x) } \end {align*}