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 = C_1 e^{-x} + C_2 x e^{-x} - ...$

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 = e^{-x} \ln 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 = C_1 e^{-x} + 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 the Exponential function, we assume a solution:

Substituting in $(1)$:


 * $(2): \quad K_1 x^2 e^{-x} + \paren {-4 K_1 + K_2} x e^{-x} + \paren {2 K_1 - 2 K_2 + K_3} e^{-x} + 2 \paren {-K_1 x^2 e^{-x} + \paren {2 K_1 - K_2} x e^{-x} + \paren {K_2 - K_3} e^{-x} } + K_1 x^2 e^{-x} + K_2 x e^{-x} + K_3 e^{-x} = x e^{-x}$

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 = C_1 e^{-x} + C_2 x e^{-x} + ...$