#### Answer

$$y = \frac{1}{{2x}}{e^{2x}} - \frac{1}{{4{x^2}}}{e^{2x}} + \frac{C}{{{x^2}}}$$

#### Work Step by Step

$$\eqalign{
& x\frac{{dy}}{{dx}} + 2y - {e^{2x}} = 0 \cr
& {\text{this equation is not written in the form }}\frac{{dy}}{{dx}} + P\left( x \right)y = Q\left( x \right) \cr
& {\text{Add }}{e^{2x}}{\text{ to both sides}} \cr
& x\frac{{dy}}{{dx}} + 2y = {e^{2x}} \cr
& {\text{divide both sides of the equation by }}x \cr
& \frac{{dy}}{{dx}} + \frac{2}{x}y = \frac{{{e^{2x}}}}{x} \cr
& {\text{the equation is already written in the form }}\frac{{dy}}{{dx}} + P\left( x \right)y = Q\left( x \right) \cr
& {\text{ we can note that }}P\left( x \right){\text{ is }}\frac{2}{x} \cr
& {\text{The integrating factor is }}I\left( x \right) = {e^{\int {P\left( x \right)} dx}} \cr
& I\left( x \right) = {e^{\int {\frac{2}{x}} dx}} = {e^{2\ln \left| x \right|}} = {x^2} \cr
& {\text{multiplying both sides of the differential equation }}\frac{{dy}}{{dx}} + \frac{2}{x}y = \frac{{{e^{2x}}}}{x}{\text{ by }}{x^2} \cr
& {x^2}\frac{{dy}}{{dx}} + 2xy = x{e^{2x}} \cr
& {\text{Write the terms on the left in the form }}{D_x}\left[ {I\left( x \right)y} \right] \cr
& {D_x}\left[ {{x^2}y} \right] = x{e^{2x}} \cr
& {\text{solve for }}y{\text{ integrating both sides}} \cr
& {x^2}y = \int {x{e^{2x}}} dx\,\,\,\,\,\left( {\bf{1}} \right) \cr
& \cr
& {\text{integrating }}\int {x{e^{2x}}} dx{\text{ by parts}}{\text{,}}\,\,\,{\text{set }}u = x,\,\,\,\,du = dx,\,\,\,\,\,\,\,dv = {e^{2x}},\,\,\,\,\,\,\,v = \frac{1}{2}{e^{2x}}{\text{. then}} \cr
& \,\,\,\,\,\,\,\int {x{e^{2x}}} dx = \frac{1}{2}x{e^{2x}} - \frac{1}{2}\int {{e^{2x}}dx} \cr
& \,\,\,\,\,\,\,\int {x{e^{2x}}} dx = \frac{1}{2}x{e^{2x}} - \frac{1}{4}{e^{2x}} + C \cr
& {\text{substituting the result of }}\int {x{e^{2x}}} dx{\text{ in }}\left( {\bf{1}} \right) \cr
& {x^2}y = \frac{1}{2}x{e^{2x}} - \frac{1}{4}{e^{2x}} + C \cr
& y = \frac{1}{{2x}}{e^{2x}} - \frac{1}{{4{x^2}}}{e^{2x}} + \frac{C}{{{x^2}}} \cr} $$