40.4.6 problem 19 (g)

Internal problem ID [6646]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 6. Equations of first order and first degree (Linear equations). Supplemetary problems. Page 39
Problem number : 19 (g)
Date solved : Sunday, March 30, 2025 at 11:13:20 AM
CAS classification : [_rational, [_1st_order, `_with_symmetry_[F(x)*G(y),0]`], [_Abel, `2nd type`, `class B`]]

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

Maple. Time used: 0.011 (sec). Leaf size: 30
ode:=y(x)+(x*y(x)+x-3*y(x))*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \operatorname {LambertW}\left (\frac {{\mathrm e}^{\frac {3}{x -3}}}{c_1 \left (x -3\right )}\right )-\frac {3}{x -3} \]
Mathematica. Time used: 60.046 (sec). Leaf size: 31
ode=y[x]+(x*y[x]+x-3*y[x])*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -\frac {3}{x-3}+W\left (\frac {c_1 e^{\frac {3}{x-3}}}{x-3}\right ) \]
Sympy. Time used: 1.535 (sec). Leaf size: 27
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x*y(x) + x - 3*y(x))*Derivative(y(x), x) + y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {\left (x - 3\right ) W\left (\frac {e^{\frac {C_{1} \left (x - 3\right ) + 3}{x - 3}}}{x - 3}\right ) - 3}{x - 3} \]