Answer
$y=2e^{x}+\frac{1}{2}x^{2}e^{x}-xe^{x}$
Work Step by Step
$y''-y'=$
Use auxiliary equation
$r^{2}-r=0$
$r(r-1)=0$
$r_{1}=0$
$r_{2}=1$
$y_{c}=c_{1}e^{r_{1}x}+c_{2}e^{r_{2}x}$
$y_{c}=c_{1}+c_{2}e^{x}$
The particular solution is of the form $y_{p}=x(A+Bx)e^{x}$
It is not $y_{p}=Ae^{x}+Bxe^{x}$ because the coefficient of $xe^{x}$ is the same in the expression of $y''$ and $y'$ and when we substitute the expressions of $y''$ and $y'$ in the main equation, we get coefficient of $xe^{x}$ as $0$.
Assuming that $y_{p}=Axe^{x}+Bx^{2}e^{x}$
$y_{p}'=(Axe^{x}+Ae^{x})+(Bx^{2}e^{x}+2Bxe^{x})$
$y_{p}'=Axe^{x}+xe^{x}(A+2B)+Bx^{2}e^{x}$
$y_{p}''=Ae^{x}+[xe^{x}(A+2B)+e^{x}(A+2B)]+[Bx^{2}e^{x}+2Bxe^{x}]$
$y_{p}''=(2A+2B)e^{x}+xe^{x}(A+4B)+Bx^{2}e^{x}$
Substitute into the main differential equation
$((2A+2B)e^{x}+xe^{x}(A+4B)+Bx^{2}e^{x})-(Ae^{x}+xe^{x}(A+2B)+Bx^{x}e^{x})=xe^{x}$
$(A+2B)e^{x}+xe^{x}(2B)=xe^{x}$
$2B=1$
$B=\frac{1}{2}$
$A+2B=0$
$A=-2B$
$A=-2(\frac{1}{2})$
$A=-1$
Therefore
$y_{p}=\frac{1}{2}x^{2}e^{x}-xe^{x}$
$y=y_{c}+y_{p}$
$y=c_{1}+c_{2}e^{x}+\frac{1}{2}x^{2}e^{x}-xe^{x}$
First condition $y(0)=2$
$2=c_{1}+c_{2}e^{0}+\frac{1}{2}(0)^{2}e^{0}-(0)e^{0}$
$2=c_{1}+c_{2}$
Second condition $y'(0)=1$
$y'=c_{2}e^{x}+(\frac{1}{2}x^{2}e^{x}+xe^{x})-(xe^{x}+e^{x})$
$1=c_{2}e^{0}+(\frac{1}{2}(0)^{2}e^{0}+(0)e^{0})-((0)e^{0}+e^{0})$
$c_{2}=2$
Substitute $c_{2}=2$ in $c_{1}+c_{2}=2$ to get
$c_{1}=0$
Solution to the initial value problem is
$y=2e^{x}+\frac{1}{2}x^{2}e^{x}-xe^{x}$