a Heun’s method: 0.82813 0.5938 2 1.125 0.6526523 0.77344 0.7031 1.75 0.949219 0.80078 0.6484 1.875 1.043945 2 a The solution to the differential equation is 8

188

18.3 a Heun’s method:

Predictor: 2 1 2 2 1 − = + − = k 5 . 2 1 5 . = − + = y 25 . 5 . 2 2 2 = + − = k Corrector: 5625 . 5 . 2 25 . 2 1 5 . = + − + = y The remaining steps can be implemented and summarized as t y k 1 x i+1 y i+1 k 2 dydt 0 1 -2.0000 0.5 0.2500 -0.875 0.5 0.5625 -0.8750 1 0.125 0.7500 -0.0625 1 0.53125 -0.0625 1.5 0.5 1.2500 0.59375

1.5 0.82813 0.5938 2 1.125

1.7500 1.17188 2 1.41406 1.1719 b As in Part a, the corrector can be represented as 5625 . 5 . 2 5 . 2 2 1 2 1 1 = + − + − + = + i y The corrector can then be iterated to give 28125 . 5 . 2 5 . 5625 . 2 2 1 2 2 1 = + − + − + = + i y 421875 . 5 . 2 5 . 28125 . 2 2 1 2 3 1 = + − + − + = + i y The iterations can be continued until the percent relative error falls below 0.1. This occurs after 12 iterations with the result that y0.5 = 0.37491 with ε a = 0.073. The remaining values can be computed in a like fashion to give t y 0 1.0000000

0.5 0.3749084 1 0.3334045

1.5 0.6526523

189 2 1.2594796 c Midpoint method 2 1 2 2 1 − = + − = k 5 . 25 . 2 1 25 . = − + = y 9375 . 25 . 5 . 2 2 2 − = + − = k 53125 . 5 . 9375 . 1 5 . = − + = y The remainder of the computations can be implemented in a similar fashion as listed below: t y dydt t m y m dy m dt 0 1 -2.0000 0.25 0.5 -0.9375 0.5 0.53125 -0.8125 0.75 0.328125 -0.0938 1 0.48438 0.0313 1.25 0.492188 0.57813

1.5 0.77344 0.7031 1.75 0.949219

1.16406 2 1.35547 d Ralston’s method: 2 1 2 2 1 − = + − = k 25 . 375 . 2 1 375 . = − + = y 3594 . 375 . 25 . 2 2 2 − = + − = k 54688 . 5 . 3 3594 . 2 2 1 25 . = − + − + = y The remaining steps can be implemented and summarized as t y k 1 t + 34h y + 34k 1 h k 2 dydt 0 1 -2.0000 0.375 0.25 -0.3594 -0.9063 0.5 0.54688 -0.8438 0.875 0.230469 0.3047 -0.0781 1 0.50781 -0.0156 1.375 0.501953 0.8867 0.58594

1.5 0.80078 0.6484 1.875 1.043945

1.4277 1.16797 2 1.38477 All the versions can be plotted as: 190

0.5 1

1.5

0.5 1

1.5 2

Heun without corr Ralston M idpoint Heun with corr

18.4 a The solution to the differential equation is