29.19.1 problem 514

Internal problem ID [5110]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 19
Problem number : 514
Date solved : Tuesday, March 04, 2025 at 07:58:51 PM
CAS classification : [_separable]

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

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