M. J. D. Brand Texas A&M University College Station, 77843
I(
A General Method for the Solution of Polynomial Equations in H+ Ion Concentration
Numerous computer programs exist for theoretical solution and experimental data treatment of prohlems in ionic equilibrium, particularly acid-base equilibria? The general solution of an acid-base equilihrium problem requires howledge of the eauilihrium constants for each Dossihle reaction and mass halance equations for each species present. The widely used electn>-neutralityconditions can hc derived from the mass balance equations and may replace one such equation. I t is usually possible to reduce this set of simultaneous equations roa pnlynomial equation inone unknown,e.g. hydwgpn ion. The problem thus hecomes one of solving a polynomial eauatinn. -> ~ ~ ~ ~ ~ ~ ~ Explicit solutions of polynomial equations cannot be ohtained excent in simole cases hut the use of a comouter allows a numeric; solution to he obtained without the need for chemical aonroximations. Iteration and the Newton-Ra~hson method2 can he used hut neither are particularly satisfactory when the required root tends toward zero, as may happen in strongly alkaline solutions. In this case scaling3 can he applied to reduce errors inherent in the manipulation of small numbers. Soltzherg e t aL4 have described a simple method for the solution of a polynomial equation of the form ~~
~
~~
..
H6
= H - S : LET HI = H: LETS = S I l e 1F s = ,6641 GO TO 224 LET
GO TO 1 1 s PRINT H 4
Basic Submutine for the solution of a cubic equation in hydragen ion concentration, where the equilibrium pH lies between 0 and 14. The subroutine may be applied to other equations by inserting the given function in line 130.
~
y = f(HC)
(1)
where it is known that the required root lies in some known interval H I to H Z . This interval is divided into n (e.g. 100) equal steps of width S and a value for y is calculated for values of(^^ +-is)for i = 0 t o n . At somendue of i , the sign of y changes, implying that the root lies between H I iS and H I (i - 1)s.The required root is now h o w n to lie in an interval of range S,which is narrower than the previous range H I to Hz of width nS. If necessary the process can he repeated to give a root of the required accuracy. The problems of defining the probable range of the root and its required accuracy can he minimized by making the transformation
+
+
196 206 216 220
(2) [H+]= lot(-pH) Most simple dilute aqueous solutions have a p H in the range 0-14 and i t is experimentally questionable to calculate p H values to better than *0.001. Furthermore, the solution p H is frequently the desired result of an acid-base equilihrium calcul&on. The calculation is readily performed by evaluating eqn. (1)for values of H given by eqn. (2). Varying t h e p H over the range 0-14 in steps of 1,defines the root to the nearest p H unit. This can he suhsequently refined to the nearest 0.1,0.01, and 0.001 p H unit. A simple program written in Basic for performing this calculation is shown in the figure. This algorithm can he applied to the solution of polynomial equations in variables other than hydrogen ions hut it has particular merit where the p-Function is readily identified with the system equilihrium. Two simple examples are given
to illustrate use of the method. The first example demonstrates how the program converges on the required root and the second calculates an entire titration curve from one equation without the need to treat different parts of the curve individually. This approach to acid-base equilihria provides a rapid means of finding solutions to prohlems which can he tedious in all hut the simplest cases. Examples of Appllcatlons 1) Calculation of the pH of a solution A M in hydrochloricacid, BI M in ammonia, and 8 2 M in triethanolamine. Eleetroneutrality requires [Ht] + [NH4+]+ [HTEA+]- [OH-] - [CI-] = 0
where K1 = 5.8 X 10-1°,Kp = 1.7 X IOV, mdKw = 1X 10W14. Solution of this quartic equation using the subroutine of the figure with A = BI = 8 2 = 10V gave the results shown in Table 1. In this table intermediate values ofpH, [H+],and 'Y' Table 1. Approach to Convergence in Calculation of pH of a Solution Containina 1 0 7 M HCI. 1 0 7 M NH.. and 10IM TEA
-
'
Jensen, R. E., Gamey, R. G., and Paulson, B. A,, J. CHEM. EDUC., 47,147 (1970). Eberhardt, J. G., and Sweet, T. R., J. CHEM. EDUC., 37,422 (1960). "utler, J. N., "Ionic Equilibrium-A Mathematical Approach," Addison Wesley, Massachusetts, 1964, p. 83. Soltzberg, L., Shah, A. A,, Saber, J. C., and Canty, E. T., "BASIC and Chemistry," Houghton Mifflin Co., Boston, 1975, p. 176. Volume 53, Number 1 2 December 1976
/ 771
have been printed to show haw the calculation approaches the final result that the p H lies between 8.504 and 8.505. 2) Titration curve for a solution A , M in hydrochloric acid and AS M in acetic acid titrated with B M sodium hydroxide. Eledroneutrality requires [Htl
+ [Naf] - [CI-] - [OH-] - [Ac-]
=0
where Vo is the volume of the mixed acid solution, V is the volume of the sodium hydroxide solution, and K1 = 1.15 X Solution of this cubic equation with Vo = 50 and A, = A? = B = 0.1 for a series of values of V, is shown in Table 2. The entire titration curve can be obtained by solution of a single equation with different values of the independent variable V without the need to introduce any approximations.
772 / Journal of Chemical Education
Table 2. Calculated Titration Curve for 50 m l of a Solution Containing 0.1 M H C I and 0 . 1 M Acetic Acid Titratad with 0.1 M NaOH ,r
nu
Y . ,