21.2.1 problem 1

Internal problem ID [4301]
Book : An introduction to the solution and applications of differential equations, J.W. Searl, 1966
Section : Chapter 4, Ex. 4.2
Problem number : 1
Date solved : Tuesday, September 30, 2025 at 07:16:41 AM
CAS classification : [_separable]

\begin{align*} x^{2} \left (1+y^{2}\right ) y^{\prime }+y^{2} \left (x^{2}+1\right )&=0 \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 93
ode:=x^2*(1+y(x)^2)*diff(y(x),x)+y(x)^2*(x^2+1) = 0; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= \frac {-x^{2}-c_1 x +\sqrt {1+x^{4}+2 c_1 \,x^{3}+\left (c_1^{2}+2\right ) x^{2}-2 c_1 x}+1}{2 x} \\ y &= \frac {-x^{2}-c_1 x -\sqrt {1+x^{4}+2 c_1 \,x^{3}+\left (c_1^{2}+2\right ) x^{2}-2 c_1 x}+1}{2 x} \\ \end{align*}
Mathematica. Time used: 0.651 (sec). Leaf size: 95
ode=x^2*(1+y[x]^2)*D[y[x],x]+y[x]^2*(x^2+1)==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {x^2+\sqrt {4 x^2+\left (-x^2+c_1 x+1\right ){}^2}-c_1 x-1}{2 x}\\ y(x)&\to \frac {-x^2+\sqrt {4 x^2+\left (-x^2+c_1 x+1\right ){}^2}+c_1 x+1}{2 x}\\ y(x)&\to 0 \end{align*}
Sympy. Time used: 0.483 (sec). Leaf size: 99
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*(y(x)**2 + 1)*Derivative(y(x), x) + (x**2 + 1)*y(x)**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = \frac {C_{1}}{2} - \frac {x}{2} - \frac {\sqrt {C_{1}^{2} x^{2} - 2 C_{1} x^{3} + 2 C_{1} x + x^{4} + 2 x^{2} + 1}}{2 x} + \frac {1}{2 x}, \ y{\left (x \right )} = \frac {C_{1}}{2} - \frac {x}{2} + \frac {\sqrt {C_{1}^{2} x^{2} - 2 C_{1} x^{3} + 2 C_{1} x + x^{4} + 2 x^{2} + 1}}{2 x} + \frac {1}{2 x}\right ] \]