23.1.603 problem 597

Internal problem ID [5210]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 1. THE DIFFERENTIAL EQUATION IS OF FIRST ORDER AND OF FIRST DEGREE, page 223
Problem number : 597
Date solved : Tuesday, September 30, 2025 at 11:55:50 AM
CAS classification : [_separable]

\begin{align*} y^{2} y^{\prime }+x \left (2-y\right )&=0 \end{align*}
Maple. Time used: 0.005 (sec). Leaf size: 27
ode:=y(x)^2*diff(y(x),x)+x*(2-y(x)) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ \frac {x^{2}}{2}-\frac {y^{2}}{2}-2 y-4 \ln \left (y-2\right )+c_1 = 0 \]
Mathematica. Time used: 0.151 (sec). Leaf size: 41
ode=y[x]^2*D[y[x],x]+x*(2-y[x])==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \text {InverseFunction}\left [\int _1^{\text {$\#$1}}\frac {K[1]^2}{K[1]-2}dK[1]\&\right ]\left [\frac {x^2}{2}+c_1\right ]\\ y(x)&\to 2 \end{align*}
Sympy. Time used: 0.260 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*(2 - y(x)) + y(x)**2*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ - \frac {x^{2}}{2} + \frac {y^{2}{\left (x \right )}}{2} + 2 y{\left (x \right )} + 4 \log {\left (y{\left (x \right )} - 2 \right )} = C_{1} \]