Example 7. Integrate the equation

$$
y^{\prime \prime}+4 y^{\prime}+4 y=2 \sin 2 x+3 \cos 2 x
$$
Solution. The right-hand side of the given equation is a trigonometric polynomial of the form $f(x)=a \cos m x+b \sin m x$, where $a=3, b=2$, $m=2$. Since condition (10.28) is satisfied, according to formula (10.27), we seek a particular solution in the form

$$
\bar{y}=A \cos 2 x+B \sin 2 x
$$

Finding the derivatives

$$
\bar{y}^{\prime}=-2 A \sin 2 x+2 B \cos 2 x, \bar{y}^{\prime \prime}=-4 A \cos 2 x-4 B \sin 2 x
$$

and substituting the expressions for $\bar{y}, \bar{y}^{\prime}, \bar{y}^{\prime \prime}$ into the given equation, we get

$$
\begin{gathered}
-4 A \cos 2 x-4 B \sin 2 x+4(-2 A \sin 2 x+2 B \cos 2 x)+ \\
+4(A \cos 2 x+B \sin 2 x) \equiv 2 \sin 2 x+3 \cos 2 x
\end{gathered}
$$

or

$$
8 B \cos 2 x-8 A \sin 2 x \equiv 3 \cos 2 x+2 \sin 2 x,
$$

from which

$$
8 B=3,-8 A=2
$$

i.e.

$$
A=-\frac{1}{4}, B=\frac{3}{8}
$$

Therefore, the particular solution is given by the formula

$$
\bar{y}=-\frac{1}{4} \cos 2 x+\frac{3}{8} \sin 2 x
$$

The corresponding homogeneous equation

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

has the general solution

$$
y_{0}=\left(C_{1}+C_{2} x\right) e^{-2 x}
$$

By formula (10.21), we find the general solution of the given equation

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