29.25.22 problem 719

Internal problem ID [5309]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 25
Problem number : 719
Date solved : Sunday, March 30, 2025 at 07:53:21 AM
CAS classification : [[_homogeneous, `class G`], _rational]

\begin{align*} x \left (a +x y^{n}\right ) y^{\prime }+b y&=0 \end{align*}

Maple. Time used: 0.083 (sec). Leaf size: 38
ode:=x*(a+x*y(x)^n)*diff(y(x),x)+b*y(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ \left (y^{n}\right )^{-a} \left (x y^{n}-b n +a \right )^{b n} x^{-b n}-c_1 = 0 \]
Mathematica. Time used: 0.285 (sec). Leaf size: 61
ode=x(a+x y[x]^n)D[y[x],x]+b y[x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [-\frac {a n \log (a y(x)-b n y(x))}{a-b n}-\frac {b n \left (\log (x)-\log \left (a-b n+x y(x)^n\right )\right )}{a-b n}=c_1,y(x)\right ] \]
Sympy. Time used: 3.636 (sec). Leaf size: 83
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
n = symbols("n") 
y = Function("y") 
ode = Eq(b*y(x) + x*(a + x*y(x)**n)*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ C_{1} - \frac {e^{- \frac {a \log {\left (y{\left (x \right )} \right )}}{b}}}{x} + \frac {\begin {cases} - \frac {b y{\left (x \right )} y^{n - 1}{\left (x \right )}}{a e^{\frac {a \log {\left (y{\left (x \right )} \right )}}{b}} - b n e^{\frac {a \log {\left (y{\left (x \right )} \right )}}{b}}} & \text {for}\: n \neq \frac {a}{b} \\\begin {cases} 0 & \text {for}\: \frac {1}{\left |{y{\left (x \right )}}\right |} < 1 \vee \left |{y{\left (x \right )}}\right | < 1 \\{G_{2, 2}^{1, 1}\left (\begin {matrix} 0 & 1 \\0 & -1 \end {matrix} \middle | {y{\left (x \right )}} \right )} + {G_{2, 2}^{0, 2}\left (\begin {matrix} 0, 1 & \\ & -1, 0 \end {matrix} \middle | {y{\left (x \right )}} \right )} & \text {otherwise} \end {cases} & \text {otherwise} \end {cases}}{b} = 0 \]