29.7.13 problem 188

Internal problem ID [4788]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 7
Problem number : 188
Date solved : Sunday, March 30, 2025 at 03:54:44 AM
CAS classification : [[_homogeneous, `class G`], _rational, _Bernoulli]

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

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