<s>[INST] Second-Order Linear Differential Equation I have the following differential equation:
$$y''+y=\cos(t)\cos(2t)$$
Maybe something can be done to $\cos(t)\cos(2t)$ to make it easier to solve. Any ideas?
Thanks in advance.
 [/INST] I don't see an elegant solution (and I fail to see how Arturo's comment helps immediately), but it can be done by brute force using the method of variation of parameters.
The homogeneous differential equation $y''(t) + y(t) = 0$ has the two fundamental solutions $y_{1}(t) = \sin{(t)}$ and $y_{2}(t) = \cos(t)$.
We must solve
\[
\begin{pmatrix}
  0 \\
  \cos(t)\cos(2t)
\end{pmatrix} =
\begin{pmatrix}
  y_{1} & y_{2} \\
  y_{1}^{\prime} & y_{2}^{\prime}
\end{pmatrix}
\begin{pmatrix}
  u_{1} \\
  u_{2}
\end{pmatrix} =
\begin{pmatrix}
  \sin{t} & \cos{t} \\
  -\cos{t} & \sin{t}
\end{pmatrix}
\begin{pmatrix}
  u_{1} \\
  u_{2}
\end{pmatrix}
\]
for $u_{1}$ and $u_{2}$ and find $U_{1}$ and $U_{2}$ such that $U_{1}^{\prime} = u_{1}$ and $U_{2}^{\prime} = u_{2}$.

A particular solution will then be given by
  \[y_{0}(t) = U_{1} y_{1} + U_{2}y_{2}\qquad\text{and}
  \qquad y=y_{0} + c_{1} y_{1} + c_{2}y_{2}\]
  will be the general solution.

Since the matrix $A(t) = \begin{pmatrix}
  \sin{t} & \cos{t} \\\
  -\cos{t} & \sin{t}
\end{pmatrix}$ is orthogonal, its inverse is its transpose, so
\[
\begin{pmatrix}
  u_{1} \\
  u_{2}
\end{pmatrix}= 
\begin{pmatrix}
  \sin{t} & -\cos{t} \\
  \cos{t} & \sin{t}
\end{pmatrix}
\begin{pmatrix}
  0 \\
  \cos(t)\cos(2t)
\end{pmatrix} =
\begin{pmatrix}
\cos^2(t)\cos(2t) \\
\sin(t)\cos(t)\cos(2t)
\end{pmatrix}
\]
Note that $u_{2}(t) = \sin(t)\cos(t)\cos(2t) = \frac{1}{2}\sin{(2t)}\cos{(2t)} = \frac{1}{4}\sin{(4t)}$, so we can take

\[U_{2}(t) = -\frac{1}{16}\cos{(4t)}.\]

On the other hand, using Arturo's comment three times, we get
\begin{align*}
u_{1}(t) & = \cos^2(t)\cos(2t) = \cos(t)\frac{1}{2}(\cos(3t)+\cos(t)) \\
& = \frac{1}{2} \cos{(t)}\cos(3t) + \frac{1}{2} \cos(t)\cos(t) = \frac{1}{4}
(\cos{(4t)} + \cos{(2t)}) + \frac{1}{4}(\cos{(2t)} + 1) \\
& = \frac{1}{4}\cos{(4t)} + \frac{1}{2} \cos{(2t)} + \frac{1}{4}.
\end{align*}
Integrating this gives

\[U_{1}(t) = \frac{1}{16} \sin(4t) + \frac{1}{4}\sin{(2t)} + \frac{1}{4}t.\]

Now we can simplify the particular solution 

\begin{align*}
  y_{0} = U_{1} y_{1} + U_{2}y_{2} = \cdots = \frac{1}{4}t \sin(t) - \frac{1}{16} \cos(3t) + \frac{5}{16}\cos(t)
  \end{align*}

using some further trig identities (I'm really growing tired of this, sorry).
You should at least check yourself that $y_{0}^{\prime\prime} + y_{0} = \frac{1}{2}(\cos(t) + \cos(3t)) = \cos(t)\cos{(2t)}$ by Arturo's comment again.

Therefore the general solution is 
  \[
  y(t) = y_{0} + c_{1} y_{1} + c_{2} y_{2} = \frac{1}{4}t \sin(t) - \frac{1}{16} \cos(3t) + \frac{5}{16}\cos(t) + c_{1}\sin{(t)} + c_{2} \cos(t)
  \]
  for some real constants $c_{1}$ and $c_{2}$.

</s>