\[ 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 = 0.514176 (sec), leaf count = 96
DSolve[-((y[x]*Derivative[1][f][x])/f[x]) - f[x]*Derivative[1][g][x] - (f[x]^(1 - n)*y[x]^n*Derivative[1][g][x])/(b + a*g[x])^n + Derivative[1][y][x] == 0,y[x],x]
\[\text {Solve}\left [\int _1^{\left (f(x)^{-n} (b+a g(x))^{-n}\right )^{\frac {1}{n}} y(x)}\frac {1}{K[1]^n-\left (a^n\right )^{\frac {1}{n}} K[1]+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.178 (sec), leaf count = 281
dsolve(diff(y(x),x)-f(x)^(1-n)*diff(g(x),x)*y(x)^n/((a*g(x)+b)^n)-diff(f(x),x)*y(x)/f(x)-f(x)*diff(g(x),x) = 0,y(x))
\[y \left (x \right ) = \frac {\RootOf \left (-\left (\int _{}^{\textit {\_Z}}\frac {\left (\left (a g \left (x \right )+b \right )^{-n} f \left (x \right )^{1-n} \left (\frac {d}{d x}g \left (x \right )\right )\right )^{-n -1} \left (f \left (x \right ) \left (\frac {d}{d x}g \left (x \right )\right )\right )^{-2 n +1} \left (\left (a g \left (x \right )+b \right )^{-n -1} a f \left (x \right )^{2-n} \left (\frac {d}{d x}g \left (x \right )\right )^{3} n \right )^{n} n^{-n}}{\textit {\_a} \left (\left (a g \left (x \right )+b \right )^{-n} f \left (x \right )^{1-n} \left (\frac {d}{d x}g \left (x \right )\right )\right )^{-n -1} \left (f \left (x \right ) \left (\frac {d}{d x}g \left (x \right )\right )\right )^{-2 n +1} \left (\left (a g \left (x \right )+b \right )^{-n -1} a f \left (x \right )^{2-n} \left (\frac {d}{d x}g \left (x \right )\right )^{3} n \right )^{n} n^{-n}-\left (\left (a g \left (x \right )+b \right )^{-n} f \left (x \right )^{1-n} \left (\frac {d}{d x}g \left (x \right )\right )\right )^{-n -1} \left (f \left (x \right ) \left (\frac {d}{d x}g \left (x \right )\right )\right )^{-2 n +1} \left (\left (a g \left (x \right )+b \right )^{-n -1} a f \left (x \right )^{2-n} \left (\frac {d}{d x}g \left (x \right )\right )^{3} n \right )^{n} n^{-n}-\textit {\_a}^{n}}d \textit {\_a} \right )-\ln \left (a g \left (x \right )+b \right )+c_{1}\right ) \left (a g \left (x \right )+b \right ) f \left (x \right )}{a}\]