8.5.5 problem 5

Internal problem ID [733]
Book : Differential equations and linear algebra, 3rd ed., Edwards and Penney
Section : Section 1.6, Substitution methods and exact equations. Page 74
Problem number : 5
Date solved : Tuesday, March 04, 2025 at 11:35:27 AM
CAS classification : [[_homogeneous, `class A`], _rational, [_Abel, `2nd type`, `class B`]]

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

Maple. Time used: 0.011 (sec). Leaf size: 14
ode:=x*(x+y(x))*diff(y(x),x) = y(x)*(x-y(x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {x}{\operatorname {LambertW}\left (c_1 \,x^{2}\right )} \]
Mathematica. Time used: 4.04 (sec). Leaf size: 25
ode=x*(x+y[x])*D[y[x],x] == y[x]*(x-y[x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {x}{W\left (e^{-c_1} x^2\right )} \\ y(x)\to 0 \\ \end{align*}
Sympy. Time used: 1.097 (sec). Leaf size: 15
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*(x + y(x))*Derivative(y(x), x) - (x - y(x))*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {e^{C_{1} + W\left (x^{2} e^{- C_{1}}\right )}}{x} \]