40.2.15 problem 40

Internal problem ID [6593]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 4. Equations of first order and first degree (Variable separable). Supplemetary problems. Page 22
Problem number : 40
Date solved : Sunday, March 30, 2025 at 11:11:08 AM
CAS classification : [_separable]

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

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