28.1.117 problem 140

Internal problem ID [4423]
Book : Differential equations for engineers by Wei-Chau XIE, Cambridge Press 2010
Section : Chapter 2. First-Order and Simple Higher-Order Differential Equations. Page 78
Problem number : 140
Date solved : Sunday, March 30, 2025 at 03:21:25 AM
CAS classification : [[_homogeneous, `class D`], _rational, _Bernoulli]

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

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