This is from Laitinen and Harris, "Chemical Analysis, An Advanced Text & Reference" which describes a simple acid-base equilibrium. They derive a relation in the end directly. I haven't seen this expression in many books which teach solution equilibria. The authors cite an article from the Journal of Chemical Education for the expressions (4 & 5). I didn't find article very useful. How should we derive the equations 4 and 5 in a better way than the author's explanation in italics?
The authors start from very simple equations:
$\ce{HA + H2O <=> H3O^+ + A-}\tag{1}$
Conventionally,
$\ce{HA <=> H+ + A^-}\tag{2}$
and the ionization of water, $\ce{H2O <=> H+ + OH-}\tag{3}$
If $C_{HA}$ and $C_{A^-}$ are the analytical concentrations of $\ce{HA}$ and $\ce{A^-}$, and if $\ce{[HA]}$ and $\ce{[A^-]}$ are the equilibrium concentrations, the relations...
$\ce{[HA]} = C_{HA} - \ce{([H^+] - [OH^-])}\tag{4}$
$\ce{[A^-]} = C_{A^-} + \ce{([H^+] - [OH^-])}\tag{5}$
The authors explain ...
"result because the analytical concentration of HA is diminished by the amount of hydrogen ion produced in Reaction (2), which in turn is the total hydrogen ion concentration minus the hydroxyl ion concentration."