Solve the initial value problem
$$\frac{dP}{dt}=P \left( 1-\frac{P}{K} \right)$$
With $P(0)=P_0$
(Here, $K$ and $P_1 $are real constants).
My attempt:
Now to answer this question I did separation of variables and ended up getting: (note I also did partial fractions to simplify the initially attained integral).
$$\int\frac{1}{P}+\frac{1}{K-P}\,dp = \int 1 \, dt$$
$$\ln \lvert P \rvert - \ln\lvert K - P \rvert = t + c$$
Then at this conditions I found:
$$c = \ln \lvert P_0 \rvert - \ln \lvert k - P_0 \rvert$$
Giving:
$$\ln \lvert P \rvert - \ln\lvert K - P \rvert = t + \ln \lvert P_0 \rvert - \ln \lvert k - P_0 \rvert$$
Can someone validate this? Or perhaps knows an alternative method?
Can someone check my given answer?
Separation of variables yields $$ dt = \frac{dP}{P\left(1- \frac P K \right)}. $$
Then use partial fractions: $$ \frac{dP}{P\left(1- \frac P K \right)} = \frac{K\,dP}{P(K-P)} = \left( \frac 1 P + \frac 1 {K-P} \right) \, dP $$ Adding the two fractions on the right above, using $P(K-P)$ as a common denominator, gives you $(K-P)+P$ in the numerator, which is what you need to make it add up to the fraction in the middle.
Now you have $$ dt = \left( \frac 1 P + \frac 1 {K-P} \right) \, dP. $$ Integrating both sides you get $$ t + \text{constant} = \ln P - \ln(K-P). $$ This becomes $$ t + \text{constant} = \ln \left|\frac P {K-P} \right| $$ $$ e^{t+\text{constant}} = e^t \times \text{positive constant} = \left|\frac P {K-P} \right| $$ $$ e^t\times\text{constant} = \frac P {K-P} $$ $$ Ce^t (K-P) = P $$ $$ KCe^t - CPe^t = P $$ $$ KCe^t = P + CPe^t $$ $$ KCe^t = P(1 + Ce^t) $$ $$ \frac{KCe^t}{1+Ce^t} = P $$