Solution (source code)

= Solution

Whenever $I>0$, divide the first <SIR model> equation by the recovery equation:
$$
\frac{dS}{dR}=-\frac\beta\gamma S.
$$
The <SIR susceptible-recovered identity> follows by integrating from $R=0,S=N$, giving \b[susceptibles as a function of recovered individuals]:
$$
\boxed{S(t)=N e^{-\beta R(t)/\gamma}.}
$$
Population conservation then gives \b[the infectious count]:
$$
\boxed{I(t)=N+1-R(t)-N e^{-\beta R(t)/\gamma}.}
$$
These identities extend continuously to the limiting state where the infectious count vanishes.