# Find the function f such that `f'(x) = f(x)(1-f(x))` and `f(0) = 1/2`

*print*Print*list*Cite

### 1 Answer

Given `f'(x)=f(x)(1-f(x))`

and `f(0)=1/2:`

Let y=f(x) and rewrite as:

`(dy)/(dx)=y(1-y)`

Use separation of variables to get:

`(dy)/(y(1-y))=dx`

Rewrite the left hand side using partial fractions:

`(dy)/y - (dy)/(1-y) = dx`

So

`int (dy)/y - int(dy)/(1-y)=int dx`

lny-ln(1-y)=x+c

`ln(y)/(1-y)=x+c`

`y/(1-y)=ce^x`

`(1-y)/y=ce^(-x)`

`1/y-1=ce^(-x)`

`1/y=ce^(-x)+1 `

`y=1/(ce^(-x)+1) `

`y=(e^x)/(c+e^x) `

At 0, `y=1/2 so`

`1/2=1/(c+1) ==> c=1`

so

`y=e^x/(1+e^x)`

**Sources:**

### Hide Replies ▲

The answer is correct. The partial fraction expansion is not written correctly.

`1/(y(1-y))=1/y+1/(1-y)`

so we would have `dy/y + dy/(1-y)`

but the derivative of 1-y is -dy so the integrals should be written as:

`int dy/y - int (-dy)/(1-y)=int dx`

and the rest will follow.

You can check the answer:

`y'=e^x/(1+e^x)^2`

`f(x)(1-f(x))=(e^x/(1+e^x))(1-e^x/(1+e^x))`

`=e^x/(1+e^x)^2`