A simple buffer solution consists of a solution of an acid and a salt of the conjugate base of the acid. For example, the acid may be acetic acid and the salt may be sodium acetate.
The Henderson–Hasselbalch equation relates the pH of a solution containing a mixture of the two components to the acid dissociation constant, K of the acid, and the concentrations of the species in solution. 
To derive the equation a number of simplifying assumptions have to be made. 
Assumption 1: The acid, HA, is monobasic and dissociates according to the equations
C is the analytical concentration of the acid and C is the concentration the hydrogen ion that has been added to the solution. The self-dissociation of water is ignored. A quantity in square brackets, [X], represents the concentration of the chemical substance X. It is understood that the symbol H stands for the hydrated hydronium ion. K is an acid dissociation constant.
The Henderson–Hasselbalch equation can be applied to a polybasic acid only if its consecutive pK values differ by at least 3. Phosphoric acid is such an acid.
Assumption 2. The self-ionization of water can be ignored.
This assumption is not, strictly speaking, valid with pH values close to 7, half the value of pK, the constant for self-ionization of water. In this case the mass-balance equation for hydrogen should be extended to take account of the self-ionization of water.
However, the term  can be omitted to a good approximation.
Assumption 3: The salt MA is completely dissociated in solution. For example, with sodium acetate
the concentration of the sodium ion, [Na] can be ignored. This is a good approximation for 1:1 electrolytes, but not for salts of ions that have a higher charge such as magnesium sulphate, MgSO, that form ion pairs.  
Assumption 4: The quotient of activity coefficients, , is a constant under the experimental conditions covered by the calculations.
The thermodynamic equilibrium constant, , 
is a product of a quotient of concentrations  and a quotient, , of activity coefficients .
In these expressions, the quantities in square brackets signify the concentration of the undissociated acid, HA, of the hydrogen ion H, and of the anion A; the quantities  are the corresponding activity coefficients. If the quotient of activity coefficients can be assumed to be a constant which is independent of concentrations and pH, the dissociation constant, K can be expressed as a quotient of concentrations.     
Rearrangement of this expression and taking logarithms provides the Henderson–Hasselbalch equation