Answer
$y=e^{-\cos x}(x+1)$
Work Step by Step
We are given:
$$\frac{dy}{dx}-(\sin x)y=e^{-\cos x}$$
Integrating factor is:
$$I=e^{\int -\sin x dx}=e^{\cos x}$$
The equation becomes:
$$\frac{d}{dx}(ye^{\cos x})=e^{-\cos x}e^{\cos x}=1$$
Integrating both sides:
$$ye^{\cos x}=x+C$$
$C$ is an integration constant
$$y=e^{-\cos x}(x+C)$$
We are given $y(0)=\frac{1}{e}$
$$e^{-1}=e^{\cos 0}C=e^{-1}C$$
$$\rightarrow C=1$$
The final solution is:
$$y=e^{-\cos x}(x+1)$$