29.21.12 problem 588

Internal problem ID [5182]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 21
Problem number : 588
Date solved : Tuesday, March 04, 2025 at 08:24:48 PM
CAS classification : [_separable]

\begin{align*} x y \left (b \,x^{2}+a \right ) y^{\prime }&=A +B y^{2} \end{align*}

Maple. Time used: 0.027 (sec). Leaf size: 82
ode:=x*y(x)*(b*x^2+a)*diff(y(x),x) = A+B*y(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y \left (x \right ) &= \frac {\sqrt {-B \left (-x^{\frac {2 B}{a}} \left (b \,x^{2}+a \right )^{-\frac {B}{a}} c_{1} B +A \right )}}{B} \\ y \left (x \right ) &= -\frac {\sqrt {-B \left (-x^{\frac {2 B}{a}} \left (b \,x^{2}+a \right )^{-\frac {B}{a}} c_{1} B +A \right )}}{B} \\ \end{align*}
Mathematica. Time used: 1.966 (sec). Leaf size: 134
ode=x y[x] (a+b x^2)D[y[x],x]==A+B y[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\frac {\sqrt {-A+e^{2 B c_1} x^{\frac {2 B}{a}} \left (a+b x^2\right )^{-\frac {B}{a}}}}{\sqrt {B}} \\ y(x)\to \frac {\sqrt {-A+e^{2 B c_1} x^{\frac {2 B}{a}} \left (a+b x^2\right )^{-\frac {B}{a}}}}{\sqrt {B}} \\ y(x)\to -\frac {i \sqrt {A}}{\sqrt {B}} \\ y(x)\to \frac {i \sqrt {A}}{\sqrt {B}} \\ \end{align*}
Sympy. Time used: 2.903 (sec). Leaf size: 63
from sympy import * 
x = symbols("x") 
A = symbols("A") 
B = symbols("B") 
a = symbols("a") 
b = symbols("b") 
y = Function("y") 
ode = Eq(-A - B*y(x)**2 + x*(a + b*x**2)*y(x)*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = \sqrt {\frac {- A + e^{B \left (C_{1} + \frac {2 \log {\left (x \right )}}{a} - \frac {\log {\left (\frac {a}{b} + x^{2} \right )}}{a}\right )}}{B}}, \ y{\left (x \right )} = - \sqrt {\frac {- A + e^{B \left (C_{1} + \frac {2 \log {\left (x \right )}}{a} - \frac {\log {\left (\frac {a}{b} + x^{2} \right )}}{a}\right )}}{B}}\right ] \]