Answer
See below
Work Step by Step
We are given $y''+4y=7\cos^2x$
We have: $F(x)=7\cos^2 x=\frac{7}{2}+\frac{7}{2}\cos 2x$
Obtain: $\frac{7}{2}\cos 2x(D^2+4)=0$
and $\frac{7}{2}(D)=0$
So, $D^2+4$ is the annihilator of $\frac{7}{2}\cos 2x$ and $D$ is the annihilator of $\frac{7}{2}$
Therefore,
$D(D^2+4)(D^2+4)=0$
The trial solution is
$y_p(x)=A_0+A_1x\sin x+A_2x\cos x$