\[ f(x)^{1-n} g'(x) y(x)^n \left (-(a g(x)+b)^{-n}\right )-\frac {y(x) f'(x)}{f(x)}-f(x) g'(x)+y'(x)=0 \] ✓ Mathematica : cpu = 105.501 (sec), leaf count = 95
\[\text {Solve}\left [\frac {f(x) (a g(x)+b) \log (a g(x)+b) \left (f(x)^{-n} (a g(x)+b)^{-n}\right )^{\frac {1}{n}}}{a}+c_1=\int _1^{y(x) \left (f(x)^{-n} (a g(x)+b)^{-n}\right )^{\frac {1}{n}}} \frac {1}{-\left (a^n\right )^{\frac {1}{n}} K[1]+K[1]^n+1} \, dK[1],y(x)\right ]\]
✓ Maple : cpu = 0.07 (sec), leaf count = 281
\[ \left \{ y \left ( x \right ) ={\frac { \left ( ag \left ( x \right ) +b \right ) f \left ( x \right ) }{a}{\it RootOf} \left ( -\int ^{{\it \_Z}}\!{\frac { \left ( \left ( {\frac {\rm d}{{\rm d}x}}g \left ( x \right ) \right ) \left ( ag \left ( x \right ) +b \right ) ^{-n} \left ( f \left ( x \right ) \right ) ^{1-n} \right ) ^{-n-1} \left ( f \left ( x \right ) {\frac {\rm d}{{\rm d}x}}g \left ( x \right ) \right ) ^{-2\,n+1} \left ( \left ( {\frac {\rm d}{{\rm d}x}}g \left ( x \right ) \right ) ^{3} \left ( ag \left ( x \right ) +b \right ) ^{-n-1}a \left ( f \left ( x \right ) \right ) ^{2-n}n \right ) ^{n}{n}^{-n}}{{\it \_a}\, \left ( \left ( {\frac {\rm d}{{\rm d}x}}g \left ( x \right ) \right ) \left ( ag \left ( x \right ) +b \right ) ^{-n} \left ( f \left ( x \right ) \right ) ^{1-n} \right ) ^{-n-1} \left ( f \left ( x \right ) {\frac {\rm d}{{\rm d}x}}g \left ( x \right ) \right ) ^{-2\,n+1} \left ( \left ( {\frac {\rm d}{{\rm d}x}}g \left ( x \right ) \right ) ^{3} \left ( ag \left ( x \right ) +b \right ) ^{-n-1}a \left ( f \left ( x \right ) \right ) ^{2-n}n \right ) ^{n}{n}^{-n}- \left ( \left ( {\frac {\rm d}{{\rm d}x}}g \left ( x \right ) \right ) \left ( ag \left ( x \right ) +b \right ) ^{-n} \left ( f \left ( x \right ) \right ) ^{1-n} \right ) ^{-n-1} \left ( f \left ( x \right ) {\frac {\rm d}{{\rm d}x}}g \left ( x \right ) \right ) ^{-2\,n+1} \left ( \left ( {\frac {\rm d}{{\rm d}x}}g \left ( x \right ) \right ) ^{3} \left ( ag \left ( x \right ) +b \right ) ^{-n-1}a \left ( f \left ( x \right ) \right ) ^{2-n}n \right ) ^{n}{n}^{-n}-{{\it \_a}}^{n}}}{d{\it \_a}}-\ln \left ( ag \left ( x \right ) +b \right ) +{\it \_C1} \right ) } \right \} \]