##### 4.8.40 $$x^{2 n} y'(x)=-n x^{n-1}+x^n y(x) \left (x^{2 n} y(x)^2-3 x^n y(x)+1\right )+1$$

ODE
$x^{2 n} y'(x)=-n x^{n-1}+x^n y(x) \left (x^{2 n} y(x)^2-3 x^n y(x)+1\right )+1$ ODE Classiﬁcation

[_Abel]

Book solution method
Abel ODE, First kind

Mathematica
cpu = 0.469514 (sec), leaf count = 222

$\left \{\left \{y(x)\to x^{-n}-\frac {e^{\frac {2 x^{1-n}}{n-1}}}{\sqrt {-\frac {2^{\frac {3 n+1}{n-1}} x^{n+1} \left (\frac {x^{1-n}}{1-n}\right )^{\frac {n+1}{n-1}} \Gamma \left (\frac {n+1}{1-n},-\frac {4 x^{1-n}}{n-1}\right )}{n-1}+c_1}}\right \},\left \{y(x)\to x^{-n}+\frac {e^{\frac {2 x^{1-n}}{n-1}}}{\sqrt {-\frac {2^{\frac {3 n+1}{n-1}} x^{n+1} \left (\frac {x^{1-n}}{1-n}\right )^{\frac {n+1}{n-1}} \Gamma \left (\frac {n+1}{1-n},-\frac {4 x^{1-n}}{n-1}\right )}{n-1}+c_1}}\right \}\right \}$

Maple
cpu = 0.101 (sec), leaf count = 1008

$\left [y \left (x \right ) = -\frac {{\mathrm e}^{\frac {2 x \,x^{-n}}{n -1}}}{\sqrt {\textit {\_C1} -\frac {2 \,2^{-\frac {2 n}{1-n}-\frac {2}{1-n}} \left (\frac {1}{1-n}\right )^{\frac {n +1}{n -1}} \left (-\frac {2^{-3+\frac {2 n}{1-n}+\frac {2}{1-n}+\frac {2}{n -1}} \left (n -1\right ) x^{-\frac {n^{2}}{1-n}+\frac {1}{1-n}-1+n} \left (\frac {1}{1-n}\right )^{-\frac {n +1}{n -1}} \left (-\frac {4 x^{1-n} n^{2}}{1-n}+\frac {8 n \,x^{1-n}}{1-n}-\frac {4 x^{1-n}}{1-n}+2 n -2\right ) \left (1-n \right ) \left (\frac {x^{1-n}}{1-n}\right )^{\frac {1}{n -1}} {\mathrm e}^{-\frac {2 x^{1-n}}{1-n}} \WhittakerM \left (-\frac {n +1}{n -1}+\frac {1}{n -1}, -\frac {1}{n -1}+\frac {1}{2}, \frac {4 x^{1-n}}{1-n}\right )}{\left (n +1\right ) \left (-3+n \right )}+\frac {2^{-1+\frac {2 n}{1-n}+\frac {2}{1-n}+\frac {2}{n -1}} \left (n -1\right ) x^{-\frac {n^{2}}{1-n}+\frac {1}{1-n}-1+n} \left (\frac {1}{1-n}\right )^{-\frac {n +1}{n -1}} \left (1-n \right ) \left (\frac {x^{1-n}}{1-n}\right )^{\frac {1}{n -1}} {\mathrm e}^{-\frac {2 x^{1-n}}{1-n}} \WhittakerM \left (-\frac {n +1}{n -1}+\frac {1}{n -1}+1, -\frac {1}{n -1}+\frac {1}{2}, \frac {4 x^{1-n}}{1-n}\right )}{\left (n +1\right ) \left (-3+n \right )}\right )}{1-n}}}+x^{-n}, y \left (x \right ) = \frac {{\mathrm e}^{\frac {2 x \,x^{-n}}{n -1}}}{\sqrt {\textit {\_C1} -\frac {2 \,2^{-\frac {2 n}{1-n}-\frac {2}{1-n}} \left (\frac {1}{1-n}\right )^{\frac {n +1}{n -1}} \left (-\frac {2^{-3+\frac {2 n}{1-n}+\frac {2}{1-n}+\frac {2}{n -1}} \left (n -1\right ) x^{-\frac {n^{2}}{1-n}+\frac {1}{1-n}-1+n} \left (\frac {1}{1-n}\right )^{-\frac {n +1}{n -1}} \left (-\frac {4 x^{1-n} n^{2}}{1-n}+\frac {8 n \,x^{1-n}}{1-n}-\frac {4 x^{1-n}}{1-n}+2 n -2\right ) \left (1-n \right ) \left (\frac {x^{1-n}}{1-n}\right )^{\frac {1}{n -1}} {\mathrm e}^{-\frac {2 x^{1-n}}{1-n}} \WhittakerM \left (-\frac {n +1}{n -1}+\frac {1}{n -1}, -\frac {1}{n -1}+\frac {1}{2}, \frac {4 x^{1-n}}{1-n}\right )}{\left (n +1\right ) \left (-3+n \right )}+\frac {2^{-1+\frac {2 n}{1-n}+\frac {2}{1-n}+\frac {2}{n -1}} \left (n -1\right ) x^{-\frac {n^{2}}{1-n}+\frac {1}{1-n}-1+n} \left (\frac {1}{1-n}\right )^{-\frac {n +1}{n -1}} \left (1-n \right ) \left (\frac {x^{1-n}}{1-n}\right )^{\frac {1}{n -1}} {\mathrm e}^{-\frac {2 x^{1-n}}{1-n}} \WhittakerM \left (-\frac {n +1}{n -1}+\frac {1}{n -1}+1, -\frac {1}{n -1}+\frac {1}{2}, \frac {4 x^{1-n}}{1-n}\right )}{\left (n +1\right ) \left (-3+n \right )}\right )}{1-n}}}+x^{-n}\right ]$ Mathematica raw input

DSolve[x^(2*n)*y'[x] == 1 - n*x^(-1 + n) + x^n*y[x]*(1 - 3*x^n*y[x] + x^(2*n)*y[x]^2),y[x],x]

Mathematica raw output

{{y[x] -> x^(-n) - E^((2*x^(1 - n))/(-1 + n))/Sqrt[C[1] - (2^((1 + 3*n)/(-1 + n)
)*x^(1 + n)*(x^(1 - n)/(1 - n))^((1 + n)/(-1 + n))*Gamma[(1 + n)/(1 - n), (-4*x^
(1 - n))/(-1 + n)])/(-1 + n)]}, {y[x] -> x^(-n) + E^((2*x^(1 - n))/(-1 + n))/Sqr
t[C[1] - (2^((1 + 3*n)/(-1 + n))*x^(1 + n)*(x^(1 - n)/(1 - n))^((1 + n)/(-1 + n)
)*Gamma[(1 + n)/(1 - n), (-4*x^(1 - n))/(-1 + n)])/(-1 + n)]}}

Maple raw input

dsolve(x^(2*n)*diff(y(x),x) = 1-n*x^(n-1)+x^n*y(x)*(1-3*x^n*y(x)+x^(2*n)*y(x)^2), y(x))

Maple raw output

[y(x) = -exp(2*x/(n-1)/(x^n))/(_C1-2*2^(-2*n/(1-n)-2/(1-n))*(1/(1-n))^(-n/(1-n)-
1/(1-n))/(1-n)*(-2^(-3+2*n/(1-n)+2/(1-n)+2/(n-1))*(n-1)/(n+1)*x^(-n^2/(1-n)+1/(1
-n)-1+n)*(1/(1-n))^(n/(1-n)+1/(1-n))*(-4*x^(1-n)/(1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