89.6.37 problem 38

Internal problem ID [24420]
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. Miscellaneous Exercises at page 45
Problem number : 38
Date solved : Thursday, October 02, 2025 at 10:26:55 PM
CAS classification : [[_1st_order, _with_linear_symmetries], _rational]

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

With initial conditions

\begin{align*} y \left (-1\right )&=1 \\ \end{align*}
Maple. Time used: 0.108 (sec). Leaf size: 22
ode:=y(x)^2+(x*y(x)+y(x)^2-1)*diff(y(x),x) = 0; 
ic:=[y(-1) = 1]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = {\mathrm e}^{\operatorname {RootOf}\left (-{\mathrm e}^{2 \textit {\_Z}}-2 x \,{\mathrm e}^{\textit {\_Z}}+2 \textit {\_Z} -1\right )} \]
Mathematica. Time used: 0.1 (sec). Leaf size: 31
ode=( y[x]^2 ) + ( x*y[x]+y[x]^2-1 )*D[y[x],x]==0; 
ic={y[-1]==1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [x=\frac {\log (y(x))-\frac {y(x)^2}{2}}{y(x)}-\frac {1}{2 y(x)},y(x)\right ] \]
Sympy. Time used: 0.571 (sec). Leaf size: 20
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x*y(x) + y(x)**2 - 1)*Derivative(y(x), x) + y(x)**2,0) 
ics = {y(-1): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ x y{\left (x \right )} + \frac {y^{2}{\left (x \right )}}{2} - \log {\left (y{\left (x \right )} \right )} + \frac {1}{2} = 0 \]