64.5.15 problem 15

Internal problem ID [13257]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 2, section 2.3 (Linear equations). Exercises page 56
Problem number : 15
Date solved : Monday, March 31, 2025 at 07:43:52 AM
CAS classification : [_separable]

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

Maple. Time used: 0.003 (sec). Leaf size: 11
ode:=diff(y(x),x)-y(x)/x = -y(x)^2/x; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {x}{x +c_1} \]
Mathematica. Time used: 0.262 (sec). Leaf size: 43
ode=D[y[x],x]-y[x]/x==-y[x]^2/x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \text {InverseFunction}\left [\int _1^{\text {$\#$1}}\frac {1}{(K[1]-1) K[1]}dK[1]\&\right ][-\log (x)+c_1] \\ y(x)\to 0 \\ y(x)\to 1 \\ \end{align*}
Sympy. Time used: 0.298 (sec). Leaf size: 7
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) + y(x)**2/x - y(x)/x,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x}{C_{1} + x} \]