Answer
$$y = \frac{1}{{{e^x}}} + \frac{C}{{{e^{2x}}}}$$
Work Step by Step
$$\eqalign{
& {e^x}\frac{{dy}}{{dx}} + 2{e^x}y = 1 \cr
& {\text{Divide each term of the differential equation by }}{e^x} \cr
& \frac{{{e^x}}}{{{e^x}}}\frac{{dy}}{{dx}} + \frac{{2{e^x}y}}{{{e^x}}} = \frac{1}{{{e^x}}} \cr
& \frac{{dy}}{{dx}} + 2y = \frac{1}{{{e^x}}}\,\,\,\left( 1 \right) \cr
& {\text{The equation is written in the form }}\frac{{dy}}{{dx}} + P\left( x \right)y = Q\left( x \right) \cr
& P\left( x \right) = 2,\,\,\,Q\left( x \right) = \frac{1}{{{e^x}}} \cr
& {\text{The integrating factor is }}v\left( x \right) = {e^{\int {P\left( x \right)} dx}} = {e^{\int 2 dx}} = {e^{2x}} \cr
& {\text{Multiply the differential }}\left( 1 \right){\text{ equation by the integrating factor}} \cr
& {e^{2x}}\frac{{dy}}{{dx}} + 2{e^{2x}}y = \frac{{{e^{2x}}}}{{{e^x}}} \cr
& {e^{2x}}\frac{{dy}}{{dx}} + 2{e^{2x}}y = {e^x} \cr
& \cr
& {\text{Write the left - hand in the form }}\frac{d}{{dx}}\left[ {y{e^{2x}}} \right] \cr
& \frac{d}{{dx}}\left[ {y{e^{2x}}} \right] = {e^x} \cr
& {\text{Integrate both sides of the differential equation}} \cr
& y{e^{2x}} = \int {{e^x}} dx \cr
& y{e^{2x}} = {e^x} + C \cr
& {\text{Solve for }}y \cr
& y = \frac{{{e^x}}}{{{e^{2x}}}} + \frac{C}{{{e^{2x}}}} \cr
& y = \frac{1}{{{e^x}}} + \frac{C}{{{e^{2x}}}} \cr} $$