78.14.20 problem 6 (e)

Internal problem ID [18285]
Book : DIFFERENTIAL EQUATIONS WITH APPLICATIONS AND HISTORICAL NOTES by George F. Simmons. 3rd edition. 2017. CRC press, Boca Raton FL.
Section : Chapter 3. Second order linear equations. Section 19. The Method of Variation of Parameters. Problems at page 135
Problem number : 6 (e)
Date solved : Monday, March 31, 2025 at 05:24:51 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} x^{2} y^{\prime \prime }-2 x y^{\prime }+2 y&=x \,{\mathrm e}^{-x} \end{align*}

Maple. Time used: 0.005 (sec). Leaf size: 25
ode:=x^2*diff(diff(y(x),x),x)-2*x*diff(y(x),x)+2*y(x) = x*exp(-x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = x \left (\operatorname {Ei}_{1}\left (x \right ) x +c_1 x +\operatorname {Ei}_{1}\left (x \right )-{\mathrm e}^{-x}+c_2 \right ) \]
Mathematica. Time used: 0.078 (sec). Leaf size: 30
ode=x^2*D[y[x],{x,2}]-2*x*D[y[x],x]+2*y[x]==x*Exp[-x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to x \left (-(x+1) \operatorname {ExpIntegralEi}(-x)-e^{-x}+c_2 x+c_1\right ) \]
Sympy. Time used: 0.836 (sec). Leaf size: 32
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*Derivative(y(x), (x, 2)) - 2*x*Derivative(y(x), x) - x*exp(-x) + 2*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x \left (C_{1} + C_{2} x - x \operatorname {Ei}{\left (x e^{i \pi } \right )} - \operatorname {Ei}{\left (x e^{i \pi } \right )} - e^{- x}\right ) \]