\[ -a x^2 y(x)+a x+x^2 \left (y'(x)-y(x)^2\right )+2=0 \] ✓ Mathematica : cpu = 0.1767 (sec), leaf count = 122
\[\left \{\left \{y(x)\to -\frac {\frac {e^{a x} \left (a^2 x^2-2 a x+2\right )}{a^2 x}-\frac {e^{a x} \left (a^2 x^2-2 a x+2\right )}{a^3 x^2}+\frac {e^{a x} \left (2 a^2 x-2 a\right )}{a^3 x}-\frac {c_1}{x^2}}{\frac {e^{a x} \left (a^2 x^2-2 a x+2\right )}{a^3 x}+\frac {c_1}{x}}\right \}\right \}\] ✓ Maple : cpu = 0.067 (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}}{ \left ( \left ( {a}^{2}{x}^{2}-2\,ax+2 \right ) {{\rm e}^{ax}}+{\it \_C1} \right ) x}} \right \} \]