# PH

In chemistry, pH (/piːˈeɪtʃ/ pee-AYCH), also referred to as acidity or basicity, historically denotes "potential of hydrogen" (or "power of hydrogen"). It is a logarithmic scale used to specify the acidity or basicity of aqueous solutions. Acidic solutions (solutions with higher concentrations of hydrogen (H$^+$) ions) are measured to have lower pH values than basic or alkaline solutions.
The pH scale is logarithmic and inversely indicates the activity of hydrogen ions in the solution
    ${\ce {pH}}=-\log _{10}(a_{{\ce {H+}}})\thickapprox -\log _{10}([{\ce {H+}}])$
where [H$^+$] is the equilibrium molar concentration of H$^+$ (in M = mol/L) in the solution. At 25 °C (77 °F), solutions of which the pH is less than 7 are acidic, and solutions of which the pH is greater than 7 are basic. Solutions with a pH of 7 at 25 °C are neutral (i.e. have the same concentration of H$^+$ ions as OH$^−$ ions, i.e. the same as pure water). The neutral value of the pH depends on the temperature and is lower than 7 if the temperature increases above 25 °C. The pH range is commonly given as zero to 14, but a pH value can be less than 0 for very concentrated strong acids or greater than 14 for very concentrated strong bases.
The pH scale is traceable to a set of standard solutions whose pH is established by international agreement. Primary pH standard values are determined using a concentration cell with transference by measuring the potential difference between a hydrogen electrode and a standard electrode such as the silver chloride electrode. The pH of aqueous solutions can be measured with a glass electrode and a pH meter or a color-changing indicator. Measurements of pH are important in chemistry, agronomy, medicine, water treatment, and many other applications.

## History

In 1909, the Danish chemist Søren Peter Lauritz Sørensen introduced the concept of pH at the Carlsberg Laboratory, originally using the notation "p$_{H•}$", with H• as a subscript to the lowercase p. The concept was later revised in 1924 to the modern pH to accommodate definitions and measurements in terms of electrochemical cells.
   For the sign p, I propose the name 'hydrogen ion exponent' and the symbol p$_{H•}$. Then, for the hydrogen ion exponent (p$_{H•}$) of a solution, the negative value of the Briggsian logarithm of the related hydrogen ion normality factor is to be understood.
Sørensen did not explain why he used the letter p, and the exact meaning of the letter is still disputed. Sørensen described a way of measuring pH using potential differences, and it represents the negative power of 10 in the concentration of hydrogen ions. The letter p could stand for the French puissance, German Potenz, or Danish potens, all meaning "power", or it could mean "potential". All of these words start with the letter p in French, German, and Danish, which were the languages in which Sørensen published: Carlsberg Laboratory was French-speaking; German was the dominant language of scientific publishing; Sørensen was Danish. He also used the letter q in much the same way elsewhere in the paper, and he might have arbitrarily labelled the test solution "p" and the reference solution "q"; these letters are often paired with e4 then e5. Some literature sources suggest that "pH" stands for the Latin term pondus hydrogenii (quantity of hydrogen) or potentia hydrogenii (power of hydrogen), although this is not supported by Sørensen's writings.
In modern chemistry, the p stands for "the negative decimal logarithm of", and is used in the term pK$_a$ for acid dissociation constants, so pH is "the negative decimal logarithm of H$^+$ ion concentration", while pOH is "the negative decimal logarithm of OH$^−$ ion concentration".
Bacteriologist Alice Catherine Evans, who influenced dairying and food safety, credited William Mansfield Clark and colleagues, including herself, with developing pH measuring methods in the 1910s, which had a wide influence on laboratory and industrial use thereafter. In her memoir, she does not mention how much, or how little, Clark and colleagues knew about Sørensen's work a few years prior. She said:
   In these studies [of bacterial metabolism] Dr. Clark's attention was directed to the effect of acid on the growth of bacteria. He found that it is the intensity of the acid in terms of hydrogen-ion concentration that affects their growth. But existing methods of measuring acidity determined the quantity, not the intensity, of the acid. Next, with his collaborators, Dr. Clark developed accurate methods for measuring hydrogen-ion concentration. These methods replaced the inaccurate titration method of determining the acid content in use in biologic laboratories throughout the world. Also they were found to be applicable in many industrial and other processes in which they came into wide usage.
The first electronic method for measuring pH was invented by Arnold Orville Beckman, a professor at the California Institute of Technology in 1934. It was in response to a request from the local citrus grower Sunkist, which wanted a better method for quickly testing the pH of lemons they were picking from their nearby orchards.

## Definition
### pH

The pH of a solution is defined as the decimal logarithm of the reciprocal of the hydrogen ion activity, a$_H$+. Mathematically, pH is expressed as:
    ${\ce {pH}}=-\log _{10}(a_{{\ce {H+}}})=\log _{10}\left({\frac {1}{a_{{\ce {H+}}}}}\right)$
For example, for a solution with a hydrogen ion activity of 5×10$^{−6}$ mol/L (i.e., the concentration of hydrogen ions), the pH of the solution can be calculated as follows:
    ${\ce {pH}}=-\log _{10}(5\times 10^{-6})=5.3$
The concept of pH was developed because ion-selective electrodes, which are used to measure pH, respond to activity. The electrode potential, E, follows the Nernst equation for the hydrogen ion, which can be expressed as:
    $E=E^{0}+{\frac {RT}{F}}\ln(a_{{\ce {H+}}})=E^{0}-{\frac {RT\ \ln {10}}{F}}{\ce {pH}}\approx E^{0}-{\frac {2.303\ RT}{F}}{\ce {pH}}$
where E is a measured potential, E$^0$ is the standard electrode potential, R is the molar gas constant, T is the thermodynamic temperature, F is the Faraday constant. For H$^+$, the number of electrons transferred is one. The electrode potential is proportional to pH when pH is defined in terms of activity.
The precise measurement of pH is presented in International Standard ISO 31-8 as follows: A galvanic cell is set up to measure the electromotive force (e.m.f.) between a reference electrode and an electrode sensitive to the hydrogen ion activity when they are both immersed in the same aqueous solution. The reference electrode may be a silver chloride electrode or a calomel electrode, and the hydrogen-ion selective electrode is a standard hydrogen electrode.
    Reference electrode | concentrated solution of KCl || test solution | H$_2$ | Pt
Firstly, the cell is filled with a solution of known hydrogen ion activity and the electromotive force, E$_S$, is measured. Then the electromotive force, E$_X$, of the same cell containing the solution of unknown pH is measured.
    ${\ce {pH(X)}}={\ce {pH(S)}}+{\frac {E_{{\ce {S}}}-E_{{\ce {X}}}}{z}}$
The difference between the two measured electromotive force values is proportional to pH. This method of calibration avoids the need to know the standard electrode potential. The proportionality constant, 1/z, is ideally equal to ${\frac {F}{RT\ln {10}}}\$, the "Nernstian slope".
In practice, a glass electrode is used instead of the cumbersome hydrogen electrode. A combined glass electrode has an in-built reference electrode. It is calibrated against Buffer solutions of known hydrogen ion (H$^+$) activity proposed by the International Union of Pure and Applied Chemistry (IUPAC). Two or more buffer solutions are used in order to accommodate the fact that the "slope" may differ slightly from ideal. To calibrate the electrode, it is first immersed in a standard solution, and the reading on a pH meter is adjusted to be equal to the standard buffer's value. The reading from a second standard buffer solution is then adjusted using the "slope" control to be equal to the pH for that solution. Further details, are given in the IUPAC recommendations. When more than two buffer solutions are used the electrode is calibrated by fitting observed pH values to a straight line with respect to standard buffer values. Commercial standard buffer solutions usually come with information on the value at 25 °C and a correction factor to be applied for other temperatures.
The pH scale is logarithmic and therefore pH is a dimensionless quantity.

### p[H]

This was the original definition of Sørensen in 1909, which was superseded in favor of pH in 1924. [H] is the concentration of hydrogen ions, denoted [H$^+$] in modern chemistry. More correctly, the thermodynamic activity of H$^+$ in dilute solution should be replaced by [H$^+$]/c$_0$, where the standard state concentration c$_0$ = 1 mol/L. This ratio is a pure number whose logarithm can be defined.
It is possible to measure the concentration of hydrogen ions directly using an electrode calibrated in terms of hydrogen ion concentrations. One common method is to titrate a solution of known concentration of a strong acid with a solution of known concentration of strong base in the presence of a relatively high concentration of background electrolyte. By knowing the concentrations of the acid and base, the concentration of hydrogen ions can be calculated and the measured potential can be correlated with concentrations. The calibration is usually carried out using a Gran plot. This procedure makes the activity of hydrogen ions equal to the numerical value of concentration.
The glass electrode (and other Ion selective electrodes) should be calibrated in a medium similar to the one being investigated. For instance, if one wishes to measure the pH of a seawater sample, the electrode should be calibrated in a solution resembling seawater in its chemical composition.
The difference between p[H] and pH is quite small, and it has been stated that pH = p[H] + 0.04. However, it is common practice to use the term "pH" for both types of measurement.

### pOH

pOH is sometimes used as a measure of the concentration of hydroxide ions, OH$^−$. By definition, pOH is the negative logarithm (to the base 10) of the hydroxide ion concentration (mol/L). pOH values can be derived from pH measurements and vice-versa. The concentration of hydroxide ions in water is related to the concentration of hydrogen ions by
    $[{\ce {OH^-}}]={\frac {K_{{\ce {W}}}}{[{\ce {H^+}}]}}$
where K$_W$ is the self-ionization constant of water. Taking Logarithms,
    ${\ce {pOH}}={\ce {p}}K_{{\ce {W}}}-{\ce {pH}}.$
So, at room temperature, pOH ≈ 14 − pH. However this relationship is not strictly valid in other circumstances, such as in measurements of soil alkalinity.

## Measurement
### pH Indicators

Average pH of common solutions :
| Substance | pH range | Type |
| Battery acid | < 1 | Acid |
| Gastric acid | 1.0–1.5 | Acid |
| Vinegar | 2–3 | Acid |
| Orange juice | 3.3–4.2 | Acid |
| Black coffee | 5–5.03 | Acid |
| Milk | 6.5–6.8 | Acid |
| Pure water at 25 °C | 7 | Neutral |
| Sea water | 7.5–8.4 | Base |
| Ammonia | 11.0–11.5 | Base |
| Bleach | 12.5 | Base |
| Lye | 14 | Base |
pH can be measured using indicators, which change color depending on the pH of the solution they are in. By comparing the color of a test solution to a standard color chart, the pH can be estimated to the nearest whole number. For more precise measurements, the color can be measured using a colorimeter or spectrophotometer. A Universal indicator is a mixture of several indicators that can provide a continuous color change over a range of pH values, typically from about pH 2 to pH 10. Universal indicator paper is made from absorbent paper that has been impregnated with a universal indicator. An alternative method of measuring pH is using an electronic pH meter, which directly measures the voltage difference between a pH-sensitive electrode and a reference electrode.

### Non-aqueous solutions

pH values can be measured in non-aqueous solutions, but they are based on a different scale from aqueous pH values because the standard states used for calculating hydrogen ion concentrations (activities) are different. The hydrogen ion activity, a$_{H+}$, is defined as:
    $a_{{\ce {H+}}}=\exp \left({\frac {\mu _{{\ce {H+}}}-\mu _{{\ce {H+}}}^{\ominus }}{RT}}\right)$
where μ$_{H+}$ is the chemical potential of the hydrogen ion, $\mu _{{\ce {H+}}}^{\ominus }$ is its chemical potential in the chosen standard state, R is the molar gas constant and T is the thermodynamic temperature. Therefore, pH values on the different scales cannot be compared directly because of differences in the solvated proton ions, such as lyonium ions, which require an insolvent scale that involves the transfer activity coefficient of hydronium/lyonium ion.
pH is an example of an acidity function, but others can be defined. For example, the Hammett acidity function, H$_0$, has been developed in connection with Superacids.

### Unified absolute pH scale

In 2010, a new approach to measuring pH was proposed, called the unified absolute pH scale. This approach allows for a common reference standard to be used across different solutions, regardless of their pH range. The unified absolute pH scale is based on the absolute chemical potential of the proton, as defined by the Lewis acid–base theory. This scale applies to liquids, gases, and even solids. The advantages of the unified absolute pH scale include consistency, accuracy, and applicability to a wide range of sample types. It is precise and versatile because it serves as a common reference standard for pH measurements. However, implementation efforts, compatibility with existing data, complexity, and potential costs are some challenges.

### Extremes of pH measurements

The measurement of pH can become difficult at extremely acidic or alkaline conditions, such as below pH 2.5 (ca. 0.003 mol/dm$^3$ acid) or above pH 10.5 (above ca. 0.0003 mol/dm$^3$ alkaline). This is due to the breakdown of the Nernst equation in such conditions when using a glass electrode. Several factors contribute to this problem. First, liquid junction potentials may not be independent of pH. Second, the high ionic strength of concentrated solutions can affect the electrode potentials. At high pH the glass electrode may be affected by "alkaline error", because the electrode becomes sensitive to the concentration of cations such as Na$^+$ and K$^+$ in the solution. To overcome these problems, specially constructed electrodes are available.
Runoff from mines or mine tailings can produce some extremely low pH values, down to −3.6.

## Applications

Pure water has a pH of 7 at 25 °C, meaning it is neutral. When an acid is dissolved in water, the pH will be less than 7, while a base, or alkali, will have a pH greater than 7. A strong acid, such as hydrochloric acid, at concentration 1 mol dm$^{−3}$ has a pH of 0, while a strong alkali like sodium hydroxide, at the same concentration, has a pH of 14. Since pH is a logarithmic scale, a difference of one in pH is equivalent to a tenfold difference in hydrogen ion concentration.
Neutrality is not exactly 7 at 25 °C, but 7 serves as a good approximation in most cases. Neutrality occurs when the concentration of hydrogen ions ([H$^+$]) equals the concentration of hydroxide ions ([OH$^−$]), or when their activities are equal. Since self-ionization of water holds the product of these concentration [H$^+$] × [OH$^−$] = K$_w$, it can be seen that at neutrality [H$^+$] = [OH$^−$] = √K$_w$, or pH = pK$_w$/2. pK$_w$ is approximately 14 but depends on ionic strength and temperature, and so the pH of neutrality does also. Pure water and a solution of NaCl in pure water are both neutral, since dissociation of water produces equal numbers of both ions. However the pH of the neutral NaCl solution will be slightly different from that of neutral pure water because the hydrogen and hydroxide ions' activity is dependent on ionic strength, so K$_w$ varies with ionic strength.
When pure water is exposed to air, it becomes mildly acidic. This is because water absorbs carbon dioxide from the air, which is then slowly converted into bicarbonate and hydrogen ions (essentially creating carbonic acid).
    CO$_2$ + H$_2$O ⇌ HCO−3 + H$^+$

### pH in soil

The United States Department of Agriculture Natural Resources Conservation Service, formerly Soil Conservation Service classifies soil pH ranges as follows:
| Denomination | pH range |
| Ultra acidic | < 3.5 |
| Extremely acidic | 3.5–4.4 |
| Very strongly acidic | 4.5–5.0 |
| Strongly acidic | 5.1–5.5 |
| Moderately acidic | 5.6–6.0 |
| Slightly acidic | 6.1–6.5 |
| Neutral | 6.6–7.3 |
| Slightly alkaline | 7.4–7.8 |
| Moderately alkaline | 7.9–8.4 |
| Strongly alkaline | 8.5–9.0 |
| Very strongly alkaline | 9.0–10.5 |
| Hyper alkaline | > 10.5 |
Topsoil pH is influenced by soil parent material, erosional effects, climate and vegetation. A recent map of topsoil pH in Europe shows the alkaline soils in Mediterranean, Hungary, East Romania, North France. Scandinavian countries, Portugal, Poland and North Germany have more acid soils.

### pH in plants

Plants contain pH-dependent pigments that can be used as pH indicators, such as those found in hibiscus, red cabbage (anthocyanin), and grapes (red wine). Citrus fruits have acidic juice primarily due to the presence of citric acid, while other carboxylic acids can be found in various living systems. The protonation state of phosphate derivatives, including ATP, is pH-dependent. Hemoglobin, an oxygen-transport enzyme, is also affected by pH in a phenomenon known as the Root effect.

### pH in the ocean

The pH of seawater plays an important role in the ocean's carbon cycle. There is evidence of ongoing ocean acidification (meaning a drop in pH value): Between 1950 and 2020, the average pH of the ocean surface fell from approximately 8.15 to 8.05. Carbon dioxide emissions from human activities are the primary cause of ocean acidification, with atmospheric carbon dioxide (CO$_2$) levels exceeding 410 ppm (in 2020). CO$_2$ from the atmosphere is absorbed by the oceans. This produces carbonic acid (H$_2$CO$_3$) which dissociates into a bicarbonate ion (HCO$^−$ $_3$) and a hydrogen ion (H$^+$). The presence of free hydrogen ions (H$^+$) lowers the pH of the ocean.

#### Three pH scales in oceanography

The measurement of pH in seawater is complicated by the chemical properties of seawater, and three distinct pH scales exist in chemical oceanography. In practical terms, the three seawater pH scales differ in their pH values up to 0.10, differences that are much larger than the accuracy of pH measurements typically required, in particular, in relation to the ocean's carbonate system. Since it omits consideration of sulfate and fluoride ions, the free scale is significantly different from both the total and seawater scales. Because of the relative unimportance of the fluoride ion, the total and seawater scales differ only very slightly.
As part of its operational definition of the pH scale, the IUPAC defines a series of Buffer solutions across a range of pH values (often denoted with National Bureau of Standards (NBS) or National Institute of Standards and Technology (NIST) designation). These solutions have a relatively low ionic strength (≈ 0.1) compared to that of seawater (≈ 0.7), and, as a consequence, are not recommended for use in characterizing the pH of seawater, since the ionic strength differences cause changes in electrode potential. To resolve this problem, an alternative series of buffers based on artificial seawater was developed. This new series resolves the problem of ionic strength differences between samples and the buffers, and the new pH scale is referred to as the total scale, often denoted as pH$_T$. The total scale was defined using a medium containing sulfate ions. These ions experience protonation, H$^+$ + SO$^{2−}$ $_4$↔ HSO$^−$ $_4$, such that the total scale includes the effect of both protons (free hydrogen ions) and hydrogen sulfate ions:
    [H$^+$]$_T$ = [H$^+$]$_F$ + [HSO$^−$ $_4$]
An alternative scale, the free scale, often denoted pH$_F$, omits this consideration and focuses solely on [H$^+$]$_F$, in principle making it a simpler representation of hydrogen ion concentration. Only [H$^+$]$_T$ can be determined, therefore [H$^+$]$_F$ must be estimated using the [SO$^{2−}$ $_4$] and the stability constant of HSO$^−$ $_4$, K$^*$ $_S$:
    [H$^+$]$_F$ = [H$^+$]$_T$ − [HSO$^−$ $_4$] = [H$^+$]$_T$ ( 1 + [SO$^{2−}$ $_4$] / K$^*$ $_S$ )$^{−1}$
However, it is difficult to estimate K$^*$ $_S$ in seawater, limiting the utility of the otherwise more straightforward free scale.
Another scale, known as the seawater scale, often denoted pH$_{SWS}$, takes account of a further protonation relationship between hydrogen ions and fluoride ions, H$^+$ + F$^−$ ⇌ HF. Resulting in the following expression for [H$^+$]$_{SWS}$:
    [H$^+$]$_{SWS}$ = [H$^+$]$_F$ + [HSO$^−$ $_4$] + [HF]
However, the advantage of considering this additional complexity is dependent upon the abundance of fluoride in the medium. In seawater, for instance, sulfate ions occur at much greater concentrations (> 400 times) than those of fluoride. As a consequence, for most practical purposes, the difference between the total and seawater scales is very small.
The following three equations summarize the three scales of pH:
    pH$_F$ = −log$_{10}$[H$^+$]$_F$
    pH$_T$ = −log$_{10}$([H$^+$]$_F$ + [HSO$^−$ $_4$]) = −log$_{10}$[H$^+$]$_T$
    pH$_{SWS}$ = −log$_{10}$(H$^+$]$_F$ + [HSO$^−$ $_4$] + [HF]) = −log$_{10}$[v]$_{SWS}$

### pH in food

The pH level of food influences its flavor, texture, and shelf life. Acidic foods, such as citrus fruits, tomatoes, and vinegar, typically have a pH below 4.6 with sharp and tangy taste, while basic foods taste bitter or soapy. Maintaining the appropriate pH in foods is essential for preventing the growth of harmful microorganisms. The alkalinity of vegetables such as spinach and kale can also influence their texture and color during cooking. The pH also influences the Maillard reaction, which is responsible for the browning of food during cooking, impacting both flavor and appearance.

### pH of various body fluids

    pH of various body fluids Compartment pH Gastric acid1.5–3.5 Lysosomes4.5 Human skin4.7 Granules of chromaffin cells5.5 Urine6.0 Breast milk7.0–7.45 Cytosol7.2 Blood (natural pH)7.34–7.45 Cerebrospinal fluid (CSF)7.5 Mitochondrial matrix7.5 Pancreas secretions8.1
In living organisms, the pH of various body fluids, cellular compartments, and organs is tightly regulated to maintain a state of acid–base balance known as acid–base homeostasis. Acidosis, defined by blood pH below 7.35, is the most common disorder of acid–base homeostasis and occurs when there is an excess of acid in the body. In contrast, alkalosis is characterized by excessively high blood pH.
Blood pH is usually slightly alkaline, with a pH of 7.365, referred to as physiological pH in biology and medicine. Plaque formation in teeth can create a local acidic environment that results in tooth decay through demineralization. Enzymes and other Proteins have an optimal pH range for function and can become inactivated or denatured outside this range.

## pH calculations

When calculating the pH of a solution containing acids or bases, a chemical speciation calculation is used to determine the concentration of all chemical species present in the solution. The complexity of the procedure depends on the nature of the solution. Strong acids and bases are compounds that are almost completely dissociated in water, which simplifies the calculation. However, for weak acids, a quadratic equation must be solved, and for weak bases, a cubic equation is required. In general, a set of non-linear simultaneous equations must be solved.
Water itself is a weak acid and a weak base, so its dissociation must be taken into account at high pH and low solute concentration (see Amphoterism). It dissociates according to the equilibrium
    2 H$_2$O ⇌ H$_3$O$^+$ (aq) + OH$^−$ (aq)
with a dissociation constant, K$_w$ defined as
    $K_{\text{w}}={\ce {[H+][OH^{-}]}}$
where [H$^+$] stands for the concentration of the aqueous hydronium ion and [OH$^−$] represents the concentration of the hydroxide ion. This equilibrium needs to be taken into account at high pH and when the solute concentration is extremely low.

### Strong acids and bases

Strong acids and bases are compounds that are essentially fully dissociated in water. This means that in an acidic solution, the concentration of hydrogen ions (H$^+$) can be considered equal to the concentration of the acid. Similarly, in a basic solution, the concentration of hydroxide ions (OH$^−$) can be considered equal to the concentration of the base. The pH of a solution is defined as the negative logarithm of the concentration of H$^+$, and the pOH is defined as the negative logarithm of the concentration of OH$^−$. For example, the pH of a 0.01 in moles per litreM solution of hydrochloric acid (HCl) is equal to 2 (pH = −log$_{10}$(0.01)), while the pOH of a 0.01 M solution of sodium hydroxide (NaOH) is equal to 2 (pOH = −log$_{10}$(0.01)), which corresponds to a pH of about 12.
However, self-ionization of water must also be considered when concentrations of a strong acid or base is very low or high. For instance, a 5×10$^{−8}$ M solution of HCl would be expected to have a pH of 7.3 based on the above procedure, which is incorrect as it is acidic and should have a pH of less than 7. In such cases, the system can be treated as a mixture of the acid or base and water, which is an amphoteric substance. By accounting for the self-ionization of water, the true pH of the solution can be calculated. For example, a 5×10$^{−8}$ M solution of HCl would have a pH of 6.89 when treated as a mixture of HCl and water. The self-ionization equilibrium of solutions of sodium hydroxide at higher concentrations must also be considered.

### Weak acids and bases

A weak acid or the conjugate acid of a weak base can be treated using the same formalism.
* Acid HA: HA ⇌ H$^+$ + A$^−$
* Base A: HA$^+$ ⇌ H$^+$ + A
First, an acid dissociation constant is defined as follows. Electrical charges are omitted from subsequent equations for the sake of generality
    $K_{a}={\frac {{\ce {[H] [A]}}}{{\ce {[HA]}}}}$
and its value is assumed to have been determined by experiment. This being so, there are three unknown concentrations, [HA], [H$^+$] and [A$^−$] to determine by calculation. Two additional equations are needed. One way to provide them is to apply the law of mass conservation in terms of the two "reagents" H and A.
    $C_{{\ce {A}}}={\ce {[A]}}+{\ce {[HA]}}$
    $C_{{\ce {H}}}={\ce {[H]}}+{\ce {[HA]}}$
C stands for analytical concentration. In some texts, one mass balance equation is replaced by an equation of charge balance. This is satisfactory for simple cases like this one, but is more difficult to apply to more complicated cases as those below. Together with the equation defining K$_a$, there are now three equations in three unknowns. When an acid is dissolved in water C$_A$ = C$_H$ = C$_a$, the concentration of the acid, so [A] = [H]. After some further algebraic manipulation an equation in the hydrogen ion concentration may be obtained.
    $[{\ce {H}}]^{2}+K_{a}[{\ce {H}}]-K_{a}C_{a}=0$
Solution of this quadratic equation gives the hydrogen ion concentration and hence p[H] or, more loosely, pH. This procedure is illustrated in an ICE table which can also be used to calculate the pH when some additional (strong) acid or alkaline has been added to the system, that is, when C$_A$ ≠ C$_H$.
For example, what is the pH of a 0.01 M solution of benzoic acid, pK$_a$ = 4.19?
* Step 1: $K_{a}=10^{-4.19}=6.46\times 10^{-5}$
* Step 2: Set up the quadratic equation. $[{\ce {H}}]^{2}+6.46\times 10^{-5}[{\ce {H}}]-6.46\times 10^{-7}=0$
* Step 3: Solve the quadratic equation. $[{\ce {H+}}]=7.74\times 10^{-4};\quad \mathrm {pH} =3.11$
For alkaline solutions, an additional term is added to the mass-balance equation for hydrogen. Since the addition of hydroxide reduces the hydrogen ion concentration, and the hydroxide ion concentration is constrained by the self-ionization equilibrium to be equal to ${\frac {K_{w}}{{\ce {[H+]}}}}$, the resulting equation is:
    $C_{\ce {H}}={\frac {[{\ce {H}}]+[{\ce {HA}}]-K_{w}}{\ce {[H]}}}$

### General method

Some systems, such as with polyprotic acids, are amenable to spreadsheet calculations. With three or more reagents or when many complexes are formed with general formulae such as A$_p$B$_q$H$_r$, the following general method can be used to calculate the pH of a solution. For example, with three reagents, each equilibrium is characterized by an equilibrium constant, β.
    $[{\ce {A}}_{p}{\ce {B}}_{q}{\ce {H}}_{r}]=\beta _{pqr}[{\ce {A}}]^{p}[{\ce {B}}]^{q}[{\ce {H}}]^{r}$
Next, write down the mass-balance equations for each reagent:
    ${\begin{aligned}C_{\ce {A}}&=[{\ce {A}}]+\Sigma p\beta _{pqr}[{\ce {A}}]^{p}[{\ce {B}}]^{q}[{\ce {H}}]^{r}\\C_{\ce {B}}&=[{\ce {B}}]+\Sigma q\beta _{pqr}[{\ce {A}}]^{p}[{\ce {B}}]^{q}[{\ce {H}}]^{r}\\C_{\ce {H}}&=[{\ce {H}}]+\Sigma r\beta _{pqr}[{\ce {A}}]^{p}[{\ce {B}}]^{q}[{\ce {H}}]^{r}-K_{w}[{\ce {H}}]^{-1}\end{aligned}}$
There are no approximations involved in these equations, except that each stability constant is defined as a quotient of concentrations, not activities. Much more complicated expressions are required if activities are to be used.
There are three simultaneous equations in the three unknowns, [A], [B] and [H]. Because the equations are non-linear and their concentrations may range over many powers of 10, the solution of these equations is not straightforward. However, many computer programs are available which can be used to perform these calculations. There may be more than three reagents. The calculation of hydrogen ion concentrations, using this approach, is a key element in the determination of equilibrium constants by potentiometric titration.