29.9.11 problem 251

Internal problem ID [4851]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 9
Problem number : 251
Date solved : Sunday, March 30, 2025 at 04:04:15 AM
CAS classification : [_linear]

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

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