15.8.5 problem 5

Internal problem ID [3008]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 12, page 46
Problem number : 5
Date solved : Sunday, March 30, 2025 at 01:05:39 AM
CAS classification : [[_homogeneous, `class C`], _rational, [_Abel, `2nd type`, `class A`]]

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

Maple. Time used: 0.077 (sec). Leaf size: 28
ode:=x-2*y(x)+1+(y(x)-2)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (x -1\right ) \operatorname {LambertW}\left (-c_1 \left (x -3\right )\right )+x -3}{\operatorname {LambertW}\left (-c_1 \left (x -3\right )\right )} \]
Mathematica. Time used: 0.88 (sec). Leaf size: 135
ode=(x-2*y[x]+1)+(y[x]-2)*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [\frac {2^{2/3} \left (x \log \left (\frac {x-3}{y(x)-2}\right )-\log \left (\frac {3 (x-3)}{y(x)-2}\right )-x \log \left (\frac {y(x)-x+1}{y(x)-2}\right )+\log \left (\frac {y(x)-x+1}{y(x)-2}\right )+y(x) \left (-\log \left (\frac {x-3}{y(x)-2}\right )+\log \left (\frac {y(x)-x+1}{y(x)-2}\right )-1\right )+2+\log (3)\right )}{9 (-y(x)+x-1)}=\frac {1}{9} 2^{2/3} \log (x-3)+c_1,y(x)\right ] \]
Sympy. Time used: 0.997 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x + (y(x) - 2)*Derivative(y(x), x) - 2*y(x) + 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x + e^{C_{1} + W\left (\left (x - 3\right ) e^{- C_{1}}\right )} - 1 \]