20.4.13 problem Problem 21

Internal problem ID [3648]
Book : Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section : Chapter 1, First-Order Differential Equations. Section 1.8, Change of Variables. page 79
Problem number : Problem 21
Date solved : Tuesday, March 04, 2025 at 04:59:32 PM
CAS classification : [[_homogeneous, `class A`], _rational, [_Abel, `2nd type`, `class B`]]

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

Maple. Time used: 0.021 (sec). Leaf size: 19
ode:=2*x*(y(x)+2*x)*diff(y(x),x) = y(x)*(4*x-y(x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \frac {2 x}{\operatorname {LambertW}\left (2 \,{\mathrm e}^{\frac {3 c_{1}}{2}} x^{{3}/{2}}\right )} \]
Mathematica. Time used: 4.985 (sec). Leaf size: 29
ode=2*x*(y[x]+2*x)*D[y[x],x]==y[x]*(4*x-y[x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {2 x}{W\left (2 e^{-c_1} x^{3/2}\right )} \\ y(x)\to 0 \\ \end{align*}
Sympy. Time used: 3.544 (sec). Leaf size: 49
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x*(2*x + y(x))*Derivative(y(x), x) - (4*x - y(x))*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = \frac {e^{C_{1} + W\left (- 2 \sqrt {x^{3}} e^{- C_{1}}\right )}}{\sqrt {x}}, \ y{\left (x \right )} = \frac {e^{C_{1} + W\left (2 \sqrt {x^{3}} e^{- C_{1}}\right )}}{\sqrt {x}}\right ] \]