64.12.18 problem 18

Internal problem ID [13443]
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 : Wednesday, March 05, 2025 at 10:00:42 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-2 y^{\prime }+y&=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.09 (sec). Leaf size: 59
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]
 
\[ y(x)\to e^x \left (\int _1^x-e^{-K[1]} K[1]^2 \log (K[1])dK[1]+x \int _1^xe^{-K[2]} K[2] \log (K[2])dK[2]+c_2 x+c_1\right ) \]
Sympy. Time used: 6.293 (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 \]