Solving quadratic equations

where sgn(b) means "the sign of b". Then the two roots of the quadratic equation (eq 1) can be written: In calculating q, the square root appears with...
2 downloads 0 Views 783KB Size
Solving QuadraticEquations R. J. C. Brown Queen's University, Kingston, ON K7L 3N6. Canada

Solving quadratic equations is a piece of algebra that is usually taken for granted in chemistry classes. The roots of the equation a~~+bx+c=O

(1)

= -O.lOWW, to sufficient accuracy

The solution to the problem is:

are almost always calculated from the formula:

This formula is often used without explanation in chemistry classes and has been memorized by &erations of student;. A recent hook on the ~racticalaspects of numerical analysis' points out that this formula can iead to unacceptable roundoff error when 4ac is much less than b2, for then the square root is very close to b and one of the roots is obtained by suhtraction of b. This situation can occur in calculations related to chemical equilibrium. A much better technique that avoids round-off error of this sort has been described.' Define the quantity q as follows:

where sgn(b) means "the sign of b". Then the two roots of the quadratic equation (eq 1) can be written:

In calculating q, the square root appears with the same sign as b itself, and so the damaging suhtraction used in obtaining one of the roots from eq 2 is replaced (in hoth roots) by an addition of quantities with the same sign. If one of the roots is very small, its value is determined through eq 4 hy division of one numher by another much larger numher, rather than by suhtraction i f two nearly equal quantities; as a result, there is no loss of significant figures. As anexample, consider the calculation of the soluhility,~, of silver iodide ( K , = 8 X 10-17) in 0.1 F sodium iodide. The equilibrium constant expression, hearing in mind the common ion, is: S(S

+ 0.1) = 8 X lo@

+

-

which can he rearranged to s2 0.1s 8 X 10-l7 = 0. The standard solution does not work well, if a t all, with a hand calculator. I t is therefore usual to adopt the approximation that s is much smaller than 0.1, in order to avoid solving the quadratic. This makes sense chemically, hut one is left with an uneasy feeling that the quadratic equation ought to he able to yield a satisfactory solution. This can he done using the revised method; first we evaluate q:

Thus the revised method leads automatically to the result without approximation. The advantage of this for computer work is obvious. The revised method also has some advantage for algebraic manipulations. For example, in dealing with the ionization of a weak acid, the following quadratic equation has to be solved: where x is the hydrogen ion concentration. K . is the ionization constant, and Fa is the formal concentration of acid. Following the revised method, the required hydrogen ion concentration is the second root given in eq 4:

The degree of ionization a = [H+]IF,is therefore:

Equation 5 can he simplified in two limiting cases, without using a series expansion of the square root. In sufficiently concentrated solutions, 4K.F. >> Ka2,and so the denominator is approximately equal to 2 a . Hence we recover the usual result:

-

[Htl

On the other hand, in very dilute solutions, Ka2>> 4K.F., and the denominator of eq 5 is approximately equal t o 2K,. The hydrogen ion concentration is therefore:

-

[Ht]Fa corresponding to complete ionization. Thus the revised method yields hoth numerical and algebraic results that are easier to work with than the conventional expression for the roots of a quadratic equation. Whether it would be possible to overcome generations of traditional teaching is not clear.

'

Press. W. H.: Fiannery. 6. P.; Teukoisky, S. A,; Vetteriing, W. T. NumericaiRecipes; Cambridge University, 1986: p 145.

Volume 67

Number 5 May 1990

409