We have,
y=aex+be−x+x2.......(1)
On differentiating this with respect to x and we get,
dydx=ddx(aex+be−x+x2)
dydx=aex−be−x+2x.......(2)
Again, differentiating and we get,
d2ydx2=ddx(aex−be−x+2x)
=aex+be−x+2.......(3)
Now given equation.
xd2ydx2+2dydx−xy+x2−2=0
By equation (1), (2) and (3) value put in given equation.
⇒x(aex+be−x+2)+2(aex−be−x+2x)−x(aex+be−x+x2)+x2−2=0
⇒axex+bxe−x+2x+2aex−2be−x+4x−axex−bxe−x−x3+x2−2=0
⇒2aex−2be−x+6x−x3+x2−2=0
Hence, this is the general solution.