Solution (source code)

= Solution

The constant term belongs on the forcing side: the equation is $y''-2y'=x+1$. Set $v=y'$ to obtain the first-order linear equation $v'-2v=x+1$. A particular solution is $v_p=-x/2-3/4$, while $v_h=Ae^{2x}$. Imposing $v(0)=0$ fixes $A=3/4$. Integrating and then using $y(0)=0$ gives
$$
\boxed{y(x)=\frac38(e^{2x}-1)-\frac{x^2}{4}-\frac{3x}{4}.}
$$
Direct <differentiation> gives $y'=3e^{2x}/4-x/2-3/4$ and $y''=3e^{2x}/2-1/2$, so $y''-2y'-1=x$. Both initial values vanish. The nonzero exponential term is required by the initial derivative, even though the forcing is polynomial.