10.2.29 problem 29

Internal problem ID [1157]
Book : Elementary differential equations and boundary value problems, 10th ed., Boyce and DiPrima
Section : Section 2.2. Page 48
Problem number : 29
Date solved : Tuesday, March 04, 2025 at 12:13:05 PM
CAS classification : [_quadrature]

\begin{align*} y^{\prime }&=\frac {b +a y}{d +c y} \end{align*}

Maple. Time used: 0.011 (sec). Leaf size: 61
ode:=diff(y(x),x) = (b+a*y(x))/(d+c*y(x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (a d -b c \right ) \operatorname {LambertW}\left (\frac {c \,{\mathrm e}^{\frac {\left (x +c_1 \right ) a^{2}+b c}{a d -b c}}}{a d -b c}\right )-b c}{c a} \]
Mathematica. Time used: 12.786 (sec). Leaf size: 83
ode=D[y[x],x] == (b+a*y[x])/(d+c*y[x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {-b c+(a d-b c) W\left (-\frac {c \left (e^{-1-\frac {a^2 (x+c_1)}{b c}}\right ){}^{\frac {b c}{b c-a d}}}{b c-a d}\right )}{a c} \\ y(x)\to -\frac {b}{a} \\ \end{align*}
Sympy. Time used: 1.536 (sec). Leaf size: 76
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
c = symbols("c") 
d = symbols("d") 
y = Function("y") 
ode = Eq((-a*y(x) - b)/(c*y(x) + d) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {d W\left (\frac {c e^{\frac {C_{1} a^{2} + a^{2} x + b c}{a d - b c}}}{a d - b c}\right )}{c} - \frac {b W\left (\frac {c e^{\frac {C_{1} a^{2} + a^{2} x + b c}{a d - b c}}}{a d - b c}\right )}{a} - \frac {b}{a} \]