28.1.50 problem 51

Internal problem ID [4356]
Book : Differential equations for engineers by Wei-Chau XIE, Cambridge Press 2010
Section : Chapter 2. First-Order and Simple Higher-Order Differential Equations. Page 78
Problem number : 51
Date solved : Sunday, March 30, 2025 at 03:10:11 AM
CAS classification : [[_1st_order, _with_linear_symmetries], [_Abel, `2nd type`, `class A`]]

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

Maple. Time used: 0.030 (sec). Leaf size: 16
ode:=y(x)^2+(exp(x)-y(x))*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -{\mathrm e}^{x} \operatorname {LambertW}\left (-c_1 \,{\mathrm e}^{-x}\right ) \]
Mathematica. Time used: 6.758 (sec). Leaf size: 306
ode=(y[x]^2)+( Exp[x]-y[x])*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [\frac {1}{9} 2^{2/3} \left (\frac {\left (\frac {e^x-\frac {3 e^{2 x}}{e^x-y(x)}}{\sqrt [3]{e^{3 x}}}+2\right ) \left (\frac {e^x \left (y(x)+2 e^x\right )}{\sqrt [3]{e^{3 x}} \left (e^x-y(x)\right )}+1\right ) \left (\left (\frac {e^x-\frac {3 e^{2 x}}{e^x-y(x)}}{\sqrt [3]{e^{3 x}}}-1\right ) \log \left (2^{2/3} \left (\frac {e^x-\frac {3 e^{2 x}}{e^x-y(x)}}{\sqrt [3]{e^{3 x}}}+2\right )\right )+\left (\frac {e^x \left (y(x)+2 e^x\right )}{\sqrt [3]{e^{3 x}} \left (e^x-y(x)\right )}+1\right ) \log \left (2^{2/3} \left (\frac {e^x \left (y(x)+2 e^x\right )}{\sqrt [3]{e^{3 x}} \left (e^x-y(x)\right )}+1\right )\right )-3\right )}{\frac {\left (y(x)+2 e^x\right )^3}{\left (e^x-y(x)\right )^3}-\frac {3 e^x \left (y(x)+2 e^x\right )}{\sqrt [3]{e^{3 x}} \left (e^x-y(x)\right )}-2}+e^{-2 x} \left (e^{3 x}\right )^{2/3} x\right )=c_1,y(x)\right ] \]
Sympy. Time used: 0.667 (sec). Leaf size: 14
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((-y(x) + exp(x))*Derivative(y(x), x) + y(x)**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = - e^{x} W\left (C_{1} e^{- x}\right ) \]