57.1.21 problem 21

Internal problem ID [9005]
Book : First order enumerated odes
Section : section 1
Problem number : 21
Date solved : Wednesday, March 05, 2025 at 07:14:13 AM
CAS classification : [_rational, _Riccati]

\begin{align*} c y^{\prime }&=\frac {a x +b y^{2}}{r x} \end{align*}

Maple. Time used: 0.011 (sec). Leaf size: 94
ode:=c*diff(y(x),x) = (a*x+b*y(x)^2)/r/x; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\sqrt {\frac {x b a}{r^{2} c^{2}}}\, c r \left (\operatorname {BesselY}\left (1, 2 \sqrt {\frac {x b a}{r^{2} c^{2}}}\right ) c_{1} +\operatorname {BesselJ}\left (1, 2 \sqrt {\frac {x b a}{r^{2} c^{2}}}\right )\right )}{b \left (c_{1} \operatorname {BesselY}\left (0, 2 \sqrt {\frac {x b a}{r^{2} c^{2}}}\right )+\operatorname {BesselJ}\left (0, 2 \sqrt {\frac {x b a}{r^{2} c^{2}}}\right )\right )} \]
Mathematica. Time used: 0.291 (sec). Leaf size: 207
ode=c*D[y[x],x]==(a*x+b*y[x]^2)/(r*x); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {\sqrt {a} \sqrt {x} \left (2 \operatorname {BesselY}\left (1,\frac {2 \sqrt {a} \sqrt {b} \sqrt {x}}{c r}\right )+c_1 \operatorname {BesselJ}\left (1,\frac {2 \sqrt {a} \sqrt {b} \sqrt {x}}{c r}\right )\right )}{\sqrt {b} \left (2 \operatorname {BesselY}\left (0,\frac {2 \sqrt {a} \sqrt {b} \sqrt {x}}{c r}\right )+c_1 \operatorname {BesselJ}\left (0,\frac {2 \sqrt {a} \sqrt {b} \sqrt {x}}{c r}\right )\right )} \\ y(x)\to \frac {\sqrt {a} \sqrt {x} \operatorname {BesselJ}\left (1,\frac {2 \sqrt {a} \sqrt {b} \sqrt {x}}{c r}\right )}{\sqrt {b} \operatorname {BesselJ}\left (0,\frac {2 \sqrt {a} \sqrt {b} \sqrt {x}}{c r}\right )} \\ \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
c = symbols("c") 
r = symbols("r") 
y = Function("y") 
ode = Eq(c*Derivative(y(x), x) - (a*x + b*y(x)**2)/(r*x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
RecursionError : maximum recursion depth exceeded