58.5.10 problem 10

Internal problem ID [14604]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 2, section 2.3 (Linear equations). Exercises page 56
Problem number : 10
Date solved : Thursday, October 02, 2025 at 09:43:59 AM
CAS classification : [_rational, [_1st_order, `_with_symmetry_[F(x)*G(y),0]`]]

\begin{align*} y+\left (x y^{2}+x -y\right ) y^{\prime }&=0 \end{align*}
Maple. Time used: 0.011 (sec). Leaf size: 35
ode:=y(x)+(x*y(x)^2+x-y(x))*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {{\mathrm e}^{\operatorname {RootOf}\left ({\mathrm e}^{2 \textit {\_Z}} c_1^{2}+2 \textit {\_Z} \,x^{2}+2 \,{\mathrm e}^{\textit {\_Z}} c_1 +1\right )} c_1 +1}{x} \]
Mathematica. Time used: 0.11 (sec). Leaf size: 27
ode=y[x]+(x*y[x]^2+x-y[x])*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [x=\frac {1}{y(x)}+\frac {c_1 e^{-\frac {1}{2} y(x)^2}}{y(x)},y(x)\right ] \]
Sympy. Time used: 0.720 (sec). Leaf size: 27
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x*y(x)**2 + x - y(x))*Derivative(y(x), x) + y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ C_{1} + x y{\left (x \right )} \sqrt {e^{y^{2}{\left (x \right )}}} - \sqrt {e^{y^{2}{\left (x \right )}}} = 0 \]