Answer
$y=x^3$ is not a solution to given differential equation.
Work Step by Step
We will find $y'$ and put it into the given differential equation along with $y$.
$$y'= (x^3)'=3x^2.$$
Putting this into the differential equation we get
The Left side:
$$xy'-2y= x\times 3x^2 -2x^3= 3x^3-2x^3=x^3.$$
The Right side:
$$x^3e^x.$$
We see that The Left side is NOT equal to the Right side for all $x$ so $y=x^3$ is not a solution to this differential equation.