Answer
\[y(x)=\cos hx\]
Work Step by Step
$(y-e^x)dx+dy=0$
$dy=(e^x-y)dx$
$\frac{dy}{dx}+y=e^x$ ___(1)
This is linear differential equation
Integrating factor:-
$I(x)=e^{\int 1dx}=e^x$
Multiply (1) by $e^x$
$e^x\frac{dy}{dx} +e^xy=e^{2x}$
$\frac{d}{dx}(ye^x)=e^{2x}$
Integrating,
$ye^x=\int e^{2x}dx+C$
$ye^x=\frac{e^{2x}}{2}+C$ ___(2)
Using initial condition $y(0)=1$
$1=\frac{1}{2}+C\;\Rightarrow C=\frac{1}{2}$
From (2)
$2ye^x=e^{2x}+1$
$y=\frac{e^x+e^{-x}}{2}=\cos hx$