32.1.8 problem First order with homogeneous Coefficients. Exercise 7.9, page 61

Internal problem ID [5778]
Book : Ordinary Differential Equations, By Tenenbaum and Pollard. Dover, NY 1963
Section : Chapter 2. Special types of differential equations of the first kind. Lesson 7
Problem number : First order with homogeneous Coefficients. Exercise 7.9, page 61
Date solved : Tuesday, March 04, 2025 at 11:43:05 PM
CAS classification : [[_homogeneous, `class A`], _dAlembert]

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

Maple. Time used: 0.057 (sec). Leaf size: 16
ode:=y(x)+x*ln(y(x)/x)*diff(y(x),x)-2*x*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = -\frac {\operatorname {LambertW}\left (-{\mathrm e} x c_{1} \right )}{c_{1}} \]
Mathematica. Time used: 5.206 (sec). Leaf size: 35
ode=y[x]+x*Log[y[x]/x]*D[y[x],x]-2*x*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -e^{c_1} W\left (-e^{1-c_1} x\right ) \\ y(x)\to 0 \\ y(x)\to e x \\ \end{align*}
Sympy. Time used: 0.882 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*log(y(x)/x)*Derivative(y(x), x) - 2*x*Derivative(y(x), x) + y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = - e^{C_{1}} W\left (- x e^{1 - C_{1}}\right ) \]