Example 4.21. Find the general solution of the equation

$$
y^{\prime \prime}+4 y^{\prime}+3 y=\left(8 x^{2}+84 x\right) e^{x}
$$
## Solution:

1. Find the general solution $\bar{y}$ of the corresponding homogeneous equation

$$
y^{\prime \prime}+4 y^{\prime}+3 y=0
$$

Solving the characteristic equation

$$
r^{2}+4 r+3=0
$$

we obtain the roots $r_{1}=-3, r_{2}=-1$. Therefore,

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

2. Proceed to finding a particular solution $y^{*}$ of the given equation. Here, the right-hand side $f(x)=\left(8 x^{2}+84 x\right) e^{x}$ has the form (3): $n=2$, $P_{2}(x)=8 x^{2}+84 x, k=1$, and $k=1$ is not a root of the characteristic equation. Therefore, the particular solution $y^{*}$ should be sought in the form

$$
y^{*}=\left(A x^{2}+B x+C\right) e^{x}
$$

where $A, B$ and $C$ are some coefficients to be determined. To find these coefficients, we use the fact that $y^{*}$ must be a solution of the given equation. We find $y^{*^{\prime}}$ and $y^{*^{\prime \prime}}$:

$$
\begin{gathered}
y^{*}=\left(A x^{2}+B x+C\right) e^{x}+(2 A x+B) e^{x}=\left(A x^{2}+2 A x+B x+B+C\right) e^{x}, \\
y^{*}=\left(A x^{2}+2 A x+B x+B+C\right) e^{x}+(2 A x+2 A+B) e^{x}= \\
=\left(A x^{2}+4 A x+B x+2 A+2 B+C\right) e^{x} ;
\end{gathered}
$$

Now substitute the expressions for $y^{*}, y^{*^{\prime}}$ and $y^{*^{\prime \prime}}$ into the given equation:

$$
\begin{gathered}
\left(A x^{2}+4 A x+B x+2 A+2 B+\mathrm{C}\right) e^{x}+4\left(A x^{2}+2 A x+B x+B+\mathrm{C}\right) e^{x}+ \\
+3\left(A x^{2}+B x+\mathrm{C}\right) e^{x}=\left(8 x^{2}+84 x\right) e^{x} .
\end{gathered}
$$

Dividing both sides of the resulting equation by $e^{x}$ and grouping terms with the same powers of $x$, we obtain

$$
A x^{2}+(12 A+8 B) x+(2 A+6 B+8 C)=8 x^{2}+84 x
$$

This equality holds identically only if the coefficients of the same powers of $x$ in both sides of the equation are equal.

Thus, we have the following system of equations to find the coefficients $A, B$ and $C$:

$$
\begin{array}{ll}
8 A & =8 \\
12 A+8 B & =84, \\
2 A+6 B+8 C & =0
\end{array}
$$

Solving this system, we find $A=1, B=9, C=-7$. Therefore, the desired particular solution is

$$
y^{*}=\left(x^{2}+9 x-7\right) e^{x} .
$$

Now we can write the general solution of the given equation

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