15.8.28 problem 29

Internal problem ID [3031]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 12, page 46
Problem number : 29
Date solved : Sunday, March 30, 2025 at 01:11:21 AM
CAS classification : [_separable]

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

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