Example 7. Find the general solution of the equation $y^{\prime \prime}-6 y^{\prime}+9 y=25 e^{x} \sin x$.
Solution. The characteristic equation $\lambda^{2}-6 \lambda+9=0$ has roots $\lambda_{1}=\bar{\lambda}_{2}=3$; the general solution $y_{\text {g.s.}}$ of the homogeneous equation will be

$$
y_{0.0}=\left(C_{1}+C_{2} x\right) e^{3 x} .
$$

The numbers $1 \pm i$ are not roots of the characteristic equation, so the particular solution $\boldsymbol{y}_{\text {p.s. }}$ is sought in the form (see Table 1, case IV (1))

$$
y_{\text {p.s. }}=e^{x}(a \cos x+b \sin x) .
$$

Substituting the expression $y_{\text {p.s. }}$ into the equation and canceling $e^{x}$ from both sides of the equation, we get

$$
(3 a-4 b) \cos x+(4 a+3 b) \sin x=25 \sin x \text {. }
$$

From this, we have the system

$$
\left\{\begin{array}{l}
3 a-4 b=0 \\
4 a+3 b=25
\end{array}\right.
$$

the solution of which is $a=4, b=3$ and, consequently,

$$
y_{4, n}=e^{x}(4 \cos x+3 \sin x)
$$

The general solution of the given equation is

$$
y(x)=\left(C_{1}+C_{2} x\right) e^{3 x}+e^{x}(4 \cos x+3 \sin x)
$$