29.9.9 problem 249

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

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

Maple. Time used: 0.001 (sec). Leaf size: 12
ode:=x^2*diff(y(x),x) = -y(x)+a; 
dsolve(ode,y(x), singsol=all);
 
\[ y = a +{\mathrm e}^{\frac {1}{x}} c_1 \]
Mathematica. Time used: 0.028 (sec). Leaf size: 20
ode=x^2 D[y[x],x]==a-y[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to a+c_1 e^{\frac {1}{x}} \\ y(x)\to a \\ \end{align*}
Sympy. Time used: 0.288 (sec). Leaf size: 10
from sympy import * 
x = symbols("x") 
a = symbols("a") 
y = Function("y") 
ode = Eq(-a + x**2*Derivative(y(x), x) + y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{\frac {1}{x}} + a \]