Journal of Chemical Education, submitted (2002) NUMERICAL ANALYSIS OF AQUEOUS EQUILIBRIA FOR MONOPROTIC ACID SOLUTIONS Stephen L. Morgan*, Michael D. Walla, and Thomas H. Richardson1 Department of Chemistry & Biochemistry The University of South Carolina Columbia, SC 29208 ______________________________________________________________________________ * Author to whom correspondence should be addressed: Phone: (803) 777-2461; FAX: (803) 777-9521. Email: [email protected] 1 Current address: Marian College, 45 S. National Ave., Fond du Lac, WI 54935 Page 2 Calculating the hydrogen ion concentration for aqueous solutions of weak acids or bases is a problem presented early in undergraduate chemical education and encountered frequently in many areas of chemistry. With rigorous derivations, the inherent complexity of combined expressions for electroneutrality, mass balance, and equilibrium constants is sometimes overwhelming. Taught approximate solution methods for aqueous equilibria, however, students often lack an appreciation for the nature of simplifying assumptions and their associated ranges of validity. Chemical educators recognized these difficulties some time ago (1,2) and several texts contributed to the understanding of aqueous equilibria (3-5). Continued interest in accurate estimation of hydrogen ion concentration has resulted in the use of approximate methods closely coupled to an awareness of the assumptions used to simplify exact expressions (6-9). The purpose of this article is to review the adequacy of numerical methods for solving monoprotic acid-base equilibria problems and to demonstrate some graphical techniques for visualizing the relationships involved. Mathematical expressions described here also apply to solutions of weak bases by substituting hydroxide for hydrogen ion concentration and base dissociation for acid dissociation constants. Activity corrections are neglected. Finally, it is important to heed the caution that the accuracy of pH calculations may often be limited by the precision of equilibrium constants (4,10). Initial Conditions for Determining the pH of a Monoprotic Acid Solution Given a volume of pure water to which a monoprotic acid has been added, we desire to calculate the hydrogen ion concentration ([H+]) or, more commonly, the pH (-log10[H+]). Once the Page 3 hydrogen ion concentration is known, the concentrations of all other species can be calculated. The initial concentration of the acid, Ca = (moles of acid ) (total volume, liters) (1) is usually called the analytical, or formal, concentration. - The dissociation of the monoprotic acid (HA) to give hydrogen ion (H+) and conjugate base (A ) is conventionally shown as HA (aq.) ' H + (aq.) + A − (aq.) (2) with the related equilibrium constant, Ka, equal to: H + A − Ka = [HA] (3) The square brackets in the above equation represent equilibrium concentrations in moles/liter. Besides the dissociation of the acid, we must consider the dissociation of water, H 2O(aq.) ' H + (aq.) + OH −(aq.) (4) for which the ion product constant, Kw, is: K w = H + OH − = 1× 10−14 (5) This value for the ion product constant is strictly only appropriate at 25°C, although it is commonly used without modification in acid-base calculations. Although our primary interest is hydrogen ion concentration, there are four unknown concentrations to be determined: [HA], [A-], [OH-], and [H+]. To solve for these four unknowns Page 4 we must have four simultaneous and independent equations that relate unknown to known quantities. The first of these four equations is the equilibrium constant expression (Equation 3), and the second is the ion product constant expression for water (Equation 5). The third equation is the mass balance relating the analytical concentration of the acid (Ca) to the equilibrium concentrations of all its forms ([HA] and [A-]), Ca = [HA ] + A − (6) The fourth simultaneous equation is the charge balance, H + = A − + OH − (7) which states that the total number of positively charged species must equal the total number of negatively charged species. A simple exact solution to this set of four simultaneous equations does not exist. The rigorous exact solution requires finding the root of a third-order polynomial equation. Various assumptions are often made to obtain simpler, more readily solved, equations. The four usual approximations commonly derived are shown in Table 1. Page 5 Table 1. Summary of usual approximation methods. Approximation Strong acid Resulting equation Ca + Ca2 + 4 K w H + = 2 Simple weak acid H + = K C a a Very weak acid H + = K C + K a a w Weak acid − K a + K a2 + 4 K a Ca H + = 2 Page 6 Exact Solution for the pH of a Monoprotic Acid Solution Equations 3, 5, 6, and 7 may be manipulated to give a single equation describing the exact relationship between the hydrogen ion concentration and the known quantities (Ka, Kw, and Ca). Starting with Equation 7 and rearranging, A − = H + − OH − (8) Substituting Equation 8 into Equation 6 and solving for [HA] yields [HA] = Ca − H + + OH − (9) Equations 8 and 9 may be substituted into Equation 3 to give H + H + − OH − Ka = C − H + + OH − a (10) Using Equation 5, OH − = K w + H (11) [OH-] is eliminated from Equation 10, H + H + − K H + w Ka = C − H + + K H + a w (12) which rearranges to a cubic equation in [H+], 3 2 H + + K H + − K + K C H + − K K a a a a w =0 w (13) Page 7 Equation 13 is the desired exact relationship, neglecting activity corrections, between the unknown hydrogen ion concentration and the known quantities. Although a cubic equation has three roots, only one of these will correspond to a chemically realistic answer; all other solutions to the equation are ignored. Numerical iterative techniques are commonly used to find roots for general polynomial equations. These methods converge to successively better approximations of the exact solution. One of these techniques, the NewtonRaphson method, is particularly suitable for the solution of Equation 13. In this section, we present the results of these pH calculations and postpone a detailed description of the algorithm until a later section. The pH of an aqueous solution of monoprotic acid is displayed as a function of pKa and pCa in Figure 1. These plots were generated by solving, using the Newton-Raphson method, for the exact roots of the cubic equation over the range of variables shown. Naturally, pCa represents -log10(Ca) and pKa represents -log10(Ka). Small values of pCa imply high analytical concentrations of acid, and high values of pCa imply low concentrations. Similarly, small pKa values mean high values of Ka (strong acids), and high pKa values mean low Ka values (weak acids). The pH surface of Figure 1A describes the relationship between the pKa of an acid, the analytical concentration (given as pCa), and the pH of the resulting aqueous solution. Concentrated solutions of strong acids give acidic solution of low pH (front left corner of the plot), and dilute solutions or solutions of weaker acids give progressively higher pH values, leveling off at pH 7. To display the same relationships more quantitatively, a topographical contour plot is convenient. The contours in Figure 1B represent those combinations of pKa and Page 8 pCa that give equal pH values. For example, the contour line labeled "5" connects all the points that result in a pH of 5. Because the pH never actually reaches 7, no contour can be drawn for that level. Figure 1B may be used to estimate pH for a monoprotic acid solution of specified concentration and dissociation constant. For example, an aqueous solution of formic acid, pKa = 3.75, with an analytical concentration of 0.01 M (pCa = 2) is estimated to have a pH of 2.9. Figures 1A and 1B are concise graphical summaries of the exact solutions to Equation 13 and can be used as a standard against which to judge the adequacy of approximations. Page 9 Figure 1. Solution pH as a function of pKa and pCa determined by solving the rigorous expression (Equation 13) for a monoprotic acid: (A) three-dimensional surface; (B) contour plot. Page 10 Approximations The strong acid approximation assumes complete dissociation of the acid, HA, into H+ and A([HA] << [A-]). This assumption simplifies Equation 6, which becomes Ca = A − (14) Substitution of Equation 11 and 14 into the charge balance (Equation 7) gives H + = C + K H + w a (15) which is rearranged to give a quadratic equation in [H+]: 2 H + − C H + − K = 0 a w (16) There are two roots to this equation, given by the quadratic formula (for ax2 + bx + c = 0, the two roots are given by x = − b ± b 2 − 4ac 2a ). The chemically meaningful root is always given by the positive square root: Ca + Ca2 + 4 K w H + = 2 (17) Figure 2 shows the three-dimensional plot and contour map of the pH surface predicted by the strong acid approximation as function of pKa and pCa. The contour lines parallel to the pKa axis reveal the nature of the approximation. The value of pKa has to no effect on the pH; Ka does not appear in Equation 17. At high concentrations (i.e., low pCa), the hydrogen ion concentration contributed by the dissociation of water is negligible and the 4 Kw term can be neglected in comparison to Ca2 in Equation 17. Thus, at low pCa levels in Figure 3, pH is equal to pCa. Page 11 However, as pCa approaches 7, the dissociation of water becomes significant. The strong acid approximation never exceeds pH 7 as the concentration of acid decreases below 10-7 M. The strong acid approximation can be expected to be in error when applied to a weak acid that does not completely dissociate. Figure 3 shows the difference between the strong acid approximation (Figure 2B) and the exact pH (Figure 1B ) plotted as an error contour. The strong acid approximation is adequate only for strong acids (low pKa) in dilute solutions (high pCa). Page 12 Figure 2. Solution pH as a function of pKa and pCa determined by the strong acid approximation (Equation 17) for a monoprotic acid: (A) three-dimensional surface; (B) contour plot. Page 13 Figure 3. Error in pH as a function of pKa and pCa for the strong acid approximation (Equation 17) for a monoprotic acid: (A) three-dimensional surface; (B) contour plot. Page 14 While the strong acid approximation assumes complete dissociation (a large value for Ka), the next three approximations are intended for weak acids with smaller values of Ka. The simple weak acid approximation starts with the dissociation constant, H + A − Ka = [HA] (18) Two assumptions remove the unknown terms, [A-] and [HA]. The first assumption is that most of the hydrogen ions come from dissociation of the acid and the contribution from water is neglected; equivalently, [A-] >> [OH-]. Equation 7 reduces to H + = A − (19) The second assumption states that most of the acid remains in the undissociated form ([HA] >> [A-]) and Equation 6 becomes Ca = [HA ] (20) This equation is complementary to Equation 14. Substituting Equations 19 and 20 into Equation 18 yields the simple weak acid approximation, H + H + Ka = Ca (21) from which an equation for [H+] is derived: H + = K C a a (22) Page 15 Figure 4 presents the pH surface and contour plots for this approximation. The fact that the contours are straight, equally spaced lines, can be easily seen by rewriting Equation 22 in the logarithmic form, pH = (pK a + pCa ) 2 (23) Comparison of Figures 4 and 2 shows that, unlike the strong acid approximation, the simple weak acid approximation shows an effect due to the pKa. As pKa increases (weaker acid), the pH increases (less acidic). Problems with this approximation are most notable where pH greater than 7 is predicted. Obviously, one cannot make pure water basic by adding an acid, no matter how weak. Figure 5 shows the error surface obtained by subtracting the exact solution (Figure 1) from the simple weak acid approximation (Figure 4). The positive deviations (positive meaning that the pH predicted by the approximation was larger than the exact solution) at high pKa and high pCa are due to the neglect of the dissociation of water. In deriving the simple weak acid approximation, [HA] was assumed to be equal to the analytical concentration of the acid (Equation 20). For strong acids, especially in dilute solutions, this assumption is not valid and the value assumed for [HA] will be too large. This failure results in predictions that are too acidic. The negative values in Figure 5 show the regions where this occurs. The simple weak acid approximation of Equation 22 is improved by removing either of the two assumptions made in its derivation. Page 16 Figure 4. Solution pH as a function of pKa and pCa determined by the simple weak acid approximation (Equation 22) for a monoprotic acid: (A) three-dimensional surface; (B) contour plot. Page 17 Figure 5. Error in pH as a function of pKa and pCa for the simple weak acid approximation (Equation 22) for a monoprotic acid: (A) three-dimensional surface; (B) contour plot. Page 18 The very weak acid approximation makes the single assumption that [HA] = Ca (Equation 20) and Equation 3 becomes H + A − Ka = Ca (24) Substitution of Equation 8 for [A-] yields H + H + − OH − Ka = Ca (25) Using Equation 5, [H+] [OH-] = Kw, this becomes + 2 H − K w Ka = Ca (26) which is solved to give: H + = K C + K a a w (27) The pH surface and contour plots for the very weak acid approximation (Figure 6) are similar to those of the simple weak acid approximation (Figure 4) except that, in Figure 6, the pH approaches but never exceeds 7. The absence of positive errors for the very weak acid approximation (Figure 7) reflects the correction of Equation 22 for the dissociation of water. As with Equation 22, Equation 27 fails to give correct answers for solutions of acids with low pKa values. Page 19 Figure 6. Solution pH as a function of pKa and pCa determined by the very weak acid approximation (Equation 27) for a monoprotic acid: (A) three-dimensional surface; (B) contour plot. Page 20 Figure 7. Error in pH as a function of pKa and pCa for the very weak acid approximation (Equation 27) for a monoprotic acid: (A) three-dimensional surface; (B) contour plot. Page 21 The weak acid approximation treats the case of an acid that undergoes appreciable, but not complete dissociation. Starting again with the equilibrium constant definition (Equation 18) and neglecting the dissociation of water (Equation 19), H + H + Ka = [HA] (28) Since Ka is known, only a value for [HA] is needed to be able to solve this equation for the hydrogen ion concentration. From Equation 6, [HA] = Ca − A − (29) With the assumption that [A-] = [H+], this becomes [HA] = Ca − H + (30) Substitution of Equation 31 into Equation 29 gives 2 H + Ka = C − H + a (31) which upon rearrangement yields the quadratic equation: 2 H + + K H + − K C = 0 a a a (32) As was the case with the strong acid approximation (Equation 17), there is only one chemically meaningful root for Equation 32: − K a + K a2 + 4 K a Ca H + = 2 (33) Page 22 The pH surface and contour plots and the error surface given by the weak acid approximation are shown in Figure 8 and 9. Like the simple weak acid approximation, the weak acid approximation erroneously predicts pH values above 7 in regions where the dissociation of water is significant but neglected. However, the weak acid approximation does very well for solutions of acids with low pKa values where the other approximations have difficulties. Equation 31 can be rearranged to a form suitable for iterative approximation, H + = K C − H + a a (34) which is similar in appearance to the simple weak acid approximation, given by Equation 22. Although [H+] appears on both sides of Equation 34, a solution can be obtained by successive approximation as follows: H + = K C a a 1 H + = K C − H + a a 2 1 … H + = K a Ca − H + n +1 n (35) Page 23 Figure 8. Solution pH as a function of pKa and pCa determined by the weak acid approximation (Equation 33) for a monoprotic acid: (A) three-dimensional surface; (B) contour plot. Page 24 Figure 9. Error in pH as a function of pKa and pCa for the weak acid approximation (Equation 33) for a monoprotic acid: (A) three-dimensional surface; (B) contour plot. Page 25 This procedure is iterated until there is no significant change in [H+] (i.e., [H+]n ≈ [H+]n+1). At that point, the value for [H+] will have converged to the solution given by Equation 34, the weak acid approximation. The initial estimate [H+]1 in Equation 35 is the simple weak acid approximation. Since the simple weak acid case is usually one of the first approximations taught in undergraduate chemistry, this iteration method (Equation 35) is a popular way to introduce improvements over the initial approximation. If the iteration method were to converge to the weak acid approximation, it would effectively transform the error contour of Figure 5 into that of Figure 9. Comparing Figures 4 and 8, there is no improvement made for the region of positive errors because water dissociation is neglected by both approximations. The region of negative errors in Figure 4 is where improvement can be made by using the weak acid instead of the simple weak acid approximation. Unfortunately, this iteration method encounters difficulty when pCa > pKa (or equivalently, when Ca < Ka) because [H+]1 in Equation 35 will be larger than Ca and the algorithm will try to take the square root of a negative number. A straight line (pCa = pKa) can be superimposed on Figure 4 to show that the requirement, pKa > pCa, severely limits the applicability of this iteration method. Modified iteration algorithms designed to cope with this difficulty converge slowly. Since Equation 33 is a straightforward solution that works over the entire region, there is little motivation for using the iteration method to obtain the weak acid approximation. In summary, the four approximations examined cover the variety of possible assumptions. Computer graphics helps in acquiring an understanding of acid-base chemistry and an appreciation of chemical intuition for simplifying problems. The error surfaces reveal regions of Page 26 acceptable performance for each approximation. Comparison of error contours enhances awareness of the range of validity of the assumptions and enables one to decide which of these four approximations is appropriate for a given situation. Although one or more of the approximations often predicts a pH close to the correct pH, a single approximation that works for all cases would be simpler to apply. Of the four pH contours shown (Figures 2, 4, 6, and 8), only the weak acid approximation (Figure 8) correctly shows the curvature of the exact pH surface (Figure 1). The only difference between Figures 1 and 8 is that the approximation continues to increase above pH 7, while the exact pH surface levels off asymptotically at pH 7. This observation suggests the following short algorithm: Calculate pH by the weak acid approximation, − K a + K a2 + 4 K a Ca H + = and pH = − log10 H + 2 If the calculated pH is greater than 7, replace the calculated pH with the value 7. Otherwise, use the calculated pH without change. (36) This single algorithm is easier to remember than the combination of four approximations and their associated ranges of validity. Figure 10 shows that the pH surface for this “best” weak acid algorithm closely follows that of the exact solution (Figure 1). The error (Figure 11) of this algorithm is small over the entire region. The largest error (0.2 pH units) occurs when a pH value of 7 is predicted for acids of pKa less than 6. If desired, one additional rule of thumb repairs this error: when the pCa is 6 or less and a pH of 7 is predicted, set the pH to 6.8. Page 27 Figure 10. Solution pH as a function of pKa and pCa determined by the “best” weak acid approximation (Equation 36) for a monoprotic acid: (A) three-dimensional surface; (B) contour plot. Page 28 Figure 11. Error in pH as a function of pKa and pCa for the “best” weak acid approximation (Equation 36) for a monoprotic acid: (A) three-dimensional surface; (B) contour plot. Page 29 For estimating pH of solutions of bases (given Kb, the base ionization constant, and Cb, the analytical concentration of the base), this algorithm becomes: Calculate pOH by the weak base approximation, − Kb + K 2 + 4 Kb Cb b OH − = 2 pOH = − log10 OH − and pH = 14 − pOH If the calculated pH is less than 7, replace the calculated pH with the value 7. Otherwise, use the calculated pH without change. (37) To improve the accuracy of pH calculations still further, let us return to the cubic relationship of Equation 13 and discuss methods for its exact solution. Solving the cubic equation by the Newton-Raphson method Numerical methods for finding the roots of functions are well established and documented both in the computing literature (11-14) and in chemistry (4,5,15). Techniques for solving polynomial equations in acid-base equilibria include fixed point iteration (5,16), segmented interval search (7, 16, 17), the regula falsi method (15, 18), the Newton-Raphson method (4,5,15,19,20), and various other trial-and-error approaches. The Newton-Raphson method requires an initial estimate of the location of the root. Following the evaluation of the function and its derivative at the estimated root, the algorithm extrapolates to an improved estimate. Iteration leads to rapid convergence provided the initial estimate is Page 30 suitably located. Numerical methods, such as this, that use feedback to direct the search, consistently outperform undirected trial-and-error techniques. The Newton-Raphson algorithm for evaluating the root of a function, f(x), is given by: xn +1 = xn − f ( xn ) f ' ( xn ) (38) where f ' (x) is the derivative of the function, xn is the current estimate of the root, and xn+1 is the new estimate. Newton’s method, illustrated in Figure 12, predicts the root-crossing at xn+1 by extrapolating the tangent to the curve at xn. The algorithm is iterated and is considered to have converged when the fractional accuracy, e= (xn − xn +1) xn +1 (39) is less than a predetermined tolerance value, say 1 x 10-6. A more definitive convergence check might be to test the function value slightly above and below the estimated root for a change of sign. For determining the pH of aqueous solutions of monoprotic acids, the equation to be solved (Equation 13) can be written as: f ( x) = x3 + a2 x 2 + a1x + a0 (40) where a2 = K a , a1 = (− K w − K aCa ) , a0 = (− K a K w ) , and x is the hydrogen ion concentration. The derivative of this equation is: f ' ( x) = 3x 2 + 2a2 x + a1 (41) Page 31 Figure 12. Newton’s method for determining the root of an equation. For computational efficiency these two equations may be rewritten (21): ( ) f ( x) = x x ( x + a2 ) + a1 + a0 (42) f ' ( x) = x (3 x + 2a2 ) + a1 (43) These shortcuts save three multiplication steps in the function evaluation and one multiplication in the derivative calculation compared with Equations 40 and 41. Situations exist in which the Newton-Raphson algorithm will be led astray or converge slowly (12). The major cause of this difficulty is an unfortunate or poor initial estimate of the root. The regula falsi method is sometimes preferred over Newton-Raphson because it only requires bracketing the actual root by two initial guesses and will always converge if a real root is in that interval. A relatively large interval to ensure convergence may require more iterations to converge. Page 32 The Newton-Raphson algorithm, when used for pH calculations of monoprotic acid solutions, is usually initialized with one of the four approximations. Depending on which approximation is selected for a specific situation, the initial estimate may not converge to the correct [H+]. We have found that, within the limits of pKa and pCa shown in Figure 1, the Newton-Raphson method started with the “best” weak acid approximation (Equation 36) converges rapidly to the correct root. For the worst case (when the initial pH estimate is 7), six iterations are required to give a fractional accuracy of 1 x 10-6; most other cases require less than three iterations (Figure 13). This procedure is near optimal for rigorous pH calculations with monoprotic acids. Concluding remarks Personal computers and handheld programmable calculators have transformed the teaching of undergraduate chemistry. As a means of rapidly computing answers to specific problems in a real-time fashion, we have implemented the algorithms presented here on programmable calculators, in various computer languages, and on a web pages using JavaScript (URL: http://www.chem.sc.edu/analytical/acidbase/). Use of these calculation web pages in the classroom supports a highly interactive teaching environment; when accessed by students outside the classroom, the web site offers resources for augmenting the learning process. Finally, the use of computer graphics enhances the students’ understanding of acid-base equilibria and provides concise summaries of the range of validity for the various approximations. Page 33 Figure 13. Number of iterations to find the hydrogen ion concentration for a monoprotic acid to a tolerance of 1 x 10-6 (Equation 39) as a function of pKa and pCa after initializing with the “best” weak acid approximation (Equation 36): (A) three-dimensional surface; (B) contour plot. Page 34 REFERENCES 1. B. Park, J. Chem. Educ., 30, 257 (1953). 2. E. R. Nightingale, Jr., J. Chem. Educ., 34, 277 (1957). 3. H. Freiser and Q. Fernando, Ionic Equilibria in Analytical Chemistry, John Wiley & Sons, Inc., New York, 1963. 4. J. N. Butler, Ionic Equilibrium, A Mathematical Approach, Addison-Wesley Publishing Company, Reading, MA, 1964. 5. A. J. Bard, Chemical Equilibrium, Harper & Row Publishers, New York, 1966. 6. W. L. Felty, J. Chem. Educ., 55, 576 (1978). 7. D. Rosenthal and P. Zuman, Chapter 18 in Treatise on Analytical Chemistry, Part I, Vol. 2, I. M. Kolthoff and P. J. Elving, Eds., John Wiley & Sons, New York, 1979. 8. J. E. House, Jr., and R. C. Reiter, J. Chem. Educ., 45, 679 (1968). 9. H. Narasaki, Talanta, 26, 605 (1979). 10. D. D. DeFord, J. Chem. Educ., 31, 460 (1954). 11. F. S. Acton, Numerical Methods That Work, Harper and Row Publishers, New York, 1970. 12. R. W. Hamming, Introduction to Applied Numerical Analysis, McGraw-Hill Book Company, New York, 1971. 13. R. W. Hornbeck, Numerical Methods, Quantum Publishers, Inc., New York, 1975. 14. S. D. Conte and C. de Boor, Elementary Numerical Analysis, An Algorithmic Approach, McGraw-Hill Book Company, New York, 1980. 15. J. G. Eberhart and T. R. Sweet, J. Chem. Educ., 37, 422 (1960). Page 35 16. C. L. Wilkins, C. E. Klopfenstein, T. L. Isenhour, P.L. Jurs, Introduction to Computer Programming for Chemists, Allyn and Bacon, Inc., Boston, 1974. 17. A. J. Bard and D. M. King, J. Chem. Educ., 42, 127 (1965). 18. B. Clare, Chem. Brit., 16, 249 (1980). 19. J. W. Swinnerton and W. W. Miller, J. Chem. Educ., 36, 485 (1959). 20. G. L. Breneman, J. Chem. Educ., 51, 812 (1974). 21. D. E. Knuth, The Art of Computer Programming, Vol. 2, Addison-Wesley Publishing Company, Reading, MA, 1969, p. 423.
© Copyright 2026 Paperzz