Solution
= Solution
Use the <method of undetermined coefficients>, choosing a <particular solution> $y_p=A+B\cos2x$. Substitution gives
$$
y_p''+y_p=A-3B\cos2x.
$$
Matching the constant and <cosine> coefficients to $\tfrac12-\tfrac12\cos2x$ gives $A=1/2$, $B=1/6$. Thus
$$
\boxed{y_p(x)=\frac12+\frac16\cos2x.}
$$
Neither forcing term is resonant with the homogeneous <angular frequency> one.