29.9.13 problem 253

Internal problem ID [4853]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 9
Problem number : 253
Date solved : Tuesday, March 04, 2025 at 07:22:55 PM
CAS classification : [_linear]

\begin{align*} x^{2} y^{\prime }&=a +b x y \end{align*}

Maple. Time used: 0.001 (sec). Leaf size: 21
ode:=x^2*diff(y(x),x) = a+b*x*y(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = -\frac {a}{\left (b +1\right ) x}+x^{b} c_{1} \]
Mathematica. Time used: 0.041 (sec). Leaf size: 22
ode=x^2 D[y[x],x]==a+b x y[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -\frac {a}{b x+x}+c_1 x^b \]
Sympy. Time used: 0.416 (sec). Leaf size: 22
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
y = Function("y") 
ode = Eq(-a - b*x*y(x) + x**2*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1} x \left (b + 1\right ) e^{b \log {\left (x \right )}} - a}{x \left (b + 1\right )} \]