\[ y'(x)-(A y(x)-a) (B y(x)-b)=0 \] ✓ Mathematica : cpu = 0.193939 (sec), leaf count = 68
DSolve[-((-a + A*y[x])*(-b + B*y[x])) + Derivative[1][y][x] == 0,y[x],x]
\[\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.277 (sec), leaf count = 45
dsolve(diff(y(x),x)-(A*y(x)-a)*(B*y(x)-b) = 0,y(x))
\[y \left (x \right ) = \frac {{\mathrm e}^{\left (x +c_{1}\right ) \left (A b -B a \right )} a -b}{A \,{\mathrm e}^{\left (x +c_{1}\right ) \left (A b -B a \right )}-B}\]
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 first 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 coefficient. 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 ) }\]
Verification
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