38.5.20 problem 20

Internal problem ID [8368]
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 : Tuesday, September 30, 2025 at 05:30:15 PM
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: 0.102 (sec). Leaf size: 52
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 \text {InverseFunction}\left [\int _1^{\text {$\#$1}}\frac {K[1]+1}{K[1]-1}dK[1]\&\right ]\left [\int _1^x\frac {K[2]+2}{K[2]-3}dK[2]+c_1\right ]\\ y(x)&\to 1 \end{align*}
Sympy. Time used: 1.718 (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 ] \]