4.8.36 y(x)(xn1+y(x))+xny(x)+x2=0

ODE
y(x)(xn1+y(x))+xny(x)+x2=0 ODE Classification

[_Riccati]

Book solution method
Change of Variable, new dependent variable

Mathematica
cpu = 0.201479 (sec), leaf count = 470

{{y(x)xn1(c1(x2n)1nΓ(43n42n)(Jn2(n2)1((x2n)1n122n))+c1(x2n)1nΓ(43n42n)Jn2(n2)+1((x2n)1n122n)+c1nx2nΓ(43n42n)Jn2(n2)((x2n)1n122n)+(x2n)1nΓ(n42(n2))Jn42(n2)((x2n)1n122n)(x2n)1nΓ(n42(n2))Jn42n1((x2n)1n122n)+nx2nΓ(n42(n2))Jn42n((x2n)1n122n))2x2n(c1Γ(43n42n)Jn2(n2)((x2n)1n122n)+Γ(n42(n2))Jn42n((x2n)1n122n))}}

Maple
cpu = 0.64 (sec), leaf count = 218

{y(x)=xnx(n4)(x3n+4_C1(n4)30F1( ;5n82n4;x2n+44(n2)2)+(n43)(0F1( ;3n42n4;x2n+44(n2)2)n(n4)_C1xn+x2n+40F1( ;3n82n4;x2n+44(n2)2)))(n43)1(_C1xn0F1( ;3n42n4;x2n+44(n2)2)+0F1( ;n42n4;x2n+44(n2)2))1} Mathematica raw input

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

Mathematica raw output

{{y[x] -> -(x^(-1 + n)*(n*Sqrt[x^(2*n)]*BesselJ[n/(2*(-2 + n)), (x^(2*n))^(-1/2 
+ n^(-1))/(2 - n)]*C[1]*Gamma[(4 - 3*n)/(4 - 2*n)] - (x^(2*n))^n^(-1)*BesselJ[-1
 + n/(2*(-2 + n)), (x^(2*n))^(-1/2 + n^(-1))/(2 - n)]*C[1]*Gamma[(4 - 3*n)/(4 - 
2*n)] + (x^(2*n))^n^(-1)*BesselJ[1 + n/(2*(-2 + n)), (x^(2*n))^(-1/2 + n^(-1))/(
2 - n)]*C[1]*Gamma[(4 - 3*n)/(4 - 2*n)] + (x^(2*n))^n^(-1)*BesselJ[(-4 + n)/(2*(
-2 + n)), (x^(2*n))^(-1/2 + n^(-1))/(2 - n)]*Gamma[(-4 + n)/(2*(-2 + n))] + n*Sq
rt[x^(2*n)]*BesselJ[n/(4 - 2*n), (x^(2*n))^(-1/2 + n^(-1))/(2 - n)]*Gamma[(-4 + 
n)/(2*(-2 + n))] - (x^(2*n))^n^(-1)*BesselJ[-1 + n/(4 - 2*n), (x^(2*n))^(-1/2 + 
n^(-1))/(2 - n)]*Gamma[(-4 + n)/(2*(-2 + n))]))/(2*Sqrt[x^(2*n)]*(BesselJ[n/(2*(
-2 + n)), (x^(2*n))^(-1/2 + n^(-1))/(2 - n)]*C[1]*Gamma[(4 - 3*n)/(4 - 2*n)] + B
esselJ[n/(4 - 2*n), (x^(2*n))^(-1/2 + n^(-1))/(2 - n)]*Gamma[(-4 + n)/(2*(-2 + n
))]))}}

Maple raw input

dsolve(x^n*diff(y(x),x)+x^2+(x^(n-1)+y(x))*y(x) = 0, y(x),'implicit')

Maple raw output

y(x) = (1/3*x^(-3*n+4)*_C1*hypergeom([],[(5*n-8)/(2*n-4)],-1/4/(n-2)^2*x^(-2*n+4
))*(n-4)+(n-4/3)*(-hypergeom([],[(3*n-4)/(2*n-4)],-1/4/(n-2)^2*x^(-2*n+4))*n*(n-
4)*_C1*x^(-n)+x^(-2*n+4)*hypergeom([],[(3*n-8)/(2*n-4)],-1/4/(n-2)^2*x^(-2*n+4))
))*x^n/(n-4/3)/(n-4)/(_C1*x^(-n)*hypergeom([],[(3*n-4)/(2*n-4)],-1/4/(n-2)^2*x^(
-2*n+4))+hypergeom([],[(n-4)/(2*n-4)],-1/4/(n-2)^2*x^(-2*n+4)))/x