29.19.5 problem 518

Internal problem ID [5114]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 19
Problem number : 518
Date solved : Sunday, March 30, 2025 at 06:41:19 AM
CAS classification : [_separable]

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

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