Solution
= Solution
The <integrating factor> is $e^{2x}$, giving $(e^{2x}y)'=1+e^{2x}(x^2+2x)$. A quadratic particular solution for the <polynomial> forcing is $x^2/2+x/2-1/4$, while the resonant exponential forcing contributes $xe^{-2x}$. Consequently
$$
\boxed{y=(x+C)e^{-2x}+\frac{x^2+x}{2}-\frac14.}
$$
Substitution gives $y'+2y=e^{-2x}+x^2+2x$, and the free multiple of $e^{-2x}$ is the <homogeneous solution>.