I need help solving for $P(t)$.
$$\frac{dP}{dt} = k(M-P)P$$
This is a question related to population. I'm not the best at math and any help would be appreciated.
I need help solving for $P(t)$.
$$\frac{dP}{dt} = k(M-P)P$$
This is a question related to population. I'm not the best at math and any help would be appreciated.
To begin with, rearrange the given ODE in the following way
\begin{align*} P^{\prime} = k(M-P)P \Longleftrightarrow \frac{P^{\prime}}{(M-P)P} = k \end{align*}
Then you have \begin{align*} \frac{1}{(M-P)P} = \frac{1}{M}\times\frac{M - P + P}{(M-P)P} = \frac{1}{M}\times\left(\frac{1}{P} + \frac{1}{M-P}\right) \end{align*}
Consequently, we obtain the desired solution \begin{align*} \frac{1}{M}\int\left(\frac{P^{\prime}}{P} + \frac{P^{\prime}}{M-P}\right)\mathrm{d}t = \frac{1}{M}\left(\ln|P| - \ln|P-M|\right) = kt + c = \int k\mathrm{d}t \end{align*}
The ODE is a Bernoulli ODE: $$\frac{dP}{dt}-kMP=KP^2=0 \Rightarrow \frac{1}{P^2}\frac{dP}{dt}-\frac{kM}{P}=k.$$ Let $1/P=y$, then the ODE is $$\frac{dy}{dt}+kMy=-k.$$ This is liear ODE whose integrating factor is $e^{kMt}.$ Hence its solution is $$y=-e^{-kMt} \int k e^{kMt} dt + C e^{-kMt} \Rightarrow y=-\frac{1}{M}+ C e^{kMt} \Rightarrow \frac{1}{P}=-\frac{1}{M}+Ce^{-kMt}.$$
WLOG, $M=1$ and $k=1$ (normalize $P$ and $t$). The equation is separable. We assume $0\le P\le 1$.
$$\int_{P_0}^P\frac{dP}{(1-P)P}=\left.\log\frac P{1-P}\right|_{P_0}^P=t$$
and from this
$$P=\frac{P_0e^t}{P_0(e^t-1)+1}=1-\frac{1-P_0}{P_0(e^t-1)+1}.$$
Note that $P=0$ and $P=1$ are also solutions.
A few of them: