58.12.18 problem 18

Internal problem ID [14803]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 4, Section 4.4. Variation of parameters. Exercises page 162
Problem number : 18
Date solved : Thursday, October 02, 2025 at 09:55:04 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y-2 y^{\prime }+y^{\prime \prime }&=x \ln \left (x \right ) \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 30
ode:=diff(diff(y(x),x),x)-2*diff(y(x),x)+y(x) = x*ln(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -{\mathrm e}^{x} \left (x -2\right ) \operatorname {Ei}_{1}\left (x \right )+\left (c_1 x +c_2 \right ) {\mathrm e}^{x}+3+\left (x +2\right ) \ln \left (x \right ) \]
Mathematica. Time used: 0.038 (sec). Leaf size: 37
ode=D[y[x],{x,2}]-2*D[y[x],x]+y[x]==x*Log[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^x (x-2) \operatorname {ExpIntegralEi}(-x)+(x+2) \log (x)+c_1 e^x+c_2 e^x x+3 \end{align*}
Sympy. Time used: 3.499 (sec). Leaf size: 34
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*log(x) + y(x) - 2*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x \log {\left (x \right )} + \left (C_{1} + x \left (C_{2} + \operatorname {Ei}{\left (- x \right )}\right ) - 2 \operatorname {Ei}{\left (- x \right )}\right ) e^{x} + 2 \log {\left (x \right )} + 3 \]