51.1.23 problem 23

Internal problem ID [10293]
Book : First order enumerated odes
Section : section 1
Problem number : 23
Date solved : Tuesday, September 30, 2025 at 07:18:21 PM
CAS classification : [_rational, _Bernoulli]

\begin{align*} c y^{\prime }&=\frac {a x +b y^{2}}{y} \end{align*}
Maple. Time used: 0.006 (sec). Leaf size: 69
ode:=c*diff(y(x),x) = (a*x+b*y(x)^2)/y(x); 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= -\frac {\sqrt {4 \,{\mathrm e}^{\frac {2 b x}{c}} c_1 \,b^{2}-4 a x b -2 a c}}{2 b} \\ y &= \frac {\sqrt {4 \,{\mathrm e}^{\frac {2 b x}{c}} c_1 \,b^{2}-4 a x b -2 a c}}{2 b} \\ \end{align*}
Mathematica. Time used: 0.187 (sec). Leaf size: 94
ode=c*D[y[x],x]==(a*x+b*y[x]^2)/y[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -e^{\frac {b x}{c}} \sqrt {2 \int _1^x\frac {a e^{-\frac {2 b K[1]}{c}} K[1]}{c}dK[1]+c_1}\\ y(x)&\to e^{\frac {b x}{c}} \sqrt {2 \int _1^x\frac {a e^{-\frac {2 b K[1]}{c}} K[1]}{c}dK[1]+c_1} \end{align*}
Sympy. Time used: 1.088 (sec). Leaf size: 139
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
c = symbols("c") 
y = Function("y") 
ode = Eq(c*Derivative(y(x), x) - (a*x + b*y(x)**2)/y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = \begin {cases} - \frac {\sqrt {2} \sqrt {2 C_{1} e^{\frac {2 b x}{c}} - \frac {2 a x}{b} - \frac {a c}{b^{2}}}}{2} & \text {for}\: b > 0 \vee b < 0 \\- \sqrt {C_{1} e^{\frac {2 b x}{c}} + \frac {a x^{2} e^{\frac {2 b x}{c}}}{c}} & \text {otherwise} \end {cases}, \ y{\left (x \right )} = \begin {cases} \frac {\sqrt {2} \sqrt {2 C_{1} e^{\frac {2 b x}{c}} - \frac {2 a x}{b} - \frac {a c}{b^{2}}}}{2} & \text {for}\: b > 0 \vee b < 0 \\\sqrt {C_{1} e^{\frac {2 b x}{c}} + \frac {a x^{2} e^{\frac {2 b x}{c}}}{c}} & \text {otherwise} \end {cases}\right ] \]