\[ -a x^2 y(x)+a x+x^2 \left (y'(x)-y(x)^2\right )+2=0 \] ✓ Mathematica : cpu = 0.122143 (sec), leaf count = 71
\[\left \{\left \{y(x)\to \frac {a^3 c_1+e^{a x} \left (-a^3 x^3+a^2 x^2-2 a x+2\right )}{x \left (a^3 c_1+e^{a x} \left (a^2 x^2-2 a x+2\right )\right )}\right \}\right \}\]
✓ Maple : cpu = 0.114 (sec), leaf count = 52
\[ \left \{ y \left ( x \right ) ={\frac {- \left ( ax-1 \right ) \left ( {a}^{2}{x}^{2}+2 \right ) {{\rm e}^{ax}}+{\it \_C1}}{x \left ( \left ( {a}^{2}{x}^{2}-2\,ax+2 \right ) {{\rm e}^{ax}}+{\it \_C1} \right ) }} \right \} \]