#### 2.26   ODE No. 26

$y'(x)-(A y(x)-a) (B y(x)-b)=0$ Mathematica : cpu = 0.185805 (sec), leaf count = 68

$\left \{\left \{y(x)\to \frac {a e^{A b x+A b c_1}-b e^{a B x+a B c_1}}{A e^{A b x+A b c_1}-B e^{a B x+a B c_1}}\right \}\right \}$ Maple : cpu = 0.064 (sec), leaf count = 45

$\left \{ y \left ( x \right ) ={\frac {{{\rm e}^{ \left ( x+{\it \_C1} \right ) \left ( Ab-aB \right ) }}a-b}{A{{\rm e}^{ \left ( x+{\it \_C1} \right ) \left ( Ab-aB \right ) }}-B}} \right \}$

Hand solution

\begin {align} y^{\prime }-\left ( Ay-a\right ) \left ( By-b\right ) & =0\nonumber \\ y^{\prime } & =\left ( Ay-a\right ) \left ( By-b\right ) \nonumber \\ & =ab-y\left ( Ab+Ba\right ) +ABy^{2}\tag {1} \end {align}

This is Riccati ﬁrst order non-linear ODE with $$P\left ( x\right ) =ab,Q\left ( x\right ) =-\left ( Ab+Ba\right ) ,R\left ( x\right ) =AB$$. Let $$y=-\frac {u^{\prime }}{uR\left ( x\right ) }=-\frac {u^{\prime }}{ABu}$$, hence

$y^{\prime }=\frac {-u^{\prime \prime }}{ABu}-\frac {\left ( u^{\prime }\right ) ^{2}}{ABu^{2}}$

Comparing to (1) results in

\begin {align*} \frac {-u^{\prime \prime }}{ABu}-\frac {\left ( u^{\prime }\right ) ^{2}}{ABu^{2}} & =ab-y\left ( Ab+Ba\right ) +ABy^{2}\\ & =ab-\left ( -\frac {u^{\prime }}{ABu}\right ) \left ( Ab+Ba\right ) +AB\left ( -\frac {u^{\prime }}{ABu}\right ) ^{2}\\ & =ab+\frac {u^{\prime }}{ABu}\left ( Ab+Ba\right ) +AB\frac {\left ( u^{\prime }\right ) ^{2}}{\left ( ABu\right ) ^{2}}\\ & =ab+\frac {u^{\prime }}{ABu}\left ( Ab+Ba\right ) +\frac {\left ( u^{\prime }\right ) ^{2}}{ABu^{2}} \end {align*}

Hence

\begin {align*} \frac {-u^{\prime \prime }}{ABu} & =ab+\frac {u^{\prime }}{ABu}\left ( Ab+Ba\right ) \\ -u^{\prime \prime } & =ABabu+u^{\prime }\left ( Ab+Ba\right ) \\ u^{\prime \prime }+u^{\prime }\left ( Ab+Ba\right ) +u\left ( ABab\right ) & =0 \end {align*}

This is second order ODE with constant coeﬃcient. Solution is

$u=c_{1}e^{-aBx}+c_{2}e^{-Abx}$

Therefore

$u^{\prime }=-aBc_{1}e^{-aBx}-c_{2}Abe^{-Abx}$

And therefore the solution is

\begin {align*} y & =-\frac {u^{\prime }}{ABu}=-\frac {1}{AB}\frac {-aBc_{1}e^{-aBx}-c_{2}Abe^{-Abx}}{c_{1}e^{-aBx}+c_{2}e^{-Abx}}\\ & =\frac {aBc_{1}e^{-aBx}+c_{2}Abe^{-Abx}}{AB\left ( c_{1}e^{-aBx}+c_{2}e^{-Abx}\right ) } \end {align*}

Dividing by $$c_{2}$$ and letting $$c=\frac {c_{1}}{c_{2}}$$

$y=\frac {aBce^{-aBx}+Abe^{-Abx}}{AB\left ( ce^{-aBx}+e^{-Abx}\right ) }$

Veriﬁcation

eq:=diff(y(x),x)-(A*y(x)-a)*(B*y(x)-b) = 0;
sol:=(a*B*_C1*exp(-a*B*x)+A*b*exp(-A*b*x))/(A*B*(_C1*exp(-a*B*x)+exp(-A*b*x)));
odetest(y(x)=sol,eq);
0