4.7.20 \(x (x+1) y'(x)=\left (x^2+x-1\right ) y(x)+(x+1) \left (x^2-1\right )\)

ODE
\[ x (x+1) y'(x)=\left (x^2+x-1\right ) y(x)+(x+1) \left (x^2-1\right ) \] ODE Classification

[_linear]

Book solution method
Linear ODE

Mathematica
cpu = 0.0126451 (sec), leaf count = 22

\[\left \{\left \{y(x)\to -\frac {(x+1) \left (x-c_1 e^x\right )}{x}\right \}\right \}\]

Maple
cpu = 0.02 (sec), leaf count = 19

\[ \left \{ y \relax (x ) =-{\frac { \left (1+x \right ) \left (-{{\rm e}^{x}}{\it \_C1}+x \right ) }{x}} \right \} \] Mathematica raw input

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

Mathematica raw output

{{y[x] -> -(((1 + x)*(x - E^x*C[1]))/x)}}

Maple raw input

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

Maple raw output

y(x) = -(1+x)*(-exp(x)*_C1+x)/x