29.12.28 problem 347

Internal problem ID [4947]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 12
Problem number : 347
Date solved : Sunday, March 30, 2025 at 04:17:35 AM
CAS classification : [[_homogeneous, `class D`], _rational, _Riccati]

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

Maple. Time used: 0.004 (sec). Leaf size: 17
ode:=x^3*diff(y(x),x) = x^2*(-1+y(x))+y(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\tanh \left (\frac {c_1 x -1}{x}\right ) x \]
Mathematica. Time used: 0.769 (sec). Leaf size: 51
ode=x^3 D[y[x],x]==x^2(y[x]-1)+y[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {x \left (e^{2/x}-e^{2 c_1}\right )}{e^{2/x}+e^{2 c_1}} \\ y(x)\to -x \\ y(x)\to x \\ \end{align*}
Sympy. Time used: 0.321 (sec). Leaf size: 20
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**3*Derivative(y(x), x) - x**2*(y(x) - 1) - y(x)**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x \left (C_{1} e^{\frac {2}{x}} + 1\right )}{C_{1} e^{\frac {2}{x}} - 1} \]