# ODE with various initial conditions

I encountered the following ODE:

$$\frac{dx}{dt} = x(1-x)$$

Of course, this can easily be solved with separation of variables:

$$\implies \int \frac{dx}{x(1-x)} = \int dt \implies \ln \bigg|\frac{x}{1-x} \bigg| = t+C$$

This solution is valid on $$\Bbb R \backslash \{0,1\}$$, so there would be no problem with imposing initial condition $$x(0) = x_0$$ as long as $$x_0 \neq 0,1$$.

But, my question is how would we solve this ODE if the initial condition was indeed $$x_0=0$$ or $$x_0=1$$?

Intuitively, I see that these are fixed points so that $$x \equiv 0$$ or $$x \equiv 1$$ in these cases. But I guess I would like to know whether there is a way to express the solution of the ODE given general initial condition?

• Its perhaps important to note that this equation satisfies the hypothesis of Picard-Lindelof so the solution is unique. – Calvin Khor Jan 22 at 14:28

Think about the initial condition as a parameter. Since $$\ln \left| \frac{x}{1-x}\right| = e^t + C$$ we know $$\frac{x}{1-x} = A e^t$$ where $$A = e^C$$. Evaluating at $$t=0$$ gives $$A = \frac{x(0)}{1-x(0)}$$ and so $$x(t) = \frac{\frac{x(0)}{1-x(0)} e^t}{1 + \frac{x(0)}{1-x(0)} e^t} = \frac{x(0) e^t}{1+x(0)(e^t-1)}$$ So now think about the function $$\gamma(s,t)$$, where for each $$s$$, $$t \mapsto \gamma(s,t)$$ is the solution to $$x' = x(1-x)$$, $$x(0) = s$$. Using the above, we see that $$\gamma(s,t) = \frac{se^t}{1+s(e^t-1)}$$ Notice $$\lim_{s\to 0} \gamma(s,t) = 0$$ and $$\lim_{s\to 1} \gamma(s,t) = 1$$ for all $$t$$. So the two equilibrium cases are the limits of the non-equilibrium cases as the initial conditions tend toward the critical points.

If you intially start with $$x_0 = 0$$ or $$x_0 = 1$$, then there won't be a change in $$x$$ over time because in both cases you have: $$\frac{dx}{dt} = 0$$

So your $$x$$ won't change and will remain the same value so in this case you have $$x = 0$$ and $$x=1$$. You can't solve the ODE generally and analysing $$x_0 = 0$$ or $$x_0 = 1$$ at the end with your general solution. You need to consider them seperately. There isn't also a way to write the solution of the ODE in one form including $$x = 0$$ and $$x=1$$. You need to write the solution depending on which begin condition you use: $$x = 0 \hspace{3mm} \text{if} \hspace{3mm} x_0 = 0\\ \ln\left|\frac{x}{1-x} \right| = t+C \hspace{3mm} \text{if} \hspace{3mm} x_0 = \mathbb{R}\backslash\{0,1\}\\x = 1 \hspace{3mm} \text{if} \hspace{3mm} x_0 = 1\\$$

Solving for $$x$$ gives

$$x(t) = \frac{Ae^t}{1+Ae^t}$$

where $$A = e^C$$

Note that $$x(0) = \dfrac{A}{1+A}$$

The initial condition $$x(0)=0$$ occurs when $$A=0$$. This gives the constant solution, as predicted.

The initial condition $$x(0)=1$$ occurs in the limit $$A\to\infty$$. This also gives the constant solution.

I got $$x(t)=\frac{e^t}{e^t+e^{C}}$$ then we get $$x(0)=\frac{e^{0}}{e^{0}+e^{C}}$$

If $$x_0 = 0$$, then the function $$x(t)=0$$ satisfies both the initial condition and the differential equation.

Similarly, if $$x_0=1$$, the function $$x(t)=1$$ does the same.

First of all, solve for $$x$$ in the cases $$x_0 \neq -1, 0$$:

$$\ln \left| \frac{x(t)}{1-x(t)} \right| = t + C$$, hence $$x(t) = \frac{e^{t+C}}{1+e^{t+C}}$$. As $$C = \ln \left| \frac{x_0}{1-x_0} \right|$$ we have $$x(t) = \frac{e^{t+\ln \left| \frac{x_0}{1-x_0} \right|}}{1+e^{t+\ln \left| \frac{x_0}{1-x_0} \right|}} = \frac{\left| \frac{x_0}{1-x_0} \right|e^t}{1+\left| \frac{x_0}{1-x_0} \right|e^t} = \frac{|x_0|e^t}{|1-x_0|+|x_0| e^t}.$$

You asked for a closed formula for all $$x_0$$. Well, this formula is also valid for $$x_0 = 0$$ or $$x_0=1$$.