82.12.5 problem Ex. 5

Internal problem ID [18699]
Book : Introductory Course On Differential Equations by Daniel A Murray. Longmans Green and Co. NY. 1924
Section : Chapter II. Equations of the first order and of the first degree. Examples on chapter II at page 29
Problem number : Ex. 5
Date solved : Monday, March 31, 2025 at 05:59:14 PM
CAS classification : [_separable]

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

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