Buffer solutions

When a weak acid and its conjugate base are both present in solution, small amounts of acid or base will result in a smaller pH change than would result if the same amount of acid or base was added to a neutral solution. Thus, a combination of weak acid and conjugate base is said to "buffer" the pH of a solution and so the solution is known as a buffer. For a solution of the weak acid ${\displaystyle HA}$ and its conjugate base ${\displaystyle A^{-}}$, addition of base or acid would result in one of the following:
• ${\displaystyle HA+B\rightleftharpoons HB^{+}+A^{-}}$
• ${\displaystyle HA+OH^{-}\rightarrow H_{2}O+A^{-}}$
• ${\displaystyle A^{-}+H^{+}\rightleftharpoons HA}$
Using the example of an ${\displaystyle HA/A^{-}}$ solution, we have the following equilibrium-constant expression: ${\displaystyle K_{a}={\frac {[A^{-}][H^{+}]}{[HA]}}}$
Then, through algebraic manipulations, we have: ${\displaystyle {\begin{array}{ccl}K_{a}&=&{\frac {[A^{-}][H^{+}]}{[HA]}}\\\log K_{a}&=&\log {\frac {[A^{-}][H^{+}]}{[HA]}}\\\log K_{a}&=&\log[A^{-}][H^{+}]-\log[HA]\\\log K_{a}&=&\log[A^{-}]+\log[H^{+}]-\log[HA]\\-\log[H^{+}]&=&-\log[K_{a}]+\log[A^{-}]-\log[HA]\\pH&=&pK_{a}+\log {\frac {[A^{-}]}{[HA]}}\\\end{array}}}$
This equation is known as the Henderson-Hasselbalch equation, and it serves as a good way to approximate the pH of a buffer solution. If the ${\displaystyle K_{a}}$ of the acid is small enough, then the final concentrations of acid and base will be close to the same after equilibrium has been reached, and so using initial concentrations instead of final concentrations in the equation above produces a good approximation.