\[ 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 = 79.2084 (sec), leaf count = 95
\[\text {Solve}\left [\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]=\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,y(x)\right ]\]
✓ Maple : cpu = 0.063 (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 ( ag \left ( x \right ) +b \right ) ^{-n} \left ( f \left ( x \right ) \right ) ^{1-n}{\frac {\rm d}{{\rm d}x}}g \left ( x \right ) \right ) ^{-n-1} \left ( f \left ( x \right ) {\frac {\rm d}{{\rm d}x}}g \left ( x \right ) \right ) ^{-2\,n+1} \left ( a \left ( ag \left ( x \right ) +b \right ) ^{-n-1}n \left ( f \left ( x \right ) \right ) ^{2-n} \left ( {\frac {\rm d}{{\rm d}x}}g \left ( x \right ) \right ) ^{3} \right ) ^{n}{n}^{-n}}{{\it \_a}\, \left ( \left ( ag \left ( x \right ) +b \right ) ^{-n} \left ( f \left ( x \right ) \right ) ^{1-n}{\frac {\rm d}{{\rm d}x}}g \left ( x \right ) \right ) ^{-n-1} \left ( f \left ( x \right ) {\frac {\rm d}{{\rm d}x}}g \left ( x \right ) \right ) ^{-2\,n+1} \left ( a \left ( ag \left ( x \right ) +b \right ) ^{-n-1}n \left ( f \left ( x \right ) \right ) ^{2-n} \left ( {\frac {\rm d}{{\rm d}x}}g \left ( x \right ) \right ) ^{3} \right ) ^{n}{n}^{-n}- \left ( \left ( ag \left ( x \right ) +b \right ) ^{-n} \left ( f \left ( x \right ) \right ) ^{1-n}{\frac {\rm d}{{\rm d}x}}g \left ( x \right ) \right ) ^{-n-1} \left ( f \left ( x \right ) {\frac {\rm d}{{\rm d}x}}g \left ( x \right ) \right ) ^{-2\,n+1} \left ( a \left ( ag \left ( x \right ) +b \right ) ^{-n-1}n \left ( f \left ( x \right ) \right ) ^{2-n} \left ( {\frac {\rm d}{{\rm d}x}}g \left ( x \right ) \right ) ^{3} \right ) ^{n}{n}^{-n}-{{\it \_a}}^{n}}}{d{\it \_a}}-\ln \left ( ag \left ( x \right ) +b \right ) +{\it \_C1} \right ) } \right \} \]