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

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

[[_2nd_order, _with_linear_symmetries]]

Book solution method
TO DO

Mathematica
cpu = 32.6117 (sec), leaf count = 45

\[\left \{\left \{y(x)\to e^{-x} \left (c_2 \int _1^x e^{\frac {K[1]^2+K[1]-1}{K[1]+1}} (K[1]+1) \, dK[1]+c_1\right )\right \}\right \}\]

Maple
cpu = 0.331 (sec), leaf count = 53

\[ \left \{ y \left ( x \right ) = \left ( 1+x \right ) \left ( {\it \_C2}\,{\it HeunD} \left ( -4,4,-8,12,{\frac {x}{2+x}} \right ) {{\rm e}^{{\frac {-1+x}{2+2\,x}}}}+{\it \_C1}\,{{\rm e}^{-x}}{\it HeunD} \left ( 4,4,-8,12,{\frac {x}{2+x}} \right ) \right ) \right \} \] Mathematica raw input

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

Mathematica raw output

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

Maple raw input

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

Maple raw output

y(x) = (1+x)*(_C2*HeunD(-4,4,-8,12,x/(2+x))*exp((-1+x)/(2+2*x))+_C1*exp(-x)*Heun
D(4,4,-8,12,x/(2+x)))