22.1.121 problem 144

Internal problem ID [4427]
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 : 144
Date solved : Tuesday, September 30, 2025 at 07:31:42 AM
CAS classification : [_rational, [_1st_order, `_with_symmetry_[F(x)*G(y),0]`]]

\begin{align*} y+\left (x y-x -y^{3}\right ) y^{\prime }&=0 \end{align*}
Maple. Time used: 0.006 (sec). Leaf size: 23
ode:=y(x)+(x*y(x)-x-y(x)^3)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ x -y^{2}+y-{\mathrm e}^{-y} c_1 y = 0 \]
Mathematica. Time used: 0.1 (sec). Leaf size: 24
ode=y[x]+(x*y[x]-x-y[x]^3)*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [x=(y(x)-1) y(x)+c_1 e^{-y(x)} y(x),y(x)\right ] \]
Sympy. Time used: 0.572 (sec). Leaf size: 22
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x*y(x) - x - y(x)**3)*Derivative(y(x), x) + y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ C_{1} + \frac {x e^{y{\left (x \right )}}}{y{\left (x \right )}} - \left (y{\left (x \right )} - 1\right ) e^{y{\left (x \right )}} = 0 \]