89.4.23 problem 24

Internal problem ID [24345]
Book : A short course in Differential Equations. Earl D. Rainville. Second edition. 1958. Macmillan Publisher, NY. CAT 58-5010
Section : Chapter 2. Equations of the first order and first degree. Exercises at page 39
Problem number : 24
Date solved : Thursday, October 02, 2025 at 10:20:47 PM
CAS classification : [[_homogeneous, `class G`], _rational]

\begin{align*} y \left (2 x +y^{2}\right )+x \left (-x +y^{2}\right ) y^{\prime }&=0 \end{align*}
Maple. Time used: 0.242 (sec). Leaf size: 53
ode:=y(x)*(y(x)^2+2*x)+x*(y(x)^2-x)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= \frac {{\mathrm e}^{\frac {3 c_1}{2}}+\sqrt {{\mathrm e}^{3 c_1}-4 x^{3}}}{2 x} \\ y &= \frac {{\mathrm e}^{\frac {3 c_1}{2}}-\sqrt {{\mathrm e}^{3 c_1}-4 x^{3}}}{2 x} \\ \end{align*}
Mathematica. Time used: 0.177 (sec). Leaf size: 64
ode=y[x]*(2*x+y[x]^2 )+x*( y[x]^2-x)*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {\sqrt {-4 x^3+c_1{}^2}-c_1}{2 x}\\ y(x)&\to -\frac {\sqrt {-4 x^3+c_1{}^2}+c_1}{2 x}\\ y(x)&\to 0 \end{align*}
Sympy. Time used: 7.897 (sec). Leaf size: 56
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*(-x + y(x)**2)*Derivative(y(x), x) + (2*x + y(x)**2)*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = \frac {\left (1 - \sqrt {- 4 x^{3} e^{6 C_{1}} + 1}\right ) e^{- 3 C_{1}}}{2 x}, \ y{\left (x \right )} = \frac {\left (- \sqrt {- 4 x^{3} e^{6 C_{1}} + 1} - 1\right ) e^{- 3 C_{1}}}{2 x}\right ] \]