78.5.8 problem 2 (h)

Internal problem ID [18072]
Book : DIFFERENTIAL EQUATIONS WITH APPLICATIONS AND HISTORICAL NOTES by George F. Simmons. 3rd edition. 2017. CRC press, Boca Raton FL.
Section : Chapter 2. First order equations. Section 9 (Integrating Factors). Problems at page 80
Problem number : 2 (h)
Date solved : Thursday, March 13, 2025 at 11:33:20 AM
CAS classification : [[_1st_order, `_with_symmetry_[F(x)*G(y),0]`]]

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

Maple. Time used: 0.022 (sec). Leaf size: 34
ode:=y(x)+(2*x-y(x)*exp(y(x)))*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ \frac {\left (-y^{2}+2 y-2\right ) {\mathrm e}^{y}+x y^{2}-c_1}{y^{2}} = 0 \]
Mathematica. Time used: 0.229 (sec). Leaf size: 32
ode=( y[x] )+( 2*x-y[x]*Exp[y[x]] )*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [x=\frac {e^{y(x)} \left (y(x)^2-2 y(x)+2\right )}{y(x)^2}+\frac {c_1}{y(x)^2},y(x)\right ] \]
Sympy. Time used: 0.872 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((2*x - y(x)*exp(y(x)))*Derivative(y(x), x) + y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ C_{1} + x y^{2}{\left (x \right )} - \left (y^{2}{\left (x \right )} - 2 y{\left (x \right )} + 2\right ) e^{y{\left (x \right )}} = 0 \]