a Equation 5.6 can be used to determine the number of iterations a The function to be evaluated is 2

42 Thus, after three iterations, we obtain a root estimate of 1.4375 with an approximate error of 13.04. c Using false position, the first iteration is 628707 . 1 6862944 . 086294 . 2 2 5 . 6862944 . 2 = − − − − = r x 574927 . 2755734 . 086294 . 2 628707 . 1 5 . − = − = f f Therefore, the root is in the first interval and the upper guess is redefined as x u = 1.628707. The second iteration is 4970143 . 1 2755734 . 086294 . 2 628707 . 1 5 . 4970143 . 1 0.2755734 = − − − − = r x 8 . 8 100 4970143 . 1 6287074 . 1 4970143 . 1 = − = a ε 223119 . 1069453 . 086294 . 2 4970143 . 1 5 . − = − = f f Therefore, the root is in the first interval and the upper guess is redefined as x u = 1.497014. The remainder of the iterations are displayed in the following table: i x l fx l x u fx u x r fx r | ε a | 1 0.5 −2.08629 2 0.6862944 1.6287074 0.2755734 2 0.5 −2.08629 1.628707 0.2755734 1.4970143 0.1069453 8.80 3 0.5 −2.08629 1.497014 0.1069453 1.4483985 0.040917 3.36 Therefore, after three iterations we obtain a root estimate of 1.4483985 with an approximate error of 3.36.

5.9 a Equation 5.6 can be used to determine the number of iterations

45121 . 10 05 . 35 log 1 log 1 2 , 2 = ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ + = ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ ∆ + = d a E x n which can be rounded up to 11 iterations. b Here is an M-file that evaluates the temperature in o C using 11 iterations of bisection based on a given value of the oxygen saturation concentration in freshwater: function TC = TempEvalosf function to evaluate the temperature in degrees C based on the oxygen saturation concentration in freshwater osf. xl = 0 + 273.15; xu = 35 + 273.15; if fTaxl,osffTaxu,osf0 if guesses do not bracket errorno bracket display an error message and terminate 43 end xr = xl; for i = 1:11 xrold = xr; xr = xl + xu2; if xr ~= 0, ea = absxr - xroldxr 100; end test = fTaxl,osffTaxr,osf; if test 0 xu = xr; elseif test 0 xl = xr; else ea = 0; end end TC = xr - 273.15; end function f = fTaTa, osf f = -139.34411 + 1.575701e5Ta - 6.642308e7Ta2; f = f + 1.2438e10Ta3 - 8.621949e11Ta4; f = f - logosf; The function can be used to evaluate the test cases: TempEval8 ans = 26.7798 TempEval10 ans = 15.3979 TempEval14 ans = 1.5552

5.10 a The function to be evaluated is

3 2 3 81 . 9 400 1 3 2 y y y y f + + − = A graph of the function indicates a positive real root at approximately 1.5. 44 -40 -30 -20 -10 10

0.5 1

1.5 2

2.5 b Using bisection, the first iteration is 5 . 1 2 5 . 2 5 . = + = r x 998263 . 030946 . 2582 . 32 5 . 1 5 . = − − = f f Therefore, the root is in the second interval and the lower guess is redefined as x l = 1.5. The second iteration is 2 2 5 . 2 5 . 1 = + = r x 25 100 2 5 . 1 2 = − = a ε 018624 . 601809 . 030946 . 2 5 . 1 − = − = f f Therefore, the root is in the first interval and the upper guess is redefined as x u = 2. The remainder of the iterations are displayed in the following table: i x l fx l x u fx u x r fx r | ε a | 1 0.5 −32.2582 2.5 0.813032 1.5 −0.030946 2 1.5 −0.03095 2.5 0.813032 2 0.601809 25.00 3 1.5 −0.03095 2 0.601809 1.75 0.378909 14.29 4 1.5 −0.03095 1.75 0.378909 1.625 0.206927 7.69 5 1.5 −0.03095 1.625 0.206927 1.5625 0.097956 4.00 6 1.5 −0.03095 1.5625 0.097956 1.53125 0.036261 2.04 7 1.5 −0.03095 1.53125 0.036261 1.515625 0.003383 1.03 8 1.5 −0.03095 1.515625 0.003383 1.5078125 −0.013595 0.52 45 After eight iterations, we obtain a root estimate of 1.5078125 with an approximate error of 0.52. c Using false position, the first iteration is 45083 . 2 81303 . 2582 . 32 5 . 2 5 . 81303 . 5 . 2 = − − − − = r x 80248 . 25 79987 . 25821 . 32 45083 . 2 5 . − = − = f f Therefore, the root is in the first interval and the upper guess is redefined as x u = 2.45083. The second iteration is 40363 . 2 79987 . 25821 . 32 45083 . 2 5 . 79987 . 45083 . 2 = − − − − = r x 96 . 1 100 40363 . 2 45083 . 2 40363 . 2 = − = a ε 35893 . 25 78612 . 2582 . 32 40363 . 2 5 . − = − = f f The root is in the first interval and the upper guess is redefined as x u = 2.40363. The remainder of the iterations are displayed in the following table: i x l fx l x u fx u x r fx r | ε a | 1 0.5 −32.2582 2.50000 0.81303 2.45083 0.79987 2 0.5 −32.2582 2.45083 0.79987 2.40363 0.78612 1.96 3 0.5 −32.2582 2.40363 0.78612 2.35834 0.77179 1.92 4 0.5 −32.2582 2.35834 0.77179 2.31492 0.75689 1.88 5 0.5 −32.2582 2.31492 0.75689 2.27331 0.74145 1.83 6 0.5 −32.2582 2.27331 0.74145 2.23347 0.72547 1.78 7 0.5 −32.2582 2.23347 0.72547 2.19534 0.70900 1.74 8 0.5 −32.2582 2.19534 0.70900 2.15888 0.69206 1.69 9 0.5 −32.2582 2.15888 0.69206 2.12404 0.67469 1.64 10 0.5 −32.2582 2.12404 0.67469 2.09077 0.65693 1.59 After ten iterations we obtain a root estimate of 2.09077 with an approximate error of 1.59. Thus, after ten iterations, the false position method is converging at a very slow pace and is still far from the root in the vicinity of 1.5 that we detected graphically. Discussion: This is a classic example of a case where false position performs poorly and is inferior to bisection. Insight into these results can be gained by examining the plot that was developed in part a. This function violates the premise upon which false position was based −that is, if fx u is much closer to zero than fx l , then the root is closer to x u than to x l recall Fig. 5.8. Because of the shape of the present function, the opposite is true. 46 CHAPTER 6 6.1 The function can be set up for fixed-point iteration by solving it for x i i x x sin 1 = + Using an initial guess of x = 0.5, the first iteration yields 649637 . 5 . sin 1 = = x 23 100 649637 . 5 . 649637 . = × − = a ε Second iteration: 721524 . 649637 . sin 2 = = x 96 . 9 100 721524 . 649637 . 721524 . = × − = a ε The process can be continued as tabulated below: iteration x i | ε a | 0 0.500000 1 0.649637 23.0339 2 0.721524 9.9632 3 0.750901 3.9123 4 0.762097 1.4691 5 0.766248 0.5418 6 0.767772 0.1984 7 0.768329 0.0725 8 0.768532 0.0265 9 0.768606 0.0097 Thus, after nine iterations, the root is estimated to be 0.768606 with an approximate error of 0.0097.

6.2 a The function can be set up for fixed-point iteration by solving it for x in two different