Answer
$y=2e^x+\frac{1}{2}x^2e^x-xe^x$
Work Step by Step
$y''-y'=xe^x$
$r^2-r=0$
$r(r-1)=0$
$r=0$ v $r=1$
$y=c_{1}+c_{2}e^x$
$y_{p}=x(Ax+B)e^x=Ax^2+Bxe^x$
$y_{p}'=(2Ax+Ax^2)e^x+(Bx+B)e^x$
$y_{p}''=(Ax^2+4Ax+2A)e^x+(Bx+2B)e^x$
$(Ax^2+4Ax+2A)e^x+(Bx+2B)e^x+(Bx+2B)e^x=(2Ax+2A)e^x+Be^X=xe^x$
$(2A)xe^x+(2A+B)e^x=xe^x$
$A=\frac{1}{2}$ and $B=-1$
$y_{p}=\frac{1}{2}x^2e^x-xe^x$
$y=c_{1}+c_{2}e^x+\frac{1}{2}x^2e^x-xe^x$
$y(0)=2$ which indicates $c_{1}+c_{2}=2$
$y'=0+c_{2}+xe^x+\frac{1}{2}x^2e^x-e^x-xe^x$
$y'(0)=c_{2}+0+0-1+0$ gives $y'(0)=c_{2}-1=1$
$c_{1}=0$ and $c_{2}=2$
$y=2e^x+\frac{1}{2}x^2e^x-xe^x$