Solution (source code)

= Solution

\b[Homogeneous equation.] Its <characteristic equation> is $r^2-r=r(r-1)=0$. The two independent solutions are $1$ and $e^x$, so
$$
\boxed{y_{\mathrm{hom}}(x)=C_1+C_2e^x.}
$$
\b[Forced equation.] A <particular solution> is $-x^2/2-x$, since its second <derivative> minus its first <derivative> equals $x$. Thus $y=C_1+C_2e^x-x^2/2-x$ and $y'=C_2e^x-x-1$. The <derivative> condition at one gives $C_2e-2=2$, so $C_2=4/e$. The value condition then gives $C_1+4-1/2-1=1$, so $C_1=-3/2$. Hence
$$
\boxed{y(x)=4e^{x-1}-\frac{x^2}{2}-x-\frac32,\qquad x\in\mathbb R.}
$$
Both <initial conditions> and the forced equation follow directly on substitution.