23.1.270 problem 264

Internal problem ID [4877]
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 : 264
Date solved : Tuesday, September 30, 2025 at 08:46:03 AM
CAS classification : [[_homogeneous, `class A`], _rational, _Bernoulli]

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