\[ \boxed { {\frac {\rm d}{{\rm d}x}}y \left ( x \right ) -{\frac { \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}}{ \left ( ag \left ( x \right ) +b \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 = 57.744833 (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.062 (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} \left ( f \left ( x \right ) \right ) ^{2-n}an \right ) ^{n}{n}^{-n}}{{\it \_a}\, \left ( \left ( {\frac {\rm d}{{\rm d}x}}g \left ( x \right ) \right ) \left ( a g \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} \left ( f \left ( x \right ) \right ) ^{2-n}an \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} \left ( f \left ( x \right ) \right ) ^{2-n}an \right ) ^{n}{n}^{-n}-{{\it \_a}}^{n}}}{d{\it \_a}}-\ln \left ( ag \left ( x \right ) +b \right ) +{\it \_C1} \right ) } \right \} \]
Sage: cpu = 69.46 (sec), leaf count = 0 \[ \left [\left [\int -\frac {{\left (a g\left (x\right ) + b\right )}^{n} f\left (x\right )^{n} y\left (x\right ) D[0]\left (f\right )\left (x\right ) + y\left (x\right )^{n} f\left (x\right )^{2} D[0]\left (g\right )\left (x\right ) + {\left (a g\left (x\right ) + b\right )}^{n} f\left (x\right )^{n + 2} D[0]\left (g\right )\left (x\right )}{{\left (a g\left (x\right ) + b\right )}^{n} a f\left (x\right )^{n + 1} y\left (x\right ) - {\left (a f\left (x\right )^{n + 2} g\left (x\right ) + b f\left (x\right )^{n + 2}\right )} {\left (a g\left (x\right ) + b\right )}^{n} - {\left (a f\left (x\right )^{2} g\left (x\right ) + b f\left (x\right )^{2}\right )} y\left (x\right )^{n}}\,{d x} + \int \frac {{\left (a g\left (x\right ) + b\right )}^{n} f\left (x\right )^{n} - {\left ({\left (a g\left (x\right ) + b\right )}^{n} a f\left (x\right )^{n} y\left (x\right ) - {\left (a f\left (x\right )^{n + 1} g\left (x\right ) + b f\left (x\right )^{n + 1}\right )} {\left (a g\left (x\right ) + b\right )}^{n} - {\left (a f\left (x\right ) g\left (x\right ) + b f\left (x\right )\right )} y\left (x\right )^{n}\right )} \int \frac {{\left (a g\left (x\right ) + b\right )}^{2 \, n} a f\left (x\right )^{2 \, n + 1} D[0]\left (g\right )\left (x\right ) + {\left (a f\left (x\right )^{2 \, n} g\left (x\right ) + b f\left (x\right )^{2 \, n}\right )} {\left (a g\left (x\right ) + b\right )}^{2 \, n} D[0]\left (f\right )\left (x\right ) - {\left ({\left (a n - a\right )} {\left (a g\left (x\right ) + b\right )}^{n} f\left (x\right )^{n + 1} D[0]\left (g\right )\left (x\right ) + {\left ({\left (a n - a\right )} f\left (x\right )^{n} g\left (x\right ) + {\left (b n - b\right )} f\left (x\right )^{n}\right )} {\left (a g\left (x\right ) + b\right )}^{n} D[0]\left (f\right )\left (x\right )\right )} y\left (x\right )^{n}}{{\left (a g\left (x\right ) + b\right )}^{2 \, n} a^{2} f\left (x\right )^{2 \, n} y\left (x\right )^{2} - 2 \, {\left (a^{2} f\left (x\right )^{2 \, n + 1} g\left (x\right ) + a b f\left (x\right )^{2 \, n + 1}\right )} {\left (a g\left (x\right ) + b\right )}^{2 \, n} y\left (x\right ) + {\left (a^{2} f\left (x\right )^{2 \, n + 2} g\left (x\right )^{2} + 2 \, a b f\left (x\right )^{2 \, n + 2} g\left (x\right ) + b^{2} f\left (x\right )^{2 \, n + 2}\right )} {\left (a g\left (x\right ) + b\right )}^{2 \, n} + {\left (a^{2} f\left (x\right )^{2} g\left (x\right )^{2} + 2 \, a b f\left (x\right )^{2} g\left (x\right ) + b^{2} f\left (x\right )^{2}\right )} y\left (x\right )^{2 \, n} - 2 \, {\left ({\left (a^{2} f\left (x\right )^{n + 1} g\left (x\right ) + a b f\left (x\right )^{n + 1}\right )} {\left (a g\left (x\right ) + b\right )}^{n} y\left (x\right ) - {\left (a^{2} f\left (x\right )^{n + 2} g\left (x\right )^{2} + 2 \, a b f\left (x\right )^{n + 2} g\left (x\right ) + b^{2} f\left (x\right )^{n + 2}\right )} {\left (a g\left (x\right ) + b\right )}^{n}\right )} y\left (x\right )^{n}}\,{d x}}{{\left (a g\left (x\right ) + b\right )}^{n} a f\left (x\right )^{n} y\left (x\right ) - {\left (a f\left (x\right )^{n + 1} g\left (x\right ) + b f\left (x\right )^{n + 1}\right )} {\left (a g\left (x\right ) + b\right )}^{n} - {\left (a f\left (x\right ) g\left (x\right ) + b f\left (x\right )\right )} y\left (x\right )^{n}}\,{d \left (y\left (x\right )\right )} = c\right ], \text {\texttt {lie}}\right ] \]