# General case of the pH calculation

General case of every equilibrium calculation is always the same. System is described by set of equations: mass balances, charge balance, and equlibria for all substances present in the solution. You solve it - and you know what are equilibrium concentrations of all ions and substances. Once full set of equations is obeyed there is no need to separately think of dissociation or hydrolysis, protonation or complexation, dissolving or precipitation - all these are taken into account.

The problem is - such full set of equations is usually extremely difficult to solve. Even for the simplest cases (like monoprotic acid solution) what we get trying to find ultimate solution for [H^{+}] is a third degree equation (see Acid/base solution section). Thus for practical purposes we are always looking for simplifying assumptions - but once the calculations are finished we have to check if the simplifications are justified. These simplifying assumptions always relate to the fact that we are dealing at the same time with numbers that differ by orders of magnitude. If you subtract 10^{-7} from 1 exact result is 0.9999999 - but error made assuming it is still 1 will be negligible. In most cases you can even assume 0.95 = 1 and the error will be acceptable. This is so called **5% rule** - if one of the elements in the sum is less than 5% of the second it can be neglected. Most dissociation constants are known with about 1% accuracy and the concentration of solutions used is rarely known with much higher precision. Additionally in concentrated solutions activity coefficients start to play important role and in most cases we are not able to calculate them precisely if the concentration of solution is above 0.1M. Thus doing too precise calculations doesn't make sense, as errors introduced through other means are higher.

Instead of doing calculations by hand we can use brute force approach - and solve set of equations using numerical methods. Doing so we can be sure no simplifying assumption spoils final result. Throughout this document we will sometimes use this approach (using BATE - pH calculator) to check how different assumptions influence the final result.