$$
\lambda^{2}+4 \lambda+3=0,
$$
with the roots $\lambda_{1}=-1$ and $\lambda_{2}=-3$, so the complementary function is
$$
y_{c}(x)=C_{1} e^{-x}+C_{2} e^{-3 x} \text {. }
$$
The nonhomogeneous term $e^{-x}$ is contained in the complementary function, so by Step 3 (b) in Table $6.2$ we must seek a particular integral of the form
$$
y_{p}(x)=A x e^{-x} .
$$
Substituting the expression for $y_{p}(x)$ into the differential equation gives $\left(-2 A e^{-x}+A x e^{-x}\right)+4\left(A e^{-x}-A x e^{-x}\right)+3 A x e^{-x}=e^{-x}, \quad$ or $2 A e^{-x}=e^{-x}$, showing that $A=1 / 2$. So, in this case, the particular integral is $y_{P}(x)=(1 / 2) x e^{-x}$ and the general solution is
$$
y(x)=C_{1} e^{-x}+C_{2} e^{-3 x}+(1 / 2) x e^{-x} .
$$
The initial condition $y(0)=2$ will be satisfied if
$$
2=C_{1}+C_{2},
$$
and the initial condition $y^{\prime}(0)=1$ will be satisfied if
$$
1 / 2=-C_{1}-3 C_{2}
$$
ENG2005 COURSE NOTES :
$$
\lambda^{2}+2 \lambda+1=0
$$
with the repeated root $\lambda=-1$. Thus, the complementary function is
$$
y_{c}(x)=C_{1} e^{-x}+C_{2} x e^{-x} .
$$
Two linearly independent solutions are thus
$$
y_{1}(x)=e^{-x} \text { and } y_{2}(x)=x e^{-x} \text {, }
$$
while the nonhomogeneous term is $f(x)=x e^{-x}$. The Wronskian
$$
W(x)=\left|\begin{array}{ll}
y_{1} & y_{2} \
y_{1}^{\prime} & y_{2}^{\prime}
\end{array}\right|=e^{-x}\left(e^{-x}-x e^{-x}\right)+e^{-x} x e^{-x}=e^{-2 x}
$$
so substituting in shows that the particular integral is
$$
y_{p}(x)=-e^{-x} \int x^{2} \mathrm{~d} x+x e^{-x} \int x \mathrm{~d} x=\frac{1}{6} x^{3} e^{-x} .
$$
The general solution is
$$
y(x)=C_{1} e^{-x}+C_{2} x e^{-x}+\frac{1}{6} x^{3} e^{-x} .
$$
This result could, of course, have been found by the method of undetermined coefficients.