76.1.37 problem 37

Internal problem ID [17265]
Book : Differential equations. An introduction to modern methods and applications. James Brannan, William E. Boyce. Third edition. Wiley 2015
Section : Chapter 2. First order differential equations. Section 2.1 (Separable equations). Problems at page 44
Problem number : 37
Date solved : Monday, March 31, 2025 at 03:47:59 PM
CAS classification : [_quadrature]

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

Maple. Time used: 0.055 (sec). Leaf size: 61
ode:=diff(y(x),x) = (a*y(x)+b)/(c*y(x)+d); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (a d -b c \right ) \operatorname {LambertW}\left (\frac {c \,{\mathrm e}^{\frac {a^{2} \left (c_1 +x \right )+b c}{a d -b c}}}{a d -b c}\right )-b c}{a c} \]
Mathematica. Time used: 0.156 (sec). Leaf size: 44
ode=D[y[x],x]==(a*y[x]+b)/(c*y[x]+d); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \text {InverseFunction}\left [\int _1^{\text {$\#$1}}\frac {d+c K[1]}{b+a K[1]}dK[1]\&\right ][x+c_1] \\ y(x)\to -\frac {b}{a} \\ \end{align*}
Sympy. Time used: 1.435 (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} \]