28.1.58 problem 59

Internal problem ID [4364]
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 : 59
Date solved : Sunday, March 30, 2025 at 03:10:30 AM
CAS classification : [[_1st_order, _with_exponential_symmetries]]

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

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