29.15.16 problem 424

Internal problem ID [5022]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 15
Problem number : 424
Date solved : Sunday, March 30, 2025 at 06:30:20 AM
CAS classification : [_rational, _Bernoulli]

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

Maple. Time used: 0.005 (sec). Leaf size: 61
ode:=y(x)*diff(y(x),x) = a*x+b*y(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= -\frac {\sqrt {4 \,{\mathrm e}^{2 b x} c_1 \,b^{2}-4 a x b -2 a}}{2 b} \\ y &= \frac {\sqrt {4 \,{\mathrm e}^{2 b x} c_1 \,b^{2}-4 a x b -2 a}}{2 b} \\ \end{align*}
Mathematica. Time used: 13.67 (sec). Leaf size: 77
ode=y[x] D[y[x],x]==a x+b y[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\frac {i \sqrt {a \left (b x+\frac {1}{2}\right )-b^2 c_1 e^{2 b x}}}{b} \\ y(x)\to \frac {i \sqrt {a \left (b x+\frac {1}{2}\right )-b^2 c_1 e^{2 b x}}}{b} \\ \end{align*}
Sympy. Time used: 1.403 (sec). Leaf size: 116
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
y = Function("y") 
ode = Eq(-a*x - b*y(x)**2 + y(x)*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = \begin {cases} - \frac {\sqrt {4 C_{1} e^{2 b x} - \frac {4 a x}{b} - \frac {2 a}{b^{2}}}}{2} & \text {for}\: b > 0 \vee b < 0 \\- \sqrt {C_{1} e^{2 b x} + a x^{2} e^{2 b x}} & \text {otherwise} \end {cases}, \ y{\left (x \right )} = \begin {cases} \frac {\sqrt {4 C_{1} e^{2 b x} - \frac {4 a x}{b} - \frac {2 a}{b^{2}}}}{2} & \text {for}\: b > 0 \vee b < 0 \\\sqrt {C_{1} e^{2 b x} + a x^{2} e^{2 b x}} & \text {otherwise} \end {cases}\right ] \]