22.1.4 problem 4

Internal problem ID [4090]
Book : Applied Differential equations, Newby Curle. Van Nostrand Reinhold. 1972
Section : Examples, page 35
Problem number : 4
Date solved : Tuesday, March 04, 2025 at 05:25:27 PM
CAS classification : [[_homogeneous, `class C`], _rational, _Riccati]

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

Maple. Time used: 0.020 (sec). Leaf size: 15
ode:=x^2*diff(y(x),x) = x*(-1+y(x))+(-1+y(x))^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = 1-\frac {x}{\ln \left (x \right )+c_{1}} \]
Mathematica. Time used: 0.206 (sec). Leaf size: 23
ode=x^2*D[y[x],x]==x*(y[x]-1)+(y[x]-1)^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to 1+\frac {x}{-\log (x)+c_1} \\ y(x)\to 1 \\ \end{align*}
Sympy. Time used: 0.313 (sec). Leaf size: 8
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*Derivative(y(x), x) - x*(y(x) - 1) - (y(x) - 1)**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = 1 - 8 x^{3} \]