28.2.66 problem 66

Internal problem ID [4509]
Book : Differential equations for engineers by Wei-Chau XIE, Cambridge Press 2010
Section : Chapter 4. Linear Differential Equations. Page 183
Problem number : 66
Date solved : Tuesday, March 04, 2025 at 06:49:35 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} x^{2} y^{\prime \prime }-x y^{\prime }+y&=\ln \left (x \right ) \end{align*}

Maple. Time used: 0.004 (sec). Leaf size: 16
ode:=x^2*diff(diff(y(x),x),x)-x*diff(y(x),x)+y(x) = ln(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = c_{2} x +\ln \left (x \right ) c_{1} x +\ln \left (x \right )+2 \]
Mathematica. Time used: 0.026 (sec). Leaf size: 19
ode=x^2*D[y[x],{x,2}]-x*D[y[x],x]+y[x]==Log[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \log (x)+c_1 x+c_2 x \log (x)+2 \]
Sympy. Time used: 0.190 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*Derivative(y(x), (x, 2)) - x*Derivative(y(x), x) + y(x) - log(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} x + C_{2} x \log {\left (x \right )} + \log {\left (x \right )} + 2 \]