73.3.46 problem 4.8 (e)

Internal problem ID [15009]
Book : Ordinary Differential Equations. An introduction to the fundamentals. Kenneth B. Howell. second edition. CRC Press. FL, USA. 2020
Section : Chapter 4. SEPARABLE FIRST ORDER EQUATIONS. Additional exercises. page 90
Problem number : 4.8 (e)
Date solved : Monday, March 31, 2025 at 01:12:07 PM
CAS classification : [_separable]

\begin{align*} x y^{\prime }&=y^{2}-y \end{align*}

With initial conditions

\begin{align*} y \left (1\right )&=2 \end{align*}

Maple. Time used: 0.069 (sec). Leaf size: 11
ode:=x*diff(y(x),x) = y(x)^2-y(x); 
ic:=y(1) = 2; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = -\frac {2}{x -2} \]
Mathematica. Time used: 0.277 (sec). Leaf size: 12
ode=x*D[y[x],x]==y[x]^2-y[x]; 
ic={y[1]==2}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -\frac {2}{x-2} \]
Sympy. Time used: 0.294 (sec). Leaf size: 10
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), x) - y(x)**2 + y(x),0) 
ics = {y(1): 2} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = - \frac {1}{\frac {x}{2} - 1} \]