\[ -a x^2 y(x)+a x+x^2 \left (y'(x)-y(x)^2\right )+2=0 \] ✓ Mathematica : cpu = 0.218494 (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.091 (sec), leaf count = 52
\[\left \{y \left (x \right ) = \frac {c_{1}-\left (a x -1\right ) \left (a^{2} x^{2}+2\right ) {\mathrm e}^{a x}}{\left (c_{1}+\left (a^{2} x^{2}-2 a x +2\right ) {\mathrm e}^{a x}\right ) x}\right \}\]