29.11.16 problem 307

Internal problem ID [4907]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 11
Problem number : 307
Date solved : Sunday, March 30, 2025 at 04:10:19 AM
CAS classification : [_rational, _Bernoulli]

\begin{align*} \left (a^{2}+x^{2}\right ) y^{\prime }+\left (x -y\right ) y&=0 \end{align*}

Maple. Time used: 0.002 (sec). Leaf size: 28
ode:=(a^2+x^2)*diff(y(x),x)+(x-y(x))*y(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {a^{2}}{\sqrt {a^{2}+x^{2}}\, c_1 \,a^{2}-x} \]
Mathematica. Time used: 0.282 (sec). Leaf size: 37
ode=(x^2+a^2)D[y[x],x]+(x-y[x])y[x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {a^2}{-x+a^2 c_1 \sqrt {a^2+x^2}} \\ y(x)\to 0 \\ \end{align*}
Sympy. Time used: 0.540 (sec). Leaf size: 46
from sympy import * 
x = symbols("x") 
a = symbols("a") 
y = Function("y") 
ode = Eq((a**2 + x**2)*Derivative(y(x), x) + (x - y(x))*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {a^{3} \sqrt {1 + \frac {x^{2}}{a^{2}}}}{\sqrt {a^{2} + x^{2}} \left (C_{1} a^{3} \sqrt {1 + \frac {x^{2}}{a^{2}}} - x\right )} \]