Linear Second Order ODE/y'' + 2 y' + y = x exp -x

Theorem
The second order ODE:
 * $(1): \quad y'' + 2 y' + y = x e^{-x}$

has the general solution:
 * $y = e^{-x} \paren {C_1 + C_2 x + \dfrac {x^3} 6}$

Proof
It can be seen that $(1)$ is a nonhomogeneous linear second order ODE in the form:
 * $y'' + p y' + q y = \map R x$

where:
 * $p = 2$
 * $q = 1$
 * $\map R x = x e^{-x}$

First we establish the solution of the corresponding constant coefficient homogeneous linear second order ODE:
 * $y'' + 2 y' + y = 0$

From Linear Second Order ODE: $y'' + 2 y' + y = 0$, this has the general solution:
 * $y_g = \paren {C_1 + C_2 x} e^{-x}$

It remains to find a particular solution $y_p$ to $(1)$.

We have that:
 * $\map R x = x e^{-x}$

and so from the Method of Undetermined Coefficients for Product of Polynomial and Exponential, we assume a solution:

Substituting in $(1)$:

Hence by equating coefficients:

So from General Solution of Linear 2nd Order ODE from Homogeneous 2nd Order ODE and Particular Solution:


 * $y = y_g + y_p = e^{-x} \paren {C_1 + C_2 x + \dfrac {x^3} 6}$