Solving $y' = k(a-y)(b-y)$ for $0<a<b$

334 Views Asked by At

I am trying to solve for y in the nonlinear homogeneous ordinary differential equation $$\frac{dy}{dt} = k(a-y)(b-y)$$. So far I have used the method shown in this question which is a separation of variables method, along with trying many U substitutions, integration factors and bernoulli's equation. I have tried solving the equation piece by piece by solving parts of it separately and adding the result, but I don't know how to treat the integration constants when combining the results.

I then went on to matlab to find the solution to the differential equation analytically by using the dsolve function with initial conditions of $y=0$ at $t=0$.

I have been able to verify my solution for the case when $a=b$ which is $y = a - \frac{a}{akt+1}$ using the boundary conditions. For that solution I simply used a variable change of $U = (a-y)^-1$ and then substituted y back at the end - this method is using bernoulli's equation.

Via the inspection of the matlab results for the general case where $0<a<b$ I have been able to see that the solution matlab gives seems to be $$y = a - \frac{b-a}{\exp(kt(b-a)+\ln(b/a))-1}$$ This is not certain as I had to use concrete numbers for the variables $a$, $b$ and $k$ and then figured out how they were featured in the answer(I made the variables prime so they would not be simplified in any of the manipulations and changed their values a couple of times to see the pattern).

However the answer I obtained, via the method which I linked to, i.e separation of variables by obtaining partial fractions, is $$y = a\frac{\exp(k(a-b)t)-1}{\exp(k(a-b)t+\ln(a/b))-1}$$ which I cannot show being the same as the answer I obtained via matlab.

In order to verify my answer I also tried taking the limit as $b$ tends to $a$, to see if I can get the same result as when $\frac{dy}{dt} = k(a-y)^2$ for the $a=b$ case, but I get a division by zero.

Any help is much appreciated!

4

There are 4 best solutions below

14
On BEST ANSWER

$$\frac{dy}{dt} = k(a-y)(b-y)$$ I suppose $a \ne b$ $$\frac{dy}{(y-a)(y-b)}= k{dt} $$ use fraction decomposition : $$dy \left (\frac{1}{(a-b)(y-a)}+\frac {1}{(b-a)(y-b)} \right )= k{dt} $$ Integrate: $$\int dy \left (\frac{1}{(y-a)}-\frac {1}{(y-b)} \right )= (a-b)(kt+C) $$ $$\ln{|y-a|}-\ln{|y-b|}= (a-b)(kt+C) $$ $$\left |\frac {y-a}{y-b} \right |= e^{(a-b)(kt+C)} $$ $$y(1 -e^{(a-b)(kt+C)})=a-b e^{(a-b)(kt+C)} $$ $$y(t)=\dfrac {a-b e^{(a-b)(kt+C)} }{1 -e^{(a-b)(kt+C)}}$$

For $a =b$ $$\frac{dy}{(y-a)^2}= k{dt}$$ Substitute $u=y-a$ $$\frac{du}{u^2}= k{dt}$$ $$\frac{1}{u}= -kt+C$$ $$y-a= \frac{1}{ -kt+C}$$ $$y(t)=a+ \frac{1}{C -kt}$$

1
On

In fact, this differential equation is well known under the term "logistic differential equation" and its solutions also. See [for example] (http://mathworld.wolfram.com/LogisticEquation.html), and the detailed explanation of the proof for example here where the logistic growth is seen as a modelization improvement over pure exponential growth (basic model : $y'=ay$ with solution $y=ce^{at}$).

This dates back from a 1845 article by P.F. Verhulst, about population growth published here, very interesting if you are able to read french.

0
On

You could also consider this equation as a Riccati equation $$y'=k(y^2-(a+b)y+ab)$$ and use the parametrization $y=-\frac{u'}{ku}$ leading to the linear equation $$ u''+(a+b)ku+abk^2u=0 $$ which has the obvious solution $u(t)=Ae^{-akt}+Be^{-bkt}$ so that $$ y(t)=\frac{aAe^{-akt}+bBe^{-bkt}}{Ae^{-akt}+Be^{-bkt}}. $$ This gives identical solutions if the ratio of $A$ and $B$ is the same, so that in the end this is a one-parameter family of solutions, as expected of a first order scalar ODE.


For the limit $b\to a$, one has to fix the initial value $y_0=\frac{aA+bB}{A+B}$, or $B(b-y_0)=A(y_0-a)$, so one can set $A=b-y_0$, $B=y_0-a$ and $$ y(t)=\frac{a(b-y_0)e^{(b-a)kt}+b(y_0-a)}{(b-y_0)e^{(b-a)kt}+(y_0-a)} $$ Now apply the l'Hopital rule to this limit of the form $\frac 00$, taking the $b$ derivatives at $b=a$ in numerator and denominator to get $$ y_{b=a}(t)=\frac{a+a(a-y_0)kt+(y_0-a)}{1+(a-y_0)kt}=a+\frac{(y_0-a)}{1+(a-y_0)kt} $$

10
On

I was able to show that the general case is equivalent to the $$a=b$$ case in the limit $$b\rightarrow a$$ I done this by using L'Hospital's rule.

Using $$y = \frac{b(e^{kt(b-a)}-1)}{\frac{b}{a}e^{kt(b-a)}-1}$$ we get $$ \frac{\frac{\partial }{\partial b}(b(e^{kt(b-a)}-1))}{\frac{\partial }{\partial b}(\frac{b}{a}e^{kt(b-a)}-1)}$$ which becomes $$\frac{e^{kt(b-a)}-1 +kbte^{kt(b-a)}}{\frac{1}{a}e^{kt(b-a)}+\frac{kbt}{a}e^{kt(b-a)}}$$ So we end up with $$\lim_{b\to a} \frac{e^{kt(b-a)}-1 +kbte^{kt(b-a)}}{\frac{1}{a}e^{kt(b-a)}+\frac{kbt}{a}e^{kt(b-a)}} = \frac{e^{kt(a-a)}-1 +kate^{kt(a-a)}}{\frac{1}{a}e^{kt(a-a)}+\frac{kat}{a}e^{kt(a-a)}} = \frac{kat}{kt+\frac{1}{a}} = \frac{ka^{2}t}{kat+1}$$

This is equivalent to the first result where $$a=b$$

So the two results are shown to be consistent.