NUMERICAL METHODS 1. Rearranging the equation x 3 =.5 gives the iterative formula x n+1 = g(x n ), where g(x) = (2x 2 ) 1. (a) Starting with x = 1, compute the x n up to n = 6, and describe what is happening. (b) Explain the behaviour in (a) by evaluating g (x) at x = 2 1/3. (c) Repeat (a) and (b) for the two iterative schemes x n+1 = x n 2 + 1 4x 2 n and x n+1 = 2x n 3 + 1. 6x 2 n In particular: which of them gives faster convergence, and why? [Work to four decimal places.] 2. Sketch the graph of the function f(x) = x.1 exp(x), by evaluating f(), f(1) and f(4). Predict which of the two roots of f(x) = the iterative sequence generated by the formula x n+1 =.1 exp(x n ) would converge to, given suitable starting data x. 3. (a) The function f(x) = 2 sinh x 3x has a root at x = and two non-zero roots. Find out which of the intervals [ 2, 1], [ 1, ], [, 1] and [1, 2] contain the non-zero roots. [It saves some work if you note that f is an odd function.] (b) To which root will the iteration x n+1 = 2 sinh x 3 n converge, given suitable starting data x? (c) Devise an iteration that will enable you to find the other roots, and find them correct to three decimal places. 4. Show that the function f(x) = x 3 + 3x 2 = has a root between and 1. Find this root, correct to three decimal places, using Newton s method. Investigate the iterative schemes x k+1 = g(x k ), with (a) g(x) = (2 x 3 )/3; (b) g(x) = (2 3x) 1/3. In particular, test whether either of these will converge, given the starting value x =. 5. Show that the equation log x = 1 2x has a solution between x =.5 and x = 1, and find this solution (correct to four decimal places). 6. Derive a Newton-Raphson formula for calculating the cube root of a number. Use it to find the cube root of 7 correct to four decimal places. 7. Find the largest positive zero of the function f(x) = x 5 + 1x 4 + 3x 3 x 3 accurate to one decimal place.
8. Find the positive solution of f(x) = x 3 (cos x) 2 = correct to 4 decimal places. 9. Using Newton s method, find a solution to the following equations, to six digit accuracy, starting from the given x. (a) f(x) = sin x cot x =, x = 1. (b) x 3 1.2x 2 + 2x 2.4 =, x = 2. (c) exp( x) = tan x, x = 1. 1. Show that the equation x 3 + x 1 = has a root between x =.6 and x = 1. Investigate the convergence of the iterative schemes based on each of the following rearrangements of the equation: x = 1 x 3 and x = 1/(1 + x 2 ). Use a Newton scheme to find the root (correct to four decimal places). 11. From the data f(1.) = 3., f(1.2) = 2.987, f(1.4) = 2.9216, f(1.6) = 2.82534, f(1.8) = 2.69671, f(2.) = 2.543 i) using both linear interpolation (on the points x = 1.2 and x = 1.4), and quadratic interpolation (on 1, 1.2 and 1.4), approximate f(1.28); ii) select appropriate points and estimate f(1.74) using both linear and quadratic interpolation; iii) use cubic interpolation to estimate f(1.5). 12. Using Lagrange polynomials for quadratic interpolation, estimate sinh(.3) from the data sinh(.5) =.521, sinh() = and sinh(1) = 1.175 (work with three decimal places). Compare your answer with the result obtained from a calculator. Now use Lagrange s method for cubic interpolation by including the value sinh(.5) =.521. 13. From the following data x.45.46.47.48.49.5 f(x).5353.83272.195264.1375251.1638987.1882286 i) use Lagrange s method for quadratic interpolation on the points x =.47,.48 and.49 to obtain an approximation to f(.4792); ii) use Lagrange s method for cubic interpolation on the points x =.47,.48,.49 and x =.5 to obtain an approximation to f(.495); iii) use the divided difference method to find the quadratic that interpolates the points with x =.47,.48 and.49 and use it to approximate f(.4792); iv) select appropriate points and use their data and the divided difference method to estimate f(.483) with linear, quadratic and cubic interpolation.
14. According to a famous table in the Highway Code, total stopping distances (in feet) are related to speeds (in mph) as follows: speed 2 3 4 5 6 7 distance 4 75 12 175 24 315 i) Use Lagrange s method to find the quadratic that interpolates the points with speeds 2, 3, and 4. ii) Use the divided difference method to fit linear, quadratic and cubic interpolants to the data and use them to estimate the stopping distance for 69 mph. iii) Use the divided difference method to show that a polynomial of degree less than 5 passes through all 6 points. 15. Find the value at x =.5 of the polynomial p(x) of lowest degree which agrees with the function f(x) = x 5 2 at x 1 = 1, x =, x 1 = 1, x 2 = 1.5. 16. Find the polynomial p(x) of lowest degree such that y = p(x) is satisfied for the pairs of x and y values in the following table. (To avoid truncation error in your calculator, use fractions rather than decimals to write the polynomial.) x 1 3 5 y 3 2-1 -2 17. Find the polynomial of lowest degree that interpolates between the points of the following table. x 1 2 3 4 5 f(x) 2 17 8-1 -4 5 18. Estimate the largest possible spacing in a table of the function f(x) = x 3 /3, for values of x near 2, such that the error using linear interpolation would be less than.5 1 2. 19. Consider the problem of providing five figure tables of a function f over a range of values. Find the largest spacing of the form n 1 k (where n is 1, 2 or 5) which ensures the error in linear interpolation between successive tabulated values would be less than 5 1 6 for: i) f(x) = cos x on the range to π/2; ii) f(x) = log x on the range 1 to 1; iii) f(x) = x exp( u2 /2) du on the range x 3. 2. Find a bound on the quadratic interpolation error for sin x on the range π/2 to π/2 from x-values with spacing h =.1.
21. Using the data in the following table, find f() as accurately as you can. x -2.8-1.3839.7661-3.98 f(x).5 1. 1.5 2. (by interchanging the x and f values as has been done in this table we can use interpolation to find zeros of functions this can be useful when a function is difficult to evaluate e.g. when its values are experimental data). 22. Use (a) the trapezium rule, and (b) Simpson s rule to estimate 2 1 x 1 dx, using a step-size of h =.1 and working to six decimal places. In each case, compute the maximum possible error in your estimate, and compare this with the actual error. 23. Compute the Fresnel integral C(x) = x cos t2 dt for x = 1, using: i) the trapezium rule with n = 4 & 8, ii) Simpson s rule with n = 2 & 4. Give upper bounds for the errors in these estimates. 24. Compare the trapezium rule and Simpson s rule by finding, for each of them, the smallest number n of subintervals required to evaluate I = 3 1 x3 /6 dx, with an error of less than 1 5. 25. Estimate the number n of subintervals required to evaluate the integral I = 1 e x dx by Simpson s rule, with an error of less than 5 1 6. What accuracy could you guarantee using the trapezium rule with the same value of n? 26. Estimate 1 (1 + x2 ) 1 dx, whose exact value is π/4, by using (i) the trapezium rule and (ii) Simpson s rule, for h =.25 and h =.125. Work to eight decimal places. 27. Estimate.5 [1 (t 3 / cos t)] 1 dt using Simpson s rule with n = 2 and n = 4. 28. The function f(x) is defined by f(x) = ex 1 x 2 1 x. Calculate f(.1) by straightforward evaluation on your calculator; and then find f(.1) correct to six significant figures (hint: replace e x by p 3, (x)). 29. Find the limit, as x tends to, of the function f(x) = x 4 ( 1 2 cos x + e x2) (use the Taylor expansions of cos and exp). What results does your calculator give for f(1 m ), with m = 1, 2, 3, 4, 5? Calculate f(.1) correct to five decimal places. 3. Show how one may avoid loss of significance (rounding error) in evaluating f(x) = log(x + 1) log x for values of x much greater than 1. Evaluate f(1 1 ) correct to 3 decimal places.
31. Estimate as accurately as you can the integral J = 3 f(x) dx, if the function f(x) has the values f = 2, 3, 7 at the points x =, 1, 3 respectively. [Find the quadratic interpolating polynomial, and integrate that.] 32. Use Richardson extrapolation to evaluate the integral 3 f(x) dx, when f is a smooth 1 function which takes the values given in the following table. x 1 1.25 1.5 1.75 2 2.25 2.5 2.75 3 f.7788.6766.5698.465.3679.2821.296.151.154 Estimate the error in your calculation of the integral. 33. (a) How many subintervals n would be needed to evaluate the integral I = (2π) 1/2 2 e x2 /2 dx, with an error less than 1 7, using (i) the trapezium rule and (ii) Simpson s rule? [You may use f (x) 1/ 2π and f (4) (x) 3/ 2π.] (b) Use Richardson extrapolation to evaluate the integral, stopping when you are confident that the error is less than 1 7, and compare the amount of work necessary with the amount you predicted would be needed for Simpson s rule. 34. Evaluate I = 1 x7 dx, using Simpson s rule with n = 1, and working to six decimal places. Derive the theoretical maximum of the error, and compare with the actual error. Recalculate the integral using Richardson extrapolation, and comment on the result.