Given function: $y=ae^{x}+be^{-x}+x^{2}$
Differentiating with respect to $x$:
$\frac{dy}{dx} = ae^{x} - be^{-x} + 2x$
Differentiating again with respect to $x$:
$\frac{d^{2}y}{dx^{2}} = ae^{x} + be^{-x} + 2$
Substitute $\frac{dy}{dx}$ and $\frac{d^{2}y}{dx^{2}}$ into the $L$.$H$.$S$. of the differential equation:
$L.H.S. = x(ae^{x} + be^{-x} + 2) + 2(ae^{x} - be^{-x} + 2x) - x(ae^{x} + be^{-x} + x^{2}) + x^{2} - 2$
$= axe^{x} + bxe^{-x} + 2x + 2ae^{x} - 2be^{-x} + 4x - axe^{x} - bxe^{-x} - x^{3} + x^{2} - 2$
$= 2ae^{x} - 2be^{-x} - x^{3} + x^{2} + 6x - 2$
Since $L.H.S. \neq 0$,the given function is not a solution of the differential equation.