22.1.102 problem 125

Internal problem ID [4408]
Book : Differential equations for engineers by Wei-Chau XIE, Cambridge Press 2010
Section : Chapter 2. First-Order and Simple Higher-Order Differential Equations. Page 78
Problem number : 125
Date solved : Tuesday, September 30, 2025 at 07:28:10 AM
CAS classification : [[_homogeneous, `class G`]]

\begin{align*} 2 y-x \left (\ln \left (x^{2} y\right )-1\right ) y^{\prime }&=0 \end{align*}
Maple. Time used: 0.939 (sec). Leaf size: 29
ode:=2*y(x)-x*(ln(x^2*y(x))-1)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ \ln \left (x \right )-c_1 -\frac {\ln \left (x^{2} y\right )}{2}+\frac {1}{2}+\frac {\ln \left (\ln \left (x^{2} y\right )\right )}{2} = 0 \]
Mathematica. Time used: 3.893 (sec). Leaf size: 37
ode=2*y[x]-x*(Log[x^2*y[x]]-1)*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -e^{-2 c_1} W\left (-\frac {e^{2 c_1}}{x^2}\right )\\ y(x)&\to 0\\ y(x)&\to \frac {1}{x^2} \end{align*}
Sympy. Time used: 0.430 (sec). Leaf size: 15
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*(log(x**2*y(x)) - 1)*Derivative(y(x), x) + 2*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {e^{- W\left (\frac {C_{1}}{x^{2}}\right )}}{x^{2}} \]