\[ \boxed { \left ( {x}^{2}-1 \right ) {\frac {\rm d}{{\rm d}x}}y \left ( x \right ) +2\,xy \left ( x \right ) -\cos \left ( x \right ) =0} \]
Mathematica: cpu = 0.013002 (sec), leaf count = 26 \[ \left \{\left \{y(x)\to \frac {c_1}{x^2-1}+\frac {\sin (x)}{x^2-1}\right \}\right \} \]
Maple: cpu = 0.015 (sec), leaf count = 16 \[ \left \{ y \left ( x \right ) ={\frac {\sin \left ( x \right ) +{\it \_C1} }{{x}^{2}-1}} \right \} \]