23.1.579 problem 572

Internal problem ID [5186]
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 : 572
Date solved : Tuesday, September 30, 2025 at 11:51:42 AM
CAS classification : [[_homogeneous, `class G`], _rational, [_Abel, `2nd type`, `class C`]]

\begin{align*} x \left (2-x y\right ) y^{\prime }+2 y-x y^{2} \left (1+x y\right )&=0 \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 59
ode:=x*(2-x*y(x))*diff(y(x),x)+2*y(x)-x*y(x)^2*(1+x*y(x)) = 0; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= \frac {-1+\sqrt {1-4 \ln \left (x \right )+4 c_1}}{2 \left (-\ln \left (x \right )+c_1 \right ) x} \\ y &= \frac {1+\sqrt {1-4 \ln \left (x \right )+4 c_1}}{2 \left (\ln \left (x \right )-c_1 \right ) x} \\ \end{align*}
Mathematica. Time used: 0.772 (sec). Leaf size: 86
ode=x*(2-x*y[x])*D[y[x],x]+2*y[x]-x*y[x]^2*(1+x*y[x])==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {2}{x+\sqrt {-\frac {1}{x^3}} x^2 \sqrt {-x (-4 \log (x)+1+4 c_1)}}\\ y(x)&\to \frac {2}{x+\left (-\frac {1}{x^3}\right )^{3/2} x^5 \sqrt {-x (-4 \log (x)+1+4 c_1)}}\\ y(x)&\to 0 \end{align*}
Sympy. Time used: 0.711 (sec). Leaf size: 51
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*(-x*y(x) + 2)*Derivative(y(x), x) - x*(x*y(x) + 1)*y(x)**2 + 2*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = \frac {1 - \sqrt {- 4 C_{1} - 4 \log {\left (x \right )} + 1}}{2 x \left (C_{1} + \log {\left (x \right )}\right )}, \ y{\left (x \right )} = \frac {\sqrt {- 4 C_{1} - 4 \log {\left (x \right )} + 1} + 1}{2 x \left (C_{1} + \log {\left (x \right )}\right )}\right ] \]