44.5.20 problem 20

Internal problem ID [7082]
Book : A First Course in Differential Equations with Modeling Applications by Dennis G. Zill. 12 ed. Metric version. 2024. Cengage learning.
Section : Chapter 2. First order differential equations. Section 2.2 Separable equations. Exercises 2.2 at page 53
Problem number : 20
Date solved : Sunday, March 30, 2025 at 11:38:51 AM
CAS classification : [_separable]

\begin{align*} y^{\prime }&=\frac {x y+2 y-x -2}{x y-3 y+x -3} \end{align*}

Maple. Time used: 0.019 (sec). Leaf size: 25
ode:=diff(y(x),x) = (x*y(x)+2*y(x)-x-2)/(x*y(x)-3*y(x)+x-3); 
dsolve(ode,y(x), singsol=all);
 
\[ y = 2 \operatorname {LambertW}\left (\frac {\left (x -3\right )^{{5}/{2}} {\mathrm e}^{\frac {x}{2}-\frac {1}{2}+\frac {c_1}{2}}}{2}\right )+1 \]
Mathematica. Time used: 60.041 (sec). Leaf size: 61
ode=D[y[x],x]==(x*y[x]+2*y[x]-x-2)/(x*y[x]-3*y[x]+x-3); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to 1+2 W\left (-\frac {1}{2} \sqrt {(x-3)^5 e^{x-1+c_1}}\right ) \\ y(x)\to 1+2 W\left (\frac {1}{2} \sqrt {(x-3)^5 e^{x-1+c_1}}\right ) \\ \end{align*}
Sympy. Time used: 2.786 (sec). Leaf size: 87
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((-x*y(x) + x - 2*y(x) + 2)/(x*y(x) + x - 3*y(x) - 3) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = 2 W\left (- \frac {\sqrt {C_{1} \left (x^{5} - 15 x^{4} + 90 x^{3} - 270 x^{2} + 405 x - 243\right ) e^{x - 1}}}{2}\right ) + 1, \ y{\left (x \right )} = 2 W\left (\frac {\sqrt {C_{1} \left (x^{5} - 15 x^{4} + 90 x^{3} - 270 x^{2} + 405 x - 243\right ) e^{x - 1}}}{2}\right ) + 1\right ] \]