a a Solutions Manual Applied Numerical Met

49

6.3 a

x = linspace0,4; y = x.3-6x.2+11x-6.1; plotx,y grid Estimates are approximately 1.05, 1.9 and 3.05. b The formula for Newton-Raphson is 11 12 3 1 . 6 11 6 2 2 3 1 + − − + − − = + i i i i i i i x x x x x x x Using an initial guess of 3.5, the first iteration yields 191304 . 3 11 5 . 3 12 5 . 3 3 1 . 6 5 . 3 11 5 . 3 6 5 . 3 5 . 3 2 2 3 1 = + − − + − − = x 673 . 9 100 191304 . 3 5 . 3 191304 . 3 = × − = a ε Second iteration: 068699 . 3 11 191304 . 3 12 191304 . 3 3 1 . 6 191304 . 3 11 191304 . 3 6 191304 . 3 191304 . 3 2 2 3 2 = + − − + − − = x 995 . 3 100 068699 . 3 191304 . 3 068699 . 3 = × − = a ε 50 Third iteration: 047317 . 3 11 068699 . 3 12 068699 . 3 3 1 . 6 068699 . 3 11 068699 . 3 6 068699 . 3 068699 . 3 2 2 3 3 = + − − + − − = x 702 . 100 047317 . 3 068699 . 3 047317 . 3 = × − = a ε c For the secant method, the first iteration: x −1 = 2.5 fx −1 = −0.475 x = 3.5 fx = 1.775 711111 . 2 775 . 1 475 . 5 . 3 5 . 2 775 . 1 5 . 3 1 = − − − − = x 098 . 29 100 711111 . 2 5 . 3 711111 . 2 = × − = a ε Second iteration: x = 3.5 fx = 1.775 x 1 = 2.711111 fx 1 = −0.45152 871091 . 2 45152 . 775 . 1 711111 . 2 5 . 3 45152 . 711111 . 2 2 = − − − − − = x 572 . 5 100 871091 . 2 711111 . 2 871091 . 2 = × − = a ε Third iteration: x 1 = 2.711111 fx 1 = −0.45152 x 2 = 2.871091 fx 2 = −0.31011 221923 . 3 31011 . 45152 . 871091 . 2 711111 . 2 31011 . 871091 . 2 3 = − − − − − − = x 889 . 10 100 221923 . 3 871091 . 2 221923 . 3 = × − = a ε d For the modified secant method, the first iteration: x = 3.5 fx = 1.775 x + δ x = 3.57 fx + δ x = 2.199893 51 207573 . 3 775 . 1 199893 . 2 775 . 1 5 . 3 02 . 5 . 3 1 = − − = x 117 . 9 100 207573 . 3 5 . 3 207573 . 3 = × − = a ε Second iteration: x 1 = 3.207573 fx 1 = 0.453351 x 1 + δ x 1 = 3.271725 fx 1 + δ x 1 = 0.685016 082034 . 3 453351 . 685016 . 453351 . 207573 . 3 02 . 207573 . 3 2 = − − = x 073 . 4 100 082034 . 3 207573 . 3 082034 . 3 = × − = a ε Third iteration: x 2 = 3.082034 fx 2 = 0.084809 x 2 + δ x 2 = 3.143675 fx 2 + δ x 2 = 0.252242 050812 . 3 084809 . 252242 . 084809 . 082034 . 3 02 . 082034 . 3 3 = − − = x 023 . 1 100 050812 . 3 082034 . 3 050812 . 3 = × − = a ε e a = [1 -6 11 -6.1] a = 1.0000 -6.0000 11.0000 -6.1000 rootsa ans = 3.0467 1.8990 1.0544

6.4 a

x = linspace0,4; y = 7sinx.exp-x-1; plotx,y grid 52 The lowest positive root seems to be at approximately 0.2. b The formula for Newton-Raphson is sin cos 7 1 sin 7 1 i i x x i i i x x e e x x x i i − − − = − − + Using an initial guess of 3.5, the first iteration yields 144376 . 421627 . 3 532487 . 3 . 3 . sin 3 . cos 7 1 3 . sin 7 3 . 3 . 3 . 1 = − = − − − = − − e e x 8 . 107 100 144376 . 3 . 144376 . = × − = a ε Second iteration: 169409 . 124168 . 5 12827 . 144376 . 144376 . sin 144376 . cos 7 1 144376 . sin 7 144376 . 144376 . 144376 . 2 = − − = − − − = − − e e x 776 . 14 100 169409 . 144376 . 169409 . = × − = a ε Third iteration: 170179 . 828278 . 4 00372 . 169409 . 169409 . sin 169409 . cos 7 1 169409 . sin 7 169409 . 169409 . 169409 . 1 = − − = − − − = − − e e x 53 453 . 100 170179 . 169409 . 170179 . = × − = a ε c For the secant method, the first iteration: x −1 = 0.4 fx −1 = 0.827244 x = 0.3 fx = 0.532487 119347 . 532487 . 827244 . 3 . 4 . 532487 . 3 . 1 = − − − = x 4 . 151 100 119347 . 3 . 119347 . = × − = a ε Second iteration: x = 0.3 fx = 0.532487 x 1 = 0.119347 fx 1 = −0.26032 178664 . 26032 . 532487 . 119347 . 3 . 26032 . 119347 . 2 = − − − − − = x 2 . 33 100 178664 . 119347 . 178664 . = × − = a ε Third iteration: x 1 = 0.119347 fx 1 = −0.26032 x 2 = 0.178664 fx 2 = 0.04047 170683 . 04047 . 26032 . 178664 . 119347 . 04047 . 178664 . 3 = − − − − = x 68 . 4 100 170683 . 178664 . 170683 . = × − = a ε d For the modified secant method, the first iteration: x = 0.3 fx = 0.532487 x + δ x = 0.303 fx + δ x = 0.542708 143698 . 532487 . 542708 . 532487 . 3 . 01 . 3 . 1 = − − = x 8 . 108 100 143698 . 3 . 143698 . = × − = a ε 54 Second iteration: x 1 = 0.143 698 fx 1 = −0.13175 x 1 + δ x 1 = 0.145135 fx 1 + δ x 1 = −0.12439 169412 . 13175 . 12439 . 13175 . 143698 . 02 . 143698 . 2 = − − − − − = x 18 . 15 100 169412 . 143698 . 169412 . = × − = a ε Third iteration: x 2 = 0.169412 fx 2 = −0.00371 x 2 + δ x 2 = 0.171106 fx 2 + δ x 2 = 0.004456 170181 . 00371 . 004456 . 00371 . 169412 . 02 . 169412 . 3 = − − − − = x 452 . 100 170181 . 169412 . 170181 . = × − = a ε

6.5 a The formula for Newton-Raphson is