23.1.185 problem 185

Internal problem ID [4792]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 1. THE DIFFERENTIAL EQUATION IS OF FIRST ORDER AND OF FIRST DEGREE, page 223
Problem number : 185
Date solved : Tuesday, September 30, 2025 at 08:37:45 AM
CAS classification : [[_homogeneous, `class G`], _rational, _Bernoulli]

\begin{align*} x y^{\prime }+\left (a +b \,x^{n} y\right ) y&=0 \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 29
ode:=x*diff(y(x),x)+(a+b*x^n*y(x))*y(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {a -n}{c_1 \left (a -n \right ) x^{a}-b \,x^{n}} \]
Mathematica. Time used: 0.18 (sec). Leaf size: 36
ode=x*D[y[x],x]+(a+b*x^n*y[x])y[x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {a-n}{-b x^n+c_1 (a-n) x^a}\\ y(x)&\to 0 \end{align*}
Sympy. Time used: 1.158 (sec). Leaf size: 88
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
n = symbols("n") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), x) + (a + b*x**n*y(x))*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \begin {cases} \frac {a}{C_{1} a e^{a \log {\left (x \right )}} - C_{1} n e^{a \log {\left (x \right )}} - b x^{n}} - \frac {n}{C_{1} a e^{a \log {\left (x \right )}} - C_{1} n e^{a \log {\left (x \right )}} - b x^{n}} & \text {for}\: a \neq n \\\frac {1}{C_{1} e^{a \log {\left (x \right )}} + b e^{a \log {\left (x \right )}} \int x^{a - 1} e^{- a \log {\left (x \right )}}\, dx} & \text {otherwise} \end {cases} \]