4.6.8 \(x^2 y'(x)+(x+2) x y(x)=\left (1-e^{-2 x}\right ) x-2\)

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

[_linear]

Book solution method
Linear ODE

Mathematica
cpu = 0.0318917 (sec), leaf count = 32

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

Maple
cpu = 0.013 (sec), leaf count = 27

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

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

Mathematica raw output

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

Maple raw input

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

Maple raw output

y(x) = (exp(-x)*_C1+x*exp(-2*x)+exp(-2*x)+x-3)/x^2