The homogeneous linear differential equation whose solution is y = x and y = x^2 is y'-(2/x) y'+(2/x 2) y = 0.
According to the structure theory of linear nonhomogeneous differential equations, the general solution of nonhomogeneous differential equations is y = c1x+c2x 2+e x x.
The nonhomogeneous linear differential equation is y'-(2/x) y'+(2/x 2) y = e x * (x 2-2 * x+2)/x 2.