Rewrite the ODE
[tex]\dfrac{\mathrm dy}{\mathrm dx}=xe^x+y[/tex]
as
[tex]\dfrac{\mathrm dy}{\mathrm dx}-y=xe^x[/tex]
Divide both sides by [tex]e^x[/tex]:
[tex]e^{-x}\dfrac{\mathrm dy}{\mathrm dx}-e^{-x}y=x[/tex]
The left side condenses to the derivative of a product:
[tex]\dfrac{\mathrm d}{\mathrm dx}\left[e^{-x}y\right]=x[/tex]
Integrate both sides and solve for [tex]y[/tex]:
[tex]e^{-x}y=\displaystyle\int x\,\mathrm dx=\frac12x^2+C[/tex]
[tex]y=\dfrac12x^2e^x+Ce^x[/tex]
Given that [tex]y=0[/tex] when [tex]x=0[/tex], we find
[tex]0=\dfrac120^2e^0+Ce^0\implies C=0[/tex]
so that the solution is
[tex]\boxed{y(x)=\dfrac{x^2e^x}2}[/tex]
I'm not sure I understand the claim that [tex]x[/tex] must be less than 1...