29.6.9 problem 155

Internal problem ID [4755]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 6
Problem number : 155
Date solved : Sunday, March 30, 2025 at 03:52:56 AM
CAS classification : [_linear]

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

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