Example 4.22. Find the general solution of the equation

$$
y^{\prime \prime}+6 y^{\prime}+9 y=14 e^{-3 x} .
$$
Solution. 1. Find $\bar{y}$.

The characteristic equation $r^{2}+6 r+9=0$, has roots $r_{1}=r_{2}=-3$. Therefore,

$$
\bar{y}=\left(C_{1}+C_{2} x\right) e^{-3 x}
$$

2. Now find $y^{*}$. Here the right-hand side has the form (3): $n=0$, $P_{0}=14, k=-3$. Since $k=-3$ is a double root of the characteristic equation, the particular solution $y^{*}$ should be sought in the form

$$
y^{*}=A x^{2} e^{-3 x}
$$

where $A$ is a coefficient to be determined. Calculate the derivatives $y^{* \prime}$ and $y^{* \prime \prime}:$

$$
\begin{gathered}
y^{*}=\left(-3 A x^{2}+2 A x\right) e^{-3 x}, \\
y^{*}=\left(9 A x^{2}-12 A x+2 A\right) e^{-3 x} .
\end{gathered}
$$

Substituting the expressions for $y^{*}, y^{*^{\prime}}$ and $y^{* \prime \prime}$ into the given equation, canceling $e^{-3 x}$ from both sides, and combining like terms, we ultimately get $2 A=14$, from which $A=7$. Therefore, the particular solution is:

$$
y^{*}=7 x^{2} e^{-3 x}
$$

Thus, the general solution of the given equation is

$$
y=\bar{y}+y^{*}=\left(C_{1}+C_{2} x\right) e^{-3 x}+7 x^{2} e^{-3 x}
$$