y"+2y'/x=1/x-1 after dividing through by x.
e∫2dx/x=eln(x²)=x2. This is an integrating factor:
x2y"+2xy'=x-x2,
d(x2y')/dx=x-x2,
x2y'=½x2-⅓x3+c1, where c1 is a constant, divide through by x2:
dy/dx=½-⅓x+c1x-2,
y=½x-⅙x2-c1/x+c2.
y'(1)=1 so ½-⅓+c1=1, c1=⅚; y(1)=2 so:
y=½-⅙-⅚+c2=2, c2=5/2.
y=½x-⅙x2-5/(6x)+5/2.
CHECK
y'=½-⅓x+⅚x-2; y"=-⅓-5/(3x3).
xy"=-⅓x-5/(3x2); 2y'=1-⅔x+5/(3x)2;
xy"+2y'+x=-⅓x-5/(3x2)+1-⅔x+5/(3x)2+x=1✔️