4.28.38 \(x y''(x)-(2 x+1) y'(x)+(x+1) y(x)=x^2-x-1\)

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

[[_2nd_order, _with_linear_symmetries]]

Book solution method
TO DO

Mathematica
cpu = 0.0600118 (sec), leaf count = 25

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

Maple
cpu = 0.016 (sec), leaf count = 16

\[ \left \{ y \left ( x \right ) = \left ( {\it \_C1}\,{x}^{2}+{\it \_C2} \right ) {{\rm e}^{x}}+x \right \} \] Mathematica raw input

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

Mathematica raw output

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

Maple raw input

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

Maple raw output

y(x) = (_C1*x^2+_C2)*exp(x)+x