15.5.3 problem 3

Internal problem ID [2939]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 9, page 38
Problem number : 3
Date solved : Sunday, March 30, 2025 at 01:00:17 AM
CAS classification : [_separable]

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

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