Solution (source code)

= Solution

Separate variables away from the equilibrium solutions. Partial fractions give
$$
\frac1{a-b}\ln\left|\frac{y-a}{y-b}\right|=-x+C,\qquad\frac{y-a}{y-b}=K e^{(b-a)x}.
$$
Thus the <constant-coefficient Riccati equation> has real solution family
$$
\boxed{y=\frac{a e^{ax}-bK e^{bx}}{e^{ax}-K e^{bx}},\quad K\in\mathbb R,\qquad\text{together with }y=b,}
$$
on intervals where the denominator is nonzero. The value $K=0$ includes $y=a$. Setting $K=e^{(b-a)c}$ recovers the printed expression after factoring out $e^{ac}$. For real $c$ that substitution covers positive $K$ only; negative $K$ gives additional real branches between the equilibria, and the constant solutions must not be discarded when separating variables.