\[ \boxed { {\frac {{\rm d}^{2}}{{\rm d}{x}^{2}}}y \left ( x \right ) +y \left ( x \right ) -\sin \left ( nx \right ) =0} \]
Mathematica: cpu = 0.115515 (sec), leaf count = 45 \[ \left \{\left \{y(x)\to c_2 \sin (x)+c_1 \cos (x)+\frac {\cos ^2(x) (-\sin (n x))-\sin ^2(x) \sin (n x)}{n^2-1}\right \}\right \} \]
Maple: cpu = 0.032 (sec), leaf count = 26 \[ \left \{ y \left ( x \right ) =\sin \left ( x \right ) {\it \_C2}+\cos \left ( x \right ) {\it \_C1}-{\frac {\sin \left ( nx \right ) }{{n}^{2}- 1}} \right \} \]