Solution (source code)

= Solution

For the homogeneous <linear ordinary differential equation>, the <characteristic equation> is
$$
r^2+2r+2=0,\qquad r=-1\pm i.
$$
Its real solution is $y_h=e^{-x}(C_1\cos x+C_2\sin x)$. For a particular solution to the full <ordinary differential equation>, try $y_p=ax+b$. Substitution gives
$$
2a+2ax+2b=8x+4,
$$
so $a=4$ and $b=-2$. Adding the homogeneous and particular solutions yields
$$
\boxed{y(x)=e^{-x}(C_1\cos x+C_2\sin x)+4x-2.}
$$
The two arbitrary real constants account for the second order of the <ordinary differential equation>.