Solution (source code)

= Solution

At rest, the cell has relatively high intracellular potassium and high extracellular sodium. The <membrane potential> is negative inside, largely because selective resting permeability, particularly potassium leak, combines with these electrochemical gradients. The sodium-potassium pump maintains the gradients over time; it is not the immediate regenerative current of an <action potential>.

Depolarization rapidly activates sodium <voltage-gated ion channels>, causing inward sodium current and further depolarization. Slower sodium inactivation and delayed potassium activation then reduce inward current and increase outward potassium current, repolarizing the membrane. Persisting potassium conductance can produce an after-hyperpolarization; recovery of sodium availability contributes to the <neuronal refractory period>. A spike transfers only a small fraction of the bulk ions, so it changes charge separation much more than it changes the overall concentration gradients.

For <two-state ion-channel gating>, let $X$ be the fraction of permissive gates. Opening transfers probability from $1-X$ at rate $\alpha_X(V)$, and closing transfers it back at rate $\beta_X(V)$:
$$
\boxed{\dot X=\alpha_X(V)(1-X)-\beta_X(V)X=\frac{X_\infty(V)-X}{\tau_X(V)}},\quad X_\infty=\frac{\alpha_X}{\alpha_X+\beta_X},\quad\tau_X=\frac1{\alpha_X+\beta_X}.
$$
Independent subunits that must all be permissive multiply their probabilities. The <Hodgkin-Huxley model> therefore uses $g_{\rm Na}=\bar g_{\rm Na}m^3h$ and $g_{\rm K}=\bar g_{\rm K}n^4$: $m$ describes sodium activation, $h$ sodium availability, and $n$ potassium activation. Their voltage-dependent time scales produce the sequence of inward and outward current. This channel-level construction is the mechanism in the primary https://onlinelibrary.wiley.com/doi/10.1113/jphysiol.1952.sp004764[Hodgkin–Huxley membrane-current model].