\[ a x^2 y(x)^n y'(x)-2 x y'(x)+y(x)=0 \] ✓ Mathematica : cpu = 0.098253 (sec), leaf count = 42
\[\text {Solve}\left [\frac {n \left (\log (x)-\log \left (-a x y(x)^n+n+2\right )\right )}{n+2}-\frac {2 n \log (y(x))}{n+2}=c_1,y(x)\right ]\]
✓ Maple : cpu = 0.193 (sec), leaf count = 33
\[ \left \{ {\frac {{x}^{n}}{ \left ( \left ( y \left ( x \right ) \right ) ^{n}ax-n-2 \right ) ^{n} \left ( \left ( y \left ( x \right ) \right ) ^{n} \right ) ^{2}}}-{\it \_C1}=0 \right \} \]