Answer
$$y = {x^2} + \frac{1}{{{x^2}}}$$
Work Step by Step
$$\eqalign{
& xy' + 2y = 4{x^2},\,\,\,\,\,\,\,\,\,\,\,\,\,{\text{initial condition }}y\left( 1 \right) = 2 \cr
& {\text{write }}y'{\text{ as }}\frac{{dy}}{{dx}} \cr
& x\frac{{dy}}{{dx}} + 2y = 4{x^2} \cr
& \frac{{dy}}{{dx}} + \frac{2}{x}y = 4x \cr
& \cr
& {\text{The equation is in the form }}\frac{{dy}}{{dp}} + p\left( x \right)y = q\left( x \right) \cr
& {\text{with }}p\left( x \right) = \frac{2}{x}{\text{ and }}q\left( x \right) = 4x \cr
& \cr
& {\text{Use the method of the integrating factors}}{\text{, calculate }}\mu = {e^{\int {p\left( x \right)dx} }} \cr
& \mu = {e^{\int {p\left( x \right)dx} }} = {e^{\int {\frac{2}{x}} dx}} \cr
& \mu = {e^{2\ln x}} = {x^2} \cr
& \cr
& {\text{Multiply both sides of the equation by }}\mu \cr
& {x^2}\frac{{dy}}{{dx}} + {x^2}\left( {\frac{2}{x}} \right)y = {x^2}\left( {4x} \right) \cr
& {x^2}\frac{{dy}}{{dx}} + 2xy = 4{x^3} \cr
& {\text{Express the result as }}\frac{d}{{dx}}\left[ {\mu y} \right] = {e^x}{\text{. Then}}{\text{,}} \cr
& \frac{d}{{dx}}\left[ {{x^2}y} \right] = 4{x^3} \cr
& {\text{Integrate both sides}} \cr
& {x^2}y = \int {4{x^3}} dx \cr
& {x^2}y = {x^4} + C \cr
& {\text{Solve for }}y \cr
& y = {x^2} + \frac{C}{{{x^2}}} \cr
& \cr
& {\text{Use the initial condition }}y\left( 1 \right) = 2 \cr
& 2 = {\left( 1 \right)^2} + \frac{C}{{{{\left( 1 \right)}^2}}} \cr
& C = 1 \cr
& \cr
& {\text{Then}}{\text{, the particular solution of the differential equation is}} \cr
& y = {x^2} + \frac{1}{{{x^2}}} \cr} $$