44.4.1 problem 1

Internal problem ID [9136]
Book : Differential Equations: Theory, Technique, and Practice by George Simmons, Steven Krantz. McGraw-Hill NY. 2007. 1st Edition.
Section : Chapter 1. What is a differential equation. Section 1.5. Exact Equations. Page 20
Problem number : 1
Date solved : Tuesday, September 30, 2025 at 06:05:54 PM
CAS classification : [[_homogeneous, `class G`], _exact, _rational, [_Abel, `2nd type`, `class B`]]

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