# How to solve the following ODE's with initial conditions symbolically [closed]

How would I solve these ODE's both with initial conditions $$I(t)=I_0$$

$$\frac{d I}{dt} = \beta I - \frac{\beta I^2}{N} \qquad (1)$$

and

$$\frac{d I}{dt} = (\beta-\gamma) I - \frac{\beta I^2}{N} \qquad (2)$$

A solution was given to the second ODE on a paper but I don't know how they got it:

$$I(t)= \frac{\left(\beta-\gamma\right)NI_0} {\left(\beta-\gamma\right)N e^{-\left(\beta-\gamma\right)t} +\beta I_0 \left[1- e^{-\left(\beta-\gamma\right)t} \right] }$$

Thank you.

• @MariuszIwaniuk thank you, really appreciated! Maybe you should post that as an answer so I can give you best answer :)
– Math
Mar 1, 2021 at 16:18
• Both are versions of the logistic equation, which is solvable as a Bernoulli differential equation / Riccati equation. Mar 1, 2021 at 18:44
• And to state what is probably obvious, the first equation is the special case of the second when $\gamma=0$. Mar 1, 2021 at 23:37

DSolve[{i'[t] == (β - γ)*i[t] - β i[t]^2/n,i == I0}, i[t], t] // FullSimplify