29.11.18 problem 309

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

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

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