72.8.28 problem 28

Internal problem ID [19512]
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. Miscellaneous Problems for Chapter 2. Problems at page 99
Problem number : 28
Date solved : Thursday, October 02, 2025 at 04:34:18 PM
CAS classification : [[_homogeneous, `class A`], _rational, _Riccati]

\begin{align*} y^{\prime }&=1+\frac {y}{x}-\frac {y^{2}}{x^{2}} \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 11
ode:=diff(y(x),x) = 1+y(x)/x-y(x)^2/x^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \tanh \left (\ln \left (x \right )+c_1 \right ) x \]
Mathematica. Time used: 0.139 (sec). Leaf size: 13
ode=D[y[x],x]==1+y[x]/x+(y[x]/x)^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to x \tan (\log (x)+c_1) \end{align*}
Sympy. Time used: 0.163 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) - 1 - y(x)/x + y(x)**2/x**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x \left (- C_{1} + x^{2} + 1\right )}{C_{1} + x^{2} - 1} \]