Example 3. Solve the equation $y^{\prime \prime}+2 y^{\prime}+y=(1+x) e^{-x}$
Solution. We have: $k^{2}+2 k+1=0, k_{\mathrm{I}}=k_{2}=-1, y_{\text {gen }}=\left(C_{\mathrm{I}}+\right.$ $\left.+C_{2} x\right) e^{-x}$. Given $f(x)=(1+x) e^{-x}, \lambda=-1-$ is a double root of the characteristic equation, $n=1$. According to point 3) of Theorem 3, we will form the corresponding system, preliminarily transforming and differentiating the assumed particular solution.

1: $y_{4}=x^{2}(A x+B) e^{-x}=\left(A x^{3}+B x^{2}\right) e^{-x}$;

2: $y_{4}^{\prime}=\left(3 A x^{2}+2 B x\right) e^{-x}-\left(A x^{3}+B x^{2}\right) e^{-x}$;

1: $y_{4}^{\prime \prime}=(6 A x+2 B) e^{-x}-2\left(3 A x^{2}+2 B x\right) e^{-x}+\left(A x^{3}+B x^{2}\right) e^{-x}$

Equating coefficients of like powers:

$x^{3}: A-2 A+A=0$ (trivial equation);

$x^{2}: B+6 A-2 B-6 A+B=0$ (trivial equation);

$x^{\mathrm{f}}: 4 B+6 A-4 B=1, \quad A=\frac{1}{6}$;

$x^{0}: 2 B=1, \quad B=\frac{1}{2}$.

Answer. $y_{\text {gen }}=\left(C_{1}+C_{2} x\right) e^{-x}+\left(\frac{x^{3}}{6}+\frac{x^{2}}{2}\right) e^{-x}$.