\[ \boxed { {\frac {\rm d}{{\rm d}x}}y \left ( x \right ) -{a}^{n} \left ( f \left ( x \right ) \right ) ^{1-n} \left ( {\frac {\rm d}{{\rm d}x}}g \left ( x \right ) \right ) \left ( y \left ( x \right ) \right ) ^{n}-{\frac { \left ( {\frac {\rm d}{{\rm d}x}}f \left ( x \right ) \right ) y \left ( x \right ) }{f \left ( x \right ) }}-f \left ( x \right ) {\frac {\rm d}{{\rm d}x}}g \left ( x \right ) =0} \]
Mathematica: cpu = 0.116515 (sec), leaf count = 74 \[ \text {Solve}\left [y(x) \left (a^n f(x)^{-n}\right )^{\frac {1}{n}} \, _2F_1\left (1,\frac {1}{n};1+\frac {1}{n};-\left (\left (a^n f(x)^{-n}\right )^{\frac {1}{n}} y(x)\right )^n\right )=f(x) g(x) \left (a^n f(x)^{-n}\right )^{\frac {1}{n}}+c_1,y(x)\right ] \]
Maple: cpu = 0.124 (sec), leaf count = 42 \[ \left \{ {\it \_C1}+{\frac {y \left ( x \right ) }{f \left ( x \right ) } {\mbox {$_2$F$_1$}(1,{n}^{-1};\,{\frac {n+1}{n}};\,- \left ( {\frac {ay \left ( x \right ) }{f \left ( x \right ) }} \right ) ^{n})} }-g \left ( x \right ) =0 \right \} \]
Sage: cpu = 1.384 (sec), leaf count = 0 \[ \left [\left [\int \frac {a^{n} y\left (x\right )^{n} f\left (x\right )^{2} D[0]\left (g\right )\left (x\right ) + f\left (x\right )^{n} y\left (x\right ) D[0]\left (f\right )\left (x\right ) + f\left (x\right )^{n + 2} D[0]\left (g\right )\left (x\right )}{a^{n} y\left (x\right )^{n} f\left (x\right )^{2} + f\left (x\right )^{n + 2}}\,{d x} + \int \frac {{\left (a^{n} y\left (x\right )^{n} f\left (x\right ) + f\left (x\right )^{n + 1}\right )} \int \frac {{\left (a^{n} n - a^{n}\right )} f\left (x\right )^{n} y\left (x\right )^{n} D[0]\left (f\right )\left (x\right ) - f\left (x\right )^{2 \, n} D[0]\left (f\right )\left (x\right )}{a^{2 \, n} y\left (x\right )^{2 \, n} f\left (x\right )^{2} + 2 \, a^{n} f\left (x\right )^{n + 2} y\left (x\right )^{n} + f\left (x\right )^{2 \, n + 2}}\,{d x} - f\left (x\right )^{n}}{a^{n} y\left (x\right )^{n} f\left (x\right ) + f\left (x\right )^{n + 1}}\,{d \left (y\left (x\right )\right )} = c\right ], \text {\texttt {lie}}\right ] \]