Solution (source code)

= Solution

The homogeneous <characteristic equation> is $r^2+2r=r(r+2)=0$, giving the <complementary solution> $C_1+C_2e^{-2x}$. For a <particular solution>, try $Ax^2+Bx$. Substitution gives $2A+4Ax+2B=4x$, so $A=1$ and $B=-1$. Therefore the <general solution> is
$$
\boxed{y=x^2-x+C_1+C_2e^{-2x}.}
$$
As a direct check, the <polynomial> part contributes $2+2(2x-1)=4x$, while both complementary terms contribute zero.