Finding an expression for $M$ in terms of $t$. differential equations 

The mass $M$ at time $t$ of the leaves of a certain plant varies according to the differential equation $$\frac{\mathrm{d}m}{\mathrm{d}t}= M-M^2$$
Given that at time $t=0$, $M=0.5$, find an expression for $M$ in terms of $t$


I wasn't sure how to start so I began by solving the differential equation to get $$\frac{1}{M-M^2}\mathrm{d}M=\mathrm{d}t$$
Then simplifying, I get $$ln\frac{M}{1-M}=t$$ using log rules. To cancel $ln$ I get $$\frac{M}{1-M}=e^t$$ and then I get $M=e^t-me^t$
However the answer is $$\frac{e^t}{1+e^t}$$
I don't understand how they got that?

I believe you have done the integration step wrong, you should end up with -ln((1/M) - 1) = t on that line and the rest should work from there. Let me know if you have any problems after resolving that!
