# Characterization of solutions to $f' = f(1-f)$

The sigmoid function $f(x) = \frac{1}{1+e^{-x}}$ has the property that $$f'(x) = f(x)(1-f(x))~~~ and ~~~f(0) = \frac 12$$

My question: is $f$ the unique function from $\mathbb R$ to $(0,1)$, perhaps up to some kind of scaling, that satisfies $f' = f(1-f)$?

I don't have much experience with differential equations so a nonlinear one like this is beyond anything I've done before.

In case it helps, my motivation for this is that this property makes the log likelihood a lot easier in a logistic regression, and I'm wondering if assuming that the inverse link function satisfies this property is equivalent to just taking it to be $f$.

• Consider looking up three Picard-Lindelof theorem. – Michael McGovern Feb 2 '18 at 20:12
• It's Bernoulli's equation. The general solution is $\frac{1}{1+C e^{-x}}$ for some constant $C$ – Yuriy S Feb 2 '18 at 20:13
• You can find plenty of information about this if you search for “logistic equation”. Here, for example: math.stackexchange.com/questions/78560/… – Hans Lundmark Feb 3 '18 at 8:45
• @HansLundmark thanks for the link, that's very helpful. I now remember learning that years ago but didn't recognize it here – alfalfa Feb 5 '18 at 14:42

Note that since $f(0)=1/2$ then, $f\not\equiv 1$ and , $f\not\equiv 0$ hence a solution cannot an equilibrium $$f'=f(1-f)\Longleftrightarrow\frac{f'}{f} +\frac{f'}{1-f} =1\Longleftrightarrow \ln (|f|)- \ln(|1-f|) =x+c$$

But, $f(x)\in (0,1)$ we obtain $$\ln (f)- \ln(1-f) =x+c\Longleftrightarrow \frac{f}{1-f} =ke^x \Longleftrightarrow f(x) =1-\frac{1}{1+ ke^x}$$

I am sure you can the $k$ by yourself.

• There's also the exceptional solution $f \equiv 1$ which isn't covered by this (also $f \equiv 0$ doesn't work with the formal calculation but it happens to match the solution where $k = 0$). – Daniel Schepler Feb 2 '18 at 21:50
• @DanielSchepler Yes I understand you meant the equilibria right? but they don't satisfy the initial condition $f(0)= 1/2$ – Guy Fsone Feb 2 '18 at 21:52
• Another way to put the first line is that the conclusion can only be inferred on intervals where $f \neq 0$ and $f \neq 1$. (and note of the domain contained two disjoint intervals, the constant $c$ could be different on each interval!) The given problem is that the entire real line is such an interval; but in general this type of argument has to continue on to analyze the transitions between such intervals. – user14972 Feb 2 '18 at 22:03
• @GuyFsone: Consider breaking up the chain of implications across multiple lines (e.g. using an align environment). When it's too long like that you run the risk of line breaks being inserted in unfortunate places. For example, on my screen, your second chain of reasoning ends with the conclusion "$f(x) = 1$". – user14972 Feb 2 '18 at 22:06
• @Hurkyl I know that synthax of breaking up the lines nut I just want to give quick answer. you edit it I will accept your edit if you want – Guy Fsone Feb 2 '18 at 22:13

writing your equation in the form $$-\frac{\frac{df(x)}{dx}}{(f(x)-1)(f(x)}=1$$ and by integrating $$-\int \frac{\frac{df(x)}{dx}}{(f(x)-1)f(x)}dx=\int 1dx$$ doing this we obtain $$-\log(-f(x)+1)+\log(f(x))=x+C$$

• It's worth explicitly noting that this argument is making use of the $f(x) \in (0,1)$ hypothesis, since it implicitly relies on the fact that the first equation is valid for all $x$. – user14972 Feb 2 '18 at 22:00