# What is the Solution of the Differential Equation  (dP)/dt = kP - AP^2?

May 9, 2017

$P \left(t\right) = \frac{k \mu {e}^{k t}}{1 + \mu A {e}^{k t}}$ where $\mu = {P}_{0} / \left(k - A {P}_{0}\right)$

#### Explanation:

We have:

$\frac{\mathrm{dP}}{\mathrm{dt}} = k P - A {P}^{2}$
$\therefore \frac{\mathrm{dP}}{\mathrm{dt}} = P \left(k - A P\right)$
$\therefore \frac{1}{P \left(k - A P\right)} \frac{\mathrm{dP}}{\mathrm{dt}} = 1$

Which is a First Order Separable DE, so we can "separate the variables" to gett:

$\int \setminus \frac{1}{P \left(k - A P\right)} \setminus \mathrm{dP} = \int \setminus \mathrm{dt} \setminus \setminus \setminus \setminus \setminus \ldots . . \left(\star\right)$

We can decompose the LHS integrand into Partial Fractions:

$\frac{1}{P \left(k - A P\right)} \equiv \frac{a}{P} + \frac{b}{k - A P}$
$\text{ } \equiv \frac{a \left(k - A P\right) + b P}{P \left(k - A P\right)}$

$1 \equiv a \left(k - A P\right) + b P$

To find thee coefficients $a$ and $b$ we can use substitution:

Put $P = 0 \setminus \setminus \implies 1 = a k \setminus \setminus \implies a = \frac{1}{k}$
Put $P = \frac{k}{A} \implies 1 = \frac{b k}{A} \implies b = \frac{A}{k}$

Hence we can re-write $\left(\star\right)$ as:

$\int \setminus \frac{\frac{1}{k}}{P} + \frac{\frac{A}{k}}{k - A P} \setminus \mathrm{dP} = \int \setminus \mathrm{dt}$

$\therefore \frac{1}{k} \setminus \int \setminus \frac{1}{P} + \frac{A}{k - A P} \setminus \mathrm{dP} = \int \setminus \mathrm{dt}$

Which we can now integrate to get:

$\therefore \frac{1}{k} \left\{\ln P + A \left(- \frac{1}{A}\right) \ln \left(k - A P\right)\right\} = t + C$

$\therefore \frac{1}{k} \left\{\ln P - \ln \left(k - A P\right)\right\} = t + C$

$\therefore \frac{1}{k} \ln \left(\frac{P}{k - A P}\right) = t + C$

Using the initial condition $P = {P}_{0}$ when $t = 0$ we have:

$\therefore \frac{1}{k} \ln \left({P}_{0} / \left(k - A {P}_{0}\right)\right) = C$

And so the solution is:

$\frac{1}{k} \ln \left(\frac{P}{k - A P}\right) = t + \frac{1}{k} \ln \left({P}_{0} / \left(k - A {P}_{0}\right)\right)$
$\therefore \ln \left(\frac{P}{k - A P}\right) = k t + \ln \left({P}_{0} / \left(k - A {P}_{0}\right)\right)$

We can remove the logarithm by taking exponents of both sides:

${e}^{\ln \left(\frac{P}{k - A P}\right)} = {e}^{k t + \ln \left({P}_{0} / \left(k - A {P}_{0}\right)\right)}$

 :. P/(k-AP) = e^(kt)e^ln(P_0/(k-AP_0)))
$\text{ } = {e}^{k t} \left({P}_{0} / \left(k - A {P}_{0}\right)\right)$

To simplify the expression, let $\mu = {P}_{0} / \left(k - A {P}_{0}\right)$, then:

$\frac{P}{k - A P} = \mu {e}^{k t}$
$\therefore P = \mu \left(k - A P\right) {e}^{k t}$
$\text{ } = \mu k {e}^{k t} - \mu A P {e}^{k t}$
$\therefore P + \mu A P {e}^{k t} = \mu k {e}^{k t}$
$\therefore P \left(1 + \mu A {e}^{k t}\right) = \mu k {e}^{k t}$
$\therefore P = \frac{\mu k {e}^{k t}}{1 + \mu A {e}^{k t}}$

Hence:

$P \left(t\right) = \frac{k \mu {e}^{k t}}{1 + \mu A {e}^{k t}}$ where $\mu = {P}_{0} / \left(k - A {P}_{0}\right)$

May 9, 2017

$\frac{\mathrm{dP}}{\mathrm{dt}} = k P - A {P}^{2} , A > 0$

This is separable:

$\frac{\mathrm{dP}}{\mathrm{dt}} = k P \left(1 - \frac{A}{k} P\right)$

$\int \frac{\mathrm{dP}}{P \left(1 - \frac{A}{k} P\right)} = \int k \mathrm{dt}$

Partial Fraction decomp:

$\frac{1}{P \left(1 - \frac{A}{k} P\right)} = \frac{\alpha}{P} + \frac{\beta}{1 - \frac{A}{k} P}$

$\implies \alpha \left(1 - \frac{A}{k} P\right) + \beta P = 1$

$\implies \alpha = 1 , \beta = \frac{A}{k}$

$\implies \int \frac{1}{P} + \frac{\frac{A}{k}}{1 - \frac{A}{k} P} \mathrm{dP} = \int k \mathrm{dt}$

${\left[\ln P - \ln \left(1 - \frac{A}{k} P\right)\right]}_{{P}_{o}}^{P} = {\left[k t\right]}_{0}^{t}$

$\implies \ln \left(\frac{\frac{P}{P} _ o}{\frac{1 - \frac{A}{k} P}{1 - \frac{A}{k} {P}_{o}}}\right) = k t$

$\implies \frac{\frac{P}{P} _ o}{\frac{1 - \frac{A}{k} P}{1 - \frac{A}{k} {P}_{o}}} = {e}^{k t}$

$\implies P = \left(1 - \frac{A}{k} P\right) {P}_{o} / \left(1 - \frac{A}{k} {P}_{o}\right) {e}^{k t}$

$\implies P \left(1 + \frac{A}{k} \cdot {P}_{o} / \left(1 - \frac{A}{k} {P}_{o}\right) {e}^{k t}\right) = {P}_{o} / \left(1 - \frac{A}{k} {P}_{o}\right) {e}^{k t}$

$\implies P = \frac{{P}_{o} / \left(1 - \frac{A}{k} {P}_{o}\right) {e}^{k t}}{1 + \frac{A}{k} \cdot {P}_{o} / \left(1 - \frac{A}{k} {P}_{o}\right) {e}^{k t}}$

$= \frac{k {P}_{o} {e}^{k t}}{\left(k - A {P}_{o}\right) + A {P}_{o} {e}^{k t}}$

= ( k P_o e^(kt) )/ ( k - A P_o (1- e^(kt) )

That's soooo ugly, there must be a better way :(

May 9, 2017

$P = k \left({e}^{k \left(t + {C}_{0}\right)} / \left(1 + A {e}^{k t + {C}_{0}}\right)\right)$

#### Explanation:

This is a separable differential equation so

$\frac{\mathrm{dP}}{k P - A {P}^{2}} = \mathrm{dt}$ or

$\frac{1}{k} \left(\frac{1}{P} + \frac{A}{k - A P}\right) \mathrm{dP} = \mathrm{dt}$

or

$\frac{1}{k} \left({\log}_{e} P - {\log}_{e} \left(k - A P\right)\right) = t + {C}_{0}$

or

${\log}_{e} P - {\log}_{e} \left(k - A P\right) = k \left(t + {C}_{0}\right)$ or

$\frac{P}{k - A P} = {C}_{1} {e}^{k t + {C}_{0}}$

and finally

$P = k \left({e}^{k \left(t + {C}_{0}\right)} / \left(1 + A {e}^{k t + {C}_{0}}\right)\right)$