Answer
$$\eqalign{
& \left( {\text{a}} \right)y = \sin x - 5{e^x} + 5 \cr
& \left( {\text{b}} \right)y = \frac{1}{2}{e^{{x^2}}} - \frac{1}{2} \cr} $$
Work Step by Step
$$\eqalign{
& \left( {\text{a}} \right)\frac{{dy}}{{dx}} = \cos x - 5{e^x} \cr
& {\text{Separate the variables}} \cr
& dy = \left( {\cos x - 5{e^x}} \right)dx \cr
& {\text{Integrate both sides with respect to }}x \cr
& y = \int {\left( {\cos x - 5{e^x}} \right)dx} \cr
& y = \sin x - 5{e^x} + C \cr
& {\text{Use the initial condition}} \cr
& 0 = \sin \left( 0 \right) - 5{e^0} + C \cr
& C = 5 \cr
& {\text{,then}} \cr
& y = \sin x - 5{e^x} + 5 \cr
& \cr
& \left( {\text{b}} \right)\frac{{dy}}{{dx}} = x{e^{{x^2}}} \cr
& {\text{Separate the variables}} \cr
& dy = x{e^{{x^2}}}dx \cr
& {\text{Integrate both sides with respect to }}x \cr
& y = \int {x{e^{{x^2}}}dx} \cr
& y = \frac{1}{2}\int {\left( {2x} \right){e^{{x^2}}}dx} \cr
& y = \frac{1}{2}{e^{{x^2}}} + C \cr
& {\text{Use the initial condition}} \cr
& 0 = \frac{1}{2}{e^{{{\left( 0 \right)}^2}}} + C \cr
& C = - \frac{1}{2} \cr
& {\text{,then}} \cr
& y = \frac{1}{2}{e^{{x^2}}} - \frac{1}{2} \cr} $$