If I remember correctly, there were several interesting claims made in lecture:

strong acids dissociate fully, for weak acids we use a pKa value

and

in polyprotic weak acids, such as H3PO4, we can ignore the dissociation on every stage but the first one.

I actually see no benefit in all these shenanigans with making different rules for strong and weak acids and then having so many special cases. In reality, every acid, weak or strong, reacts with water in a reversible reaction:

$HA+HX_{2}O AX_{−}+HX_{3}OX_{+}(1)$which can be characterized by an equilibrium constant or by $K_{a}$. It’s just that if an acid has a very small pKa, such as $−2$, as you can verify here, the fraction of acid that reacts is essentially 1. Meaning that $[AX_{−}]=[HX_{3}OX_{+}]≈c_{0}$.

Can we ignore the second and third stages of H3PO4 dissociation? Yes, if we’re in a medium with $pH<4$. But not in general. As you can notice, the pseudo-rules above are nothing but special cases or just some observations which are true in certain conditions. In this note, I’ll show you that pH can be calculated without these pseudo-random assumptions.

## Overview

We’ll proceed in several steps:

- First, I’ll introduce a general framework for solving literally any problem that has to do with pH
- I’ll show you that it leads to the same result for monoprotic acids as using the accounting table (or ICE table, if you prefer)
- I’ll show you how it can be easily extended to diprotic acids (we’ll find exact pH of H2SO4)
- I will show you another benefit of the general framework (the extension of ionization extent $α$)
- I’ll show you how with 4 you can easily tackle even triprotic acids (such as H3PO4)

## 1. The Framework for Solving Any Problem

- Write the chemical equation for every process that occurs in your system.
- Write the equilibrium constant for every process above
- Write the equation for the mass balance constraint
- Write the equation for the electroneutrality constraint

The first two are self-explanatory, let’s elaborate on 3rd and 4th step.

### Mass Balance Constraint

Matter cannot spontaneously come into existence from the void nor can it similarly disappear. As a result, if we, say, initially had some acid $[HA]=c_{0}$ in exclusively protonated form, post deprotonation, the total amount of atoms composing $A$ is unchanged. Once we reach equilibrium, $A$ is stored in two forms: $HA$ and $AX_{−}$. Mass balance constraint says that the sum of these concentrations must be equal to $c_{0}$:

$[HA]+[AX_{−}]=c_{0}(2)$### Electroneutrality Constraint

The absolute majority of matter in its stable (read: commonly occurring form) is electrically neutral. This is a fundamental principle that you use to write molecular formula of different compounds. When you try to write the formula for iron oxide, $FeX_{3+}OX_{2−}$ you argue that the molecule has to be neutral, so for every 2 atoms of iron, you must have 3 atoms of oxygen $FeX_{2}OX_{3}$. Similar electroneutrality can be applied to solutions: the sum total of negatively charged ions should be equal to the sum total of positively charged ions.

You could also think of electroneutrality as a “charge balance equation” (allusion to the mass balance above). This approach also helps to understand why we must multiply the concentration of an ion by the magnitude of its charge. For example, in a solution of $HX_{2}SOX_{4}$, you can have the following ions: $HX_{3}OX_{+},HSOX_{4}X_{−},SOX_{4}X_{2−}$. Charge balance says:

$[HX_{3}OX_{+}]=[HSOX_{4}X_{−}]+2[SOX_{4}X_{2−}](3)$This may seem a bit unintuitive at first, at least that was my experience, but think about it as counting total charge on the left and on the right. Every $SOX_{4}X_{2−}$ brings two charges, so the total quantity of negative charge is double the concentration of $SOX_{4}X_{2−}$.

## 2. Monoprotic Acids

Let’s see how the framework above can be applied to monoprotic acids. First, we write the chemical equation for every equilibrium in the mixture. In this case, we only have proton transfer with water:

$HA+HX_{2}O AX_{−}+HX_{3}OX_{+}(1)$As a result, in the solution you might have $HA,AX_{−},HX_{3}OX_{+}$.

Second, we write the equilibrium constant for that process:

$K_{a}=[HA][AX_{−}][HX_{3}OX_{+}] (4)$Third, we write material balance:

$[HA]+[AX_{−}]=c_{0}(2)$and electric neutrality:

$[AX_{−}]=[HX_{3}OX_{+}](5)$We presume $K_{a}$ and $c_{0}$ is known. Then, we have 3 equations (2, 4, 5) and 3 unknowns: $[HX_{3}OX_{+}],[HA],[AX_{−}]$. The solution then exists and is unique. We can substitute (5) into (2):

$[HA]+[HX_{3}OX_{+}]=c_{0}⟹[HA]=c_{0}−[HX_{3}OX_{+}](6)$and then (6) into (4):

$K_{a}=c_{0}−[HX_{3}OX_{+}][HX_{3}OX_{+}]_{2} (7)$Resulting in an equation with just one unknown. Remarkably, this is identical to the result we obtained before using stoichiometric accounting approach. Let’s state, for completeness, that the solution to quadratic equation (7) is:

$[HX_{3}OX_{+}]=2−K_{a}+K_{a}+4K_{a}c_{0} $## 3. Diprotic Acids. H2SO4.

The beauty of the framework presented is that it can be easily extended to any acid. I can imagine you could write out the stoichiometry for polyprotic acids as well, but I think the calculation becomes significantly more difficult.

First, writing chemical equations of every process:

$HX_{2}SOX_{4}+HX_{2}OHSOX_{4}X_{−}+HX_{2}O HSOX_{4}X_{−}+HX_{3}OX_{+} SOX_{4}X_{2−}+HX_{3}OX_{+} (8)(9) $Then writing equilibrium constants:

$K_{a1}K_{a2} =[HX_{2}SOX_{4}][HSOX_{4}X_{−}][HX_{3}OX_{+}] =[HSOX_{4}X_{−}][SOX_{4}X_{2−}][HX_{3}OX_{+}] (10)(11) $Mass balance:

$c_{0}=[HX_{2}SOX_{4}]+[HSOX_{4}X_{−}]+[SOX_{4}X_{2−}](12)$And electroneutrality:

$[HX_{3}OX_{+}]=[HSOX_{4}X_{−}]+2[SOX_{4}X_{2−}](13)$### Analytical Solution

Now, let’s express $[HX_{2}SOX_{4}]$ from (10) and $[SOX_{4}X_{2−}]$ from (11) and plug that into (12):

$c_{0}c_{0}c_{0}[HSOX_{4}X_{−}] =K_{a1}[HSOX_{4}X_{−}][HX_{3}OX_{+}] +[HSOX_{4}X_{−}]+[HX_{3}OX_{+}]K_{a2}[HSOX_{4}X_{−}] =[HSOX_{4}X_{−}](K_{a1}[HX_{3}OX_{+}] +1+[HX_{3}OX_{+}]K_{a2} )=[HSOX_{4}X_{−}](K_{a1}[HX_{3}OX_{+}][HX_{3}OX_{+}]_{2}+K_{a1}[HX_{3}OX_{+}]+K_{a1}K_{a2} )=[HX_{3}OX_{+}]_{2}+K_{a1}[HX_{3}OX_{+}]+K_{a1}K_{a2}K_{a1}[HX_{3}OX_{+}] c_{0} (14) $You might see now that the choice of what to express and plug was done so that at the end we would be able to express $[HSOX_{4}X_{−}]$ as a function of $K_{a1},K_{a2},c_{0}$ which are known and $[HX_{3}OX_{+}]$. You might see that if we were to succeed with repeating this for $[SOX_{4}X_{2−}]$, we could plug everything into (13) and have one equation with one unknown: $[HX_{3}OX_{+}]$. This is the plan.

Let’s multiply both sides of (10) by (11):

$K_{a1}K_{a2}=[HX_{2}SOX_{4}][SOX_{4}X_{2−}][HX_{3}OX_{+}]_{2} (15)$Let’s express $[HX_{2}SOX_{4}]$ from (15) and $[HSOX_{4}X_{−}]$ from (11) and plug that into (12):

$c_{0}c_{0}c_{0}[SOX_{4}X_{2−}] =K_{a1}K_{a2}[SOX_{4}X_{2−}][HX_{3}OX_{+}]_{2} +K_{a2}[SOX_{4}X_{2−}][HX_{3}OX_{+}] +[SOX_{4}X_{2−}]=[SOX_{4}X_{2−}](K_{a1}K_{a2}[HX_{3}OX_{+}]_{2} +K_{a2}[HX_{3}OX_{+}] +1)=[SOX_{4}X_{2−}](K_{a1}K_{a2}[HX_{3}OX_{+}]_{2}+K_{a1}[HX_{3}O]+K_{a1}K_{a2} )=[HX_{3}OX_{+}]_{2}+K_{a1}[HX_{3}O]+K_{a1}K_{a2}K_{a1}K_{a2} c_{0} (16) $Okay, now let’s take the result of (14) and (16) and plug that into (13):

$[HX_{3}OX_{+}][HX_{3}OX_{+}] =[HSOX_{4}X_{−}]+2[SOX_{4}X_{2−}]=[HX_{3}OX_{+}]_{2}+K_{a1}[HX_{3}OX_{+}]+K_{a1}K_{a2}K_{a1}[HX_{3}OX_{+}] c_{0}+[HX_{3}OX_{+}]_{2}+K_{a1}[HX_{3}O]+K_{a1}K_{a2}2K_{a1}K_{a2} c_{0} $Which leads us to:

$[HX_{3}OX_{+}]_{3}+K_{a1}[HX_{3}OX_{+}]_{2}+K_{a1}K_{a2}[HX_{3}OX_{+}]=K_{a1}[HX_{3}OX_{+}]c_{0}+2K_{a1}K_{a2}c_{0}$or:

$[HX_{3}OX_{+}]_{3}+K_{a1}[HX_{3}OX_{+}]_{2}+(K_{a1}K_{a2}−K_{a1}c_{0})[HX_{3}OX_{+}]−2K_{a1}K_{a2}c_{0}=0(17)$which is a cubic polynomial. Cubic polynomials are not as easy to solve as quadratic ones, but it’s actually still doable. See this primer if you’re curious how.

### Is it worth it?

We need to make a few comments regarding derivation above. Looking at the derivation above, it’s tempting to think: maybe it’s worth having some arbitrary empirical rules on strong/weak acids if it allows to avoid doing the manipulations above. I actually think that doing derivations like above is the very reason why everyone should take a STEM course.

Let me explain. I’ve said this multiple times already, but learning science is not just limited to learning what is an acid or how to calculate a pH or an equilibrium constant. The ability to do that does determine your grade, yes, but what’s orders of magnitude more important is a) the thinking skills you develop in the process and b) the abstractions and lessons you take on how to approach problem-solving in general. The derivation above is a good way for those thinking skills to develop. Besides, there’s a very important lesson you learn in the process.

You might wonder: how could have I known that I should express $[HX_{2}SOX_{4}]$ from (10) and $[SOX_{4}X_{2−}]$ from (11) and plug that into (12)? You couldn’t. A good exercise is to start from (10)-(13) and then, not looking at these notes, somehow derive (14). I think it’s impossible to achieve that by simply staring at the equations (10)-(13) and (14). You have to try and do something. Maybe first express $[HX_{3}OX_{+}]$. Does it bring you closer to the desired result? No? Let’s do something different. Let’s try to express $HSOX_{4}X_{−}$. Does it help? It’s an inherently iterative process which leads to dead ends most of the time. With time, you might start noticing certain patterns, which allow you to make certain shortcuts. With even more time, you might be able to start doing these shortcuts in your head. Which is really how I wrote the derivation above (I didn’t consult any notes in deriving it, fyi). The first time I’ve tried to derive (14) or (16), I think I spent at least 2 or 3 hours doing random substitutions ending in a trivial result (such as $K_{a1}=K_{a1}$) 99% of the time. You might wonder: is it a good way to spend 2 or 3 hours? Experiences like that, I think, are the primary reason why I have the confidence that I can tackle any problem I face. I just need to try different things and not expect to get it right from the first attempt. So if you think having that confidence is good, then it’s a very good way to spend 2 or 3 hours.

## Yet Another Chance for Python to Shine

when we discussed bringing equations to linear form many moons ago, I argued that Python is one of the most useful tools you might add to your arsenal. Here’s another demonstration of that claim. Let’s verify (14) and (16) using Python:

The solution it finds is:

Which is exactly (14) and (16)! Just fyi, raising a number to some power in Python is denoted by two asterisks `**`

. That is `3**2`

denotes $3_{2}$. It also shows an expression of H2SO4 which we haven’t derived yet, but will do that in the next section.

We can substitute these into equation 4 and try to simplify:

Which gives us: Ugh, it doesn’t bring it to the polynomial form. If we want to enforce it, we could ask it to simplify the multiplication

Which gives us which is (17) exactly. Since we’re here, we can ask it to find pH of 0.1 M $HX_{2}SOX_{4}$ for which pK$_{a1}=−2.8$, and pK$_{a2}=1.99$:

Which gives us:

The I stands for the imaginary $i$ (from complex numbers), but 0e-23 is 0, so all roots are real. If we take the negative log of it, we find that pH is equal to 0.9642. Which is essentially identical to the solution you obtain if you were to assume that dissociation occurs completely for the first stage.

You could also simply plug the values into (17) and feed it into WolframAlpha:

$x_{3}+10_{2.8}x_{2}+(10_{0.81}−10_{2.8}∗0.1)x−2∗10_{0.81}∗0.1=0$Good!

## 4. Extending Extent of Dissociation

When we discussed Arrhenius theory, we often used a metric $α$ to show what fraction of an acid dissociates into $AX_{−}$. This metric can be extended to polyprotic acids. Let’s define $α$ to be the fraction of the acid that exists in a given form:

$α_{HA}=c_{0}[HA] α_{AX_{−}}=c_{0}[AX_{−}] (18)$and similarly for a diprotic acid:

$α_{HX_{2}A}=c_{0}[HX_{2}A] α_{HAX_{−}}=c_{0}[HAX_{−}] α_{AX_{2−}}=c_{0}[AX_{2−}] (19)$If you look at (14) and (16), you might notice that we have everything we need to express two of these alphas!

$α_{HSOX_{4}X_{−}}=c_{0}[HSOX_{4}X_{−}] =[HX_{3}OX_{+}]_{2}+K_{a1}[HX_{3}OX_{+}]+K_{a1}K_{a2}K_{a1}[HX_{3}OX_{+}] (20)$and

$α_{SOX_{4}X_{2−}}=c_{0}[SOX_{4}X_{2−}] =[HX_{3}OX_{+}]_{2}+K_{a1}[HX_{3}O]+K_{a1}K_{a2}K_{a1}K_{a2} (21)$Equations (20) and (21) allow us to determine the fraction of an acid that will be present in the form of $HAX_{−}$ and $AX_{2−}$ at any given pH

For completeness, let’s try to express $α_{HX_{2}SOX_{4}}$. To do that, we need to express $[HSOX_{4}X_{−}]$ from (10) and $[SOX_{4}X_{2−}]$ from (14) and plug that into (12):

$c_{0}c_{0}c_{0}α_{HX_{2}SOX_{4}} =[HX_{2}SOX_{4}]+[HX_{3}OX_{+}]K_{a1}[HX_{2}SOX_{4}] +[HX_{3}OX_{+}]_{2}K_{a1}K_{a2}[HX_{2}SOX_{4}] =[HX_{2}SOX_{4}](1+[HX_{3}OX_{+}]K_{a1} +[HX_{3}OX_{+}]_{2}K_{a1}K_{a2} )=[HX_{2}SOX_{4}]([HX_{3}OX_{+}]_{2}[HX_{3}OX_{+}]_{2}+K_{a1}[HX_{3}OX_{+}]+K_{a1}K_{a2} )=c_{0}[HX_{2}SOX_{4}] =[HX_{3}OX_{+}]_{2}+K_{a1}[HX_{3}OX_{+}]+K_{a1}K_{a2}[HX_{3}OX_{+}]_{2} (22) $If you wonder how do these alphas look like at different pH and at different pKa values, check out this page

### Expressing Alpha for Monoprotic Acid

Let’s try an express alphas in a similar manner for a monoprotic acid. Recall the expression for the equilibrium constant:

$K_{a}=[HA][AX_{−}][HX_{3}OX_{+}] (4)$and the equation of material balance:

$[HA]+[AX_{−}]=c_{0}(2)$Let’s express $[HA]$ from (4) and plug into (2):

$K_{a}[AX_{−}][HX_{3}OX_{+}] +[AX_{−}][AX_{−}](K_{a}[HX_{3}OX_{+}] +1)[AX_{−}](K_{a}[HX_{3}OX_{+}]+K_{a} )α_{AX_{−}} =c_{0}=c_{0}=c_{0}≡c_{0}[AX_{−}] =[HX_{3}OX_{+}]+K_{a}K_{a} (23) $if instead we express $[A$ from (4) and plug into (2):

$[HA]+[HX_{3}OX_{+}]K_{a}[HA] [HA](1+[HX_{3}OX_{+}]K_{a} )[HA]([HX_{3}OX_{+}][HX_{3}OX_{+}]+K_{a} )α_{HA} =c_{0}=c_{0}=c_{0}≡c_{0}[HA] =[HX_{3}OX_{+}]+K_{a}[HX_{3}OX_{+}] (24) $You may think that this alpha is different from the one we’ve seen before. After all, the formula we’ve obtained before was slightly different. Specifically, we had:

$α_{AX_{−}}=2c_{0}−K_{a}+K_{a}+4K_{a}c_{0} (25)$You can get to equation (25) from (23) if you recall that in the case of a monoprotic acid $[HX_{3}OX_{+}]=[AX_{−}]$ (which happens to coincide with electroneutrality constraint, so $α_{AX_{−}}c_{0}=[HX_{3}OX_{+}]$. As a result:

$α_{AX_{−}}=α_{AX_{−}}c_{0}+K_{a}K_{a} $You can see that this is an equation with one unknown, so you can solve it for $α_{AX_{−}}$ and get the expression (25).

## 5. Triprotic Acids

Let’s write out alphas for monoprotic and diprotic acids again:

$α_{HA}=[HX_{3}OX_{+}]+K_{a}[HX_{3}OX_{+}] α_{AX_{−}}=[HX_{3}OX_{+}]+K_{a}K_{a} $and

$α_{HX_{2}A}α_{HAX_{−}}α_{AX_{2−}} =[HX_{3}OX_{+}]_{2}+K_{a1}[HX_{3}OX_{+}]+K_{a1}K_{a2}[HX_{3}OX_{+}]_{2} =[HX_{3}OX_{+}]_{2}+K_{a1}[HX_{3}OX_{+}]+K_{a1}K_{a2}K_{a1}[HX_{3}OX_{+}] =[HX_{3}OX_{+}]_{2}+K_{a1}[HX_{3}OX_{+}]+K_{a1}K_{a2}K_{a1}K_{a2} $Do you notice any patterns?

I’m going to tell you what I see. Let’s look at alphas for diprotic acid first. The denominator is the same for all forms, and the numerator has some combination of $[HX_{3}OX_{+}],K_{a1},K_{a2}$. The fully protonated form with two protons has $[HX_{3}OX_{+}]$ raised to the power of two. The form with one proton which forms in the first dissociation has one $[HX_{3}OX_{+}]$ and one $K_{a1}$. The form that results from two dissociations according to $K_{a1}$ and $K_{a2}$ has both of those in the numerator. So it appears as if the general rule is: start with fully protonated form and use $[HX_{3}OX_{+}]$ to the power of the number of hydrogens in that form. Then, to get an alpha for each successive form, remove one from the power of $[HX_{3}OX_{+}]$ and multiply by the $K_{a}$ of each stage.

Will you be surprised if I tell you that if you do all the steps: write expressions for $K_{a1},K_{a2},K_{a3}$ for a triprotic acid, write the material balance constraint, do some manipulations, you’ll get:

$α_{HX_{3}A}α_{HX_{2}AX_{−}}α_{HAX_{2−}}α_{AX_{3−}} =[HX_{3}OX_{+}]_{3}+K_{a1}[HX_{3}OX_{+}]_{2}+K_{a1}K_{a2}[HX_{3}OX_{+}]+K_{a1}K_{a2}K_{a3}[HX_{3}OX_{+}]_{3} =[HX_{3}OX_{+}]_{3}+K_{a1}[HX_{3}OX_{+}]_{2}+K_{a1}K_{a2}[HX_{3}OX_{+}]+K_{a1}K_{a2}K_{a3}K_{a1}[HX_{3}OX_{+}]_{2} =[HX_{3}OX_{+}]_{3}+K_{a1}[HX_{3}OX_{+}]_{2}+K_{a1}K_{a2}[HX_{3}OX_{+}]+K_{a1}K_{a2}K_{a3}K_{a1}K_{a2}[HX_{3}OX_{+}] =[HX_{3}OX_{+}]_{3}+K_{a1}[HX_{3}OX_{+}]_{2}+K_{a1}K_{a2}[HX_{3}OX_{+}]+K_{a1}K_{a2}K_{a3}K_{a1}K_{a2}K_{a3} $Nice, isn’t it? You could verify by doing the derivation or using sympy, if you want. If you’d like to find pH of the triprotic acid, you could write the electric neutrality:

$[HX_{3}OX_{+}]=[HX_{2}AX_{−}]+2[HAX_{2−}]+3[AX_{3−}]$Because alphas depend only on the Ka’s, which are known, you can get concentrations of every form in the right hand side by multiplying by $c_{0}$, which is also known. All you’ll have to do is to solve a polynomial of the 4th degree. Which is very impractical to do by hand, but a WolframAlpha or SymPy can do that for you quite happily!