Solving the differential equation $y'' + y = 8\cos(x) \cos(2x)$ I'm solving the differential equation $y'' + y = 8\cos(x) \cos(2x)$
I started to find the homogeneous solution:
We search the zeros of the associated polynomial:
$$r^2 + 1 = 0$$
This yields $r = i$ or $r = -i$
Hence, the homogeneous solution is:
$$y_h = e^0(c_1\cos(x) + c_2\sin(x)) + e^0(c_3\cos(-x) + c_4\sin(-x))$$
And by rewriting this, we find:
$$y_h = c_1\cos(x) + c_2\sin(x)$$
I have trouble making a suggestion for the particular solution. I would suggest something like:
$$y_p = (A\cos(x) + B\sin(x))(C\cos(2x) + D\sin(2x))$$
but the answer my book gives is :
$$y = x_1\cos(x) + (c_2 + 2x)\sin(x) - 1/2\cos(3x)$$
Where does the $\cos(3x)$ come from? This makes me wonder my suggestion won't work. 
Any help will be appreciated.

The C.F.$=c_1\cos x+c_2\sin x$,
By inverse operator rule: When
\begin{align*}
P.I.&=\dfrac{1}{f(D^2)}\cos(ax+b)\  \text{ put }D^2=-a^2,\text{ when }[f(-a^2)\neq0]\\
&=x\dfrac{1}{f'(D^2)}\cos(ax+b)\  \text{ put }D^2=-a^2,\text{ when }[f(-a^2)=0,\ f'(-a^2)\neq0]\\
&=x^2\dfrac{1}{f''(D^2)}\cos(ax+b)\  \text{ put }D^2=-a^2,\text{ when }[f'(-a^2)=0,\ f''(-a^2)\neq0]\\
&=\cdots
\end{align*}
So the P.I. is given by (using inverse operator rules),
\begin{align*}
P.I.&=\dfrac{4}{D^2+1}(\cos3x+\cos x)\\
&=4\left[\dfrac{1}{D^2+1}\cos3x+\dfrac{1}{D^2+1}\cos x\right]\\
&=4\left[\dfrac{1}{-3^2+1}\cos3x+x\cdot\dfrac{1}{2D}\cos x\right]\\
&=4\left[-\dfrac{1}{8}\cos3x+\dfrac{x}{2}\cdot\dfrac{1}{D}\cos x\right]\\
&=4\left[-\dfrac{1}{8}\cos3x+\dfrac{x}{2}\sin x\right]\\
&=2x\sin x-\dfrac{1}{2}\cos3x.
\end{align*}
So, $y=C.F.+P.I.=c_1\cos x+c_2\sin x+2x\sin x-\dfrac{1}{2}\cos3x$
or, $y=c_1\cos x+(c_2+2x)\sin x-\dfrac{1}{2}\cos3x$.
