28.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, March 04, 2025 at 06:40:08 PM
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: 15.198 (sec). Leaf size: 20
ode:=2*y(x)-x*(ln(x^2*y(x))-1)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = -\frac {\operatorname {LambertW}\left (-\frac {c_{1} {\mathrm e}^{-1}}{x^{2}}\right ) {\mathrm e}}{c_{1}} \]
Mathematica. Time used: 6.868 (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.725 (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}} \]