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.23942 (sec), leaf count = 32

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

Maple
cpu = 0.014 (sec), leaf count = 31

\[\left [y \left (x \right ) = \frac {{\mathrm e}^{-x} \textit {\_C1}}{x^{2}}+\frac {x \,{\mathrm e}^{-2 x}+{\mathrm 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))

Maple raw output

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