23.1.166 problem 166

Internal problem ID [4773]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 1. THE DIFFERENTIAL EQUATION IS OF FIRST ORDER AND OF FIRST DEGREE, page 223
Problem number : 166
Date solved : Tuesday, September 30, 2025 at 08:31:04 AM
CAS classification : [_rational, _Riccati]

\begin{align*} x y^{\prime }+x^{2}+y^{2}&=0 \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 27
ode:=x*diff(y(x),x)+x^2+y(x)^2 = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {\left (c_1 \operatorname {BesselY}\left (1, x\right )+\operatorname {BesselJ}\left (1, x\right )\right ) x}{c_1 \operatorname {BesselY}\left (0, x\right )+\operatorname {BesselJ}\left (0, x\right )} \]
Mathematica. Time used: 0.112 (sec). Leaf size: 45
ode=x*D[y[x],x]+x^2+y[x]^2==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {x (\operatorname {BesselY}(1,x)+c_1 \operatorname {BesselJ}(1,x))}{\operatorname {BesselY}(0,x)+c_1 \operatorname {BesselJ}(0,x)}\\ y(x)&\to -\frac {x \operatorname {BesselJ}(1,x)}{\operatorname {BesselJ}(0,x)} \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2 + x*Derivative(y(x), x) + y(x)**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
TypeError : bad operand type for unary -: list