\[ \boxed { {\frac {\rm d}{{\rm d}x}}y \left ( x \right ) +f \left ( x \right ) \cos \left ( ay \left ( x \right ) \right ) +g \left ( x \right ) \sin \left ( ay \left ( x \right ) \right ) +h \left ( x \right ) =0} \]
Mathematica: cpu = 32.093075 (sec), leaf count = 29 \[ \text {DSolve}\left [f(x) \cos (a y(x))+g(x) \sin (a y(x))+h(x)+y'(x)=0,y(x),x\right ] \]
Maple: cpu = 0.748 (sec), leaf count = 0 \[ \text {could not solve} \]