The first order ODE \[\frac{\dd y}{\dd t}=r\cdot (a-y)\] where \(r\) and \(a\) are a positive constants, can rewritten in differential form as \[\frac{1}{y-a}\,\dd y=-r\,\dd t\tiny.\] the left- and right-hand side can be worked out as \(\dd\bigl(\ln(|y-a|)\bigr)\) and \(\dd(r\, t)\), respectively. So we have the following equality between two differentials: \[\dd\bigl(\ln(|y-a|)\bigr)=\dd(-r\cdot t)\] The functions ‘behind the d's’ are thus equal to each other up to some constant: \[\ln(|y-a|)=-r\cdot t+C\] for some constant \(C\). Thus: \[|y-a| =e^{-r\cdot t+C}=e^C\cdot e^{r\cdot t}=c\cdot e^{-r\cdot t}\] for some constant \(c\gt 0\). Removal of the absolute value brackets leads to the explicit solution (in which we introduce a negative sign in the formula in order to come to the standard definition of the limited exponential function): \[y=a-c\cdot e^{-r\cdot t}\] for some constant \(c\). Nota bene: in natrual sciences it is common practivr to let paramters have postivie values and explicitly write down minus signs, if needed. In other words, we have proven the following theorem:
The general solution of \[\frac{\dd y}{\dd t}=r\cdot \bigl(a-y\bigr)\] where \(r\) and \(a\) are a positive constants, is \[y(t)=a-c\cdot e^{-r\cdot t}\] where \(c\) is a constant.
This result can also be used to solve the following initial value problem of logistic growth \[\frac{dy}{dt}=r\cdot y\cdot \left(1-\frac{y}{a}\right),\quad y(0)=\alpha\] where \(r\) and \(a\) are positive constants and \(-\infty<\alpha<\infty\). The clever trick consists of the introduction of a new variable \(u(t)\) through the relationship \(y=\frac{1}{u}\). Substitution leads to: \[\begin{aligned} \frac{\dd\left(\dfrac{1}{u}\right)}{\dd t} &= r\cdot\left(\dfrac{1}{u}\right)\cdot\left(1-\dfrac{\dfrac{1}{u}}{a}\right) \qquad\phantom{\implies} \\ \\ -\dfrac{1}{u^2}\dfrac{\dd u}{\dd t}&=r\,\frac{1}{u}\left(1-\dfrac{1}{a\,u}\right) \qquad\qquad \;\;\phantom{\implies}\\ \\ \dfrac{\dd u}{\dd t} &= r\cdot\left(\dfrac{1}{a}-u\right)\qquad (\text{after multiplying by }-u^2) \end{aligned}\] The general solution is \[u(t)=\frac{1}{a}+c\cdot e^{-r\cdot t}\] where \(c\) is a constant that can be determined from the initial value \(u(0)=\frac{1}{y(0)}=\frac{1}{\alpha}\).
For \(t=0\) we get: \[\frac{1}{\alpha}=\frac{1}{a}+c\] So: \[\begin{aligned} u(t) &= \frac{1}{a}+\left(\frac{1}{\alpha}-\frac{1}{a}\right)\cdot e^{-r\cdot t}\\ {} &= \frac{1}{a\cdot \alpha}\left(\alpha+(a-\alpha)\cdot e^{-r\cdot t}\right) \end{aligned}\] Thus: \[y(t) = \frac{a\cdot \alpha}{\alpha+(a-\alpha)\cdot e^{-r\cdot t}}\] In other words: \[y(t) = \frac{a}{1+\left(\dfrac{a}{\alpha}-1\right)\cdot e^{-r\cdot t}}\]
So we have proven the following theorem.
The general solution of the initial value problem \[\frac{\dd y}{\dd t}=r\cdot y\cdot \left(1-\frac{y}{a}\right),\quad y(0)=\alpha\] where \(r\) and \(a\) are positive constants and \(-\infty<\alpha<\infty\), is \[y(t) = \frac{a}{1+\left(\dfrac{a}{\alpha}-1\right) e^{-r\cdot t}}\]
By the way, the logistic differential equation can also be solved by separation of variables.