29.9.21 problem 261

Internal problem ID [4861]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 9
Problem number : 261
Date solved : Sunday, March 30, 2025 at 04:04:44 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.003 (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.186 (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.467 (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} \]