\[ \boxed { {\frac {{\rm d}^{2}}{{\rm d}{x}^{2}}}y \left ( x \right ) +y \left ( x \right ) -a\cos \left ( bx \right ) =0} \]
Mathematica: cpu = 0.097012 (sec), leaf count = 47 \[ \left \{\left \{y(x)\to \frac {-a \cos ^2(x) \cos (b x)-a \sin ^2(x) \cos (b x)}{b^2-1}+c_2 \sin (x)+c_1 \cos (x)\right \}\right \} \]
Maple: cpu = 0.031 (sec), leaf count = 27 \[ \left \{ y \left ( x \right ) =\sin \left ( x \right ) {\it \_C2}+\cos \left ( x \right ) {\it \_C1}-{\frac {a\cos \left ( bx \right ) }{{b}^{2} -1}} \right \} \]