Docsity

Elementary Numerical Analysis - Study Guide | MTH 351, Study notes of Mathematical Methods for Numerical Analysis and Optimization

Toggle sidebar
bg1
Elementary Numerical Analysis
Bent E. Petersen
Summer 2004 – 20040806
Contents
1 TAYLOR Polynomials 2
2 Errors 7
3 Numeric Differentiation 8
4 Roots. Midpoint Method 10
5 Roots. NEW TON ’s Method 10
6 Roots. HALLEY’s Method 12
7 Roots. Secant Method 14
8 Roots. Miscellaneous 14
9 Fixed Point Iteration 14
10 NEW TON ’s Method for Systems 15
11 Secant Method for Systems 17
12 Interpolation polynomials 17
13 Interpolation polynomials and N EWT ON
divided differences 19
14 Interpolation and ˇ
CEBYˇ
SEV polynomials 21
15 Interpolation Splines 22
16 Least Squares Fitting 24
17 Compound Newton-Cotes Quadrature
Methods 29
18 RIC HAR DSO N Extrapolation and
ROMB ERG Qudrature 32
19 GAU SS- LEG ENDRE Quadrature 34
20 Miscellaneous Quadrature Problems 34
21 Iterative methods for fixed points for non-
linear systems. Simultaneous and succes-
sive displacements 36
22 Vectors. Inner Products and Norms 38
23 Matrices 39
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d

Partial preview of the text

Download Elementary Numerical Analysis - Study Guide | MTH 351 and more Study notes Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

Elementary Numerical Analysis

Bent E. Petersen

Summer 2004 – 20040806

Contents

1 TAYLOR Polynomials 2

2 Errors 7

3 Numeric Differentiation 8

4 Roots. Midpoint Method 10

5 Roots. NEWTON’s Method 10

6 Roots. HALLEY’s Method 12

7 Roots. Secant Method 14

8 Roots. Miscellaneous 14

9 Fixed Point Iteration 14

10 NEWTON’s Method for Systems 15

11 Secant Method for Systems 17

12 Interpolation polynomials 17

13 Interpolation polynomials and NEWTON divided differences 19

14 Interpolation and ˇCEBY ˇSEV polynomials 21

15 Interpolation Splines 22

16 Least Squares Fitting 24

17 Compound Newton-Cotes Quadrature Methods 29

18 RICHARDSON Extrapolation and ROMBERG Qudrature 32

19 GAUSS-LEGENDRE Quadrature 34

20 Miscellaneous Quadrature Problems 34

21 Iterative methods for fixed points for non- linear systems. Simultaneous and succes- sive displacements 36

22 Vectors. Inner Products and Norms 38

23 Matrices 39

24 GAUSS-JORDAN Row Reduction 41

25 LU Facrorization 42

26 Positive Definite Matrices 43

27 GAUSS-JACOBI and GAUSS-SEIDEL iter- ative methods for linear systems 43

This list of problems will be augmented during the quarter. Some of the problems are from old lists of sample problems, old tests or old assignments. Thus there may be some duplication, or at least, near duplication, of other material on my web pages. Other problems may seem familiar because I used them as examples in my lectures.

Some of the problems here may be used with minor editing on future tests. Other problems, espe- cially those which are pretty theoretical, are for instruction and amusement.

If you have difficulties with any of the problems then ask me for hints or clarification, but don’t wait until the end of the term!

1 TAYLOR Polynomials

Problem 1.1. We know from calculus that EULER’s number e is given by

e =

∑^ ∞

k=

k!

Deduce 2. 5 ≤ e ≤ 2. 75. Hint Show k! ≥ 2(3k−^2 ) if k ≥ 3.

Problem 1.2. Suppose we use the TAYLOR sum

∑^ n

k=

k!

2 k

to approximate

e = e^1 /^2. How large should we take n to guarantee the error is no larger than 10 −^12? Hint You may find it useful to note e^1 /^2 ≤ 2.

Problem 1.3. Suppose we approximate e^2 x^ on the interval [− 1 , 1] by the the TAYLOR polyno-

mial

p(x) = 1 + 2x + 2x^2 +

x^3.

Use the TAYLOR remainder to give a good upper bound for the truncation error that we make at x = − 12 and at x = 12.

Problem 1.4. Suppose we approximate f (x) = log(x + 1) on the interval (− 1 , 1) by the the

TAYLOR polynomial

p(x) = x −

x^2 +

x^3.

Use this inequality (and only this inequality) to obtain an estimate of

∫ (^1)

0

sin(x) x dx

with an error no bigger than 0. 0008. Be sure to explain what you are doing and to back up your claim that the error is no bigger than 0. 0008. ( Hint: Find an interval containing the value of the integral and use the midpoint as your estimate.)

Problem 1.15. Part A: Let f (x) = esin^ x. The TAYLOR polynomial of degree 6 for f (x) is

1 + x +

x^2 −

x^4 −

x^5 −

x^6.

Given that

∣ f (7)(x)

∣ ≤ 120 for | x | ≤ 12 estimate the error in approximating f (x) by the TAYLOR

polynomial on the interval

[

]

Part B: Compute the value of the TAYLOR polynomial at x = 12.

Part C: Use your calculator to compute f

2

and compare this value with the estimate obtained in part B. How does the actual error compare with your estimate of the error obtained in part A?

Problem 1.16. Compute the TAYLOR polynomial of degree 4 with center at 1 for

x. Evaluate the TAYLOR polynomial at x = 1. 2 and compare your result with

  1. 2 (as given by a calculator). Compare the actual error with the error estimate given by the TAYLOR remainder.

Problem 1.17. Substitute t = −s^2 in

1 − t

= 1 + t + t^2 + t^3 +

t^4 1 − t

and integrate with respect to s to obtain

arctan x = x −

x^3 3

x^5 5

x^7 7

∫ (^) x

0

s^8 1 + s^2 ds.

Now use tan

( (^) π 8

2 − 1 to estimate π. Note that the absolute error in your estimate of π is bounded by ∣ ∣ ∣ ∣ ∣

0

s^8 1 + s^2

ds

0

s^8 ds

2 − 1)^9 ≤. 0003190556

How does this estimate compare with the actual error?

Problem 1.18. Estimate π as in the previous problem but this time use

1 − t

= 1 + t + t^2 + t^3 + t^4 + t^5 + t^6 + t^7 1 − t

Again compare the estimated error and the actual error.

Problem 1.19. Show n! ≥ 2 n−^1 if n ≥ 2. Then use

e =

∑^ ∞

n=

n!

to deduce e ≤ 3.

Problem 1.20. Recall

ex^ =

∑^ n

k=

k!

xk^ +

(n + 1)!

eξ^ xn+

for some ξ between 0 and x. If we use the polynomial part here (the Taylor polynomial of degree n) to estimate ex^ how large must we take n in order to ensure the absolute truncation error is bounded by 10 −^9 on the interval [− 1 , 1]. How large must we take n in order to ensure the same error bound, but just on the interval [− 12 , 12 ].

Problem 1.21. If we have a full TAYLOR series we can use it to estimate the error in a Tay-

lor polynomial. This method is sometimes more convenient the estimating the TAYLOR remainder directly (and avoids the mysterius ξ.) For example, if we integrate (^1) −^1 x =

k=0 x

k (^) we obtain

− log(1 − x) =

∑^ ∞

k=

k

xk^ , | x | < 1.

Thus

− log(1 − x) =

∑^ n

k=

k xk^ + Rn(x) where Rn(x) =

∑^ ∞

k=n+

k xk^.

An easy estimate yields

| Rn(x) | ≤

n + 1

∑^ ∞

k=n+

| x |k^ ≤

n + 1

| x |n+ 1 − | x |

Taking x = 12 we obtain

log 2 ∼=

∑^ n

k=

k 2 k^

with an absolute error bounded by

(n + 1)2n^

How large should we take n to guarantee an estimate of log 2 with an absolute error no larger than 10 −^12?

Problem 1.22. Replacing x by −x in the previous problem yields

log(1 + x) =

∑^ ∞

k=

(−1)k+ k

xk^ , | x | < 1.

Thus

log

1 + x 1 − x

= − log(1 − x) + log(1 + x) = 2

∑^ ∞

k=

x^2 k+ 2 k + 1 , | x | < 1.

2 Errors

A real number xa is said to have m significant decimal digits as an approximation to the real number xt 6 = 0 provided that (^) ∣ ∣ ∣ ∣

xt − xa xt

∣ ≤^5 ×^10

−m− (^1).

The best value of m is called the number of significant decimal digits in xa as an approximation to xt or simply the number of significant digits when xt and “decimal” are understood. It is clearly given by

m =

− log 10

xt − xa xt

Here

indicates the greatest integer function otherwise known as floor. Note this definition of significant decimal digits may not agree with the count obtained by other methods, but it is more convenient, and equally useful.

Problem 2.1. The fractions 227 , 333106 and 355113 are well-known approximations to π. Use the

formula above to find the the number of significant decimal digits in each. Does your understanding of significant digits agree with your calculated result?

Problem 2.2. Imagine an (impractical) binary floating point representation with exponent rang-

ing from − 63 to 64 and with a mantissa of length 12 bits. Assume only normalized representations are used and there is no packing.

A.) What is the largest exactly representable positive number?

B.) What is the smallest exactly representable positive number?

C.) What is the unit round?

Answers:

A.) 253

≈ 3. 69 × 1019

B.) 2 −^63 ≈ 1. 08 × 10 −^19

C.) 2 −^11 ≈ 4. 88 × 10 −^4

Problem 2.3. In the previous problem suppose we implement gradual underflow by allowing

denormals when the exponent is − 63. Suppose also we reserve the largest exponent, 64 , to designate ±∞, projective infinity, NaN’s and other special data. How does this affect the answers to the previous problem?

Problem 2.4. Imagine an (impractical) binary floating point representation with exponent rang-

ing from − 63 to 64 and with a mantissa of length 12 bits. Assume only normalized representations are used and the format is packed (that is, the most significant bit in the mantissa is not explicitly stored).

A.) What is the largest exactly representable positive number?

B.) What is the smallest exactly representable positive number?

C.) What is the unit round?

Problem 2.5. In the previous problem suppose we implement gradual underflow by allowing

denormals when the exponent is − 63. Suppose also we reserve the largest exponent, 64 , to designate ±∞, projective infinity, NaN’s and other special data. How does this affect the answers to the previous problem? Note that numbers with exponent − 63 are not packed (to allow for denormals).

Problem 2.6. Imagine an (impractical) binary floating point representation with exponent rang-

ing from − 63 to 64 and with a mantissa of length 12 bits. Assume only normalized representations are used and there is no packing. Find the error that we make when storing 113.2 (decimal)? Ans: 1 /80 = 0. 0125.

Problem 2.7. In the previous problem if the length of the mantissa is only 7 bits, what would

be the error in storing 113. 2?

3 Numeric Differentiation

Problem 3.1. Here is an unusual second order method for approximating the first derivative

f ′(a) =

− 5 f (a) + 9f (a + 2h) − 4 f (a + 3h) 6 h

+ O

h^2

Show that the error term can be written as

cf (3)(a)h^2 + O

h^3

and compute the constant c. Hint: Use Taylor expansions.

Problem 3.2. Here is an unusual first order method for approximating the second derivative

f ′′(a) =

f (a) − 3 f (a + 2h) + 2f (a + 3h) 3 h^2

  • O (h).

Show that the error term can be written as

cf (3)(a)h + O

h^2

and compute the constatnt c. Hint: Use TAYLOR expansions.

Here are a few standard numeric differentiation formulæ:

4 Roots. Midpoint Method

Problem 4.1. Show analytically that the polynomial

p(x) = x^3 − 6 x^2 + 9x − 5

has a root in the interval [4, 5]. Suppose we bisect the interval. (A) Which half of the interval can we guarantee contains a root? (B) If we use the midpoint of the subinterval containing the root to estimate the root give an upper bound for the error.

Problem 4.2. The polynomial

p(x) = x^3 − 3 x + 1

has a root in the interval [0, 1]. Use the bisection method (also called binary search method ) to locate the root with an error no larger than 161. (Your work must show clearly that you used the bisection method .)

Problem 4.3. Let p(x) = 2x^3 − 3 x^2 + 6x + 5. The polynomial p(x) has a root in the interval

[− 1 , 0]. (A) Suppose we bisect the interval. Which half of the interval can we guarantee contains a root. Why? (B) Bisect the subinterval known to contain a root. Which sub-sub-interval can we now guarantee contains the root? (C) If we use the midpoint of this last interval as an estimate of the root find an bound for the error that we make.

Problem 4.4. Show analytically that the polynomial

p(x) = 2x^4 − 4 x + 1

has a root in the interval [0, 1]. Suppose we bisect the interval. (A) Which half of the interval can we guarantee contains a root? (B) If we use the midpoint of the subinterval containing the root to estimate the root, give an upper bound for the error.

Problem 4.5. Show analytically that the polynomial

p(x) = x^5 + x + 1

has a root in the interval [− 1. 0 , − 0 .5]. Suppose we bisect the interval. (A) Which half of the interval can we guarantee contains a root? (B) If we use the midpoint of the subinterval containing the root to estimate the root, give an upper bound for the error.

Problem 4.6. Let f (x) = x + cos(x). Part (A). Show that the function f has exactly one root

in the interval [−π/ 2 , 0]. Part (B). Use the bisection method to obtain an estimate of the root with an error no larger than π/ 8. In part (B) you must give the estimate provided by application of the bisection method and explain it. I have no interest in the more accurate solution provided by your calculator.

5 Roots. NEWTON’s Method

This section deals with the NEWTON root estimate iteration

xn+1 = xn − f (xn) f ′(xn)

Problem 5.1. The polynomial

p(x) = x^5 + x + 1

has a root in the interval [− 1 , 0]. Use the midpoint of this interval as an initial guess and apply NEWTON’s method once. What is your new approximation to the root?

Problem 5.2. The polynomial

p(x) = x^3 − 3 x + 1

has a root in the interval [0, 1]. Use the midpoint of this interval as an initial guess and use one iteration of NEWTON’s method to obtain a new approximation to the root. (You must obtain exactly the value given by one iteration of NEWTON’s method.)

Problem 5.3. Let p(x) = x^3 + x^2 + 3x − 4. Let x 0 = 1 be an initial guess to a root. (A) Use

NEWTON’s method (twice) to compute successive approximations x 1 , x 2 to a root. (B) Estimate the error in the root estimate x 1. (C) Given that p(x) has only one real root,. 866369759... , find the actual errors in x 1 and x 2. How do they compare with your estimate of the error in x 1?

Problem 5.4. Find two interval of length 1 with integer endpoints, each interval guaranteed to

contain a root of f (x) = exp(x) − 6 x. Be sure to justify your answer (without finding the roots). Use an initial guess x 0 = 0 and apply NEWTON’s iteration once to obtain a new estimate x 1 for one of the roots.

Problem 5.5. Let a > 0 and let f (x) = x^3 − a. Suppose we decide to estimate the cube

root a^1 /^3 by applying NEWTON’s method to estimate the positive root of f (x). For n ≥ 0 find an expression for the (n + 1)st^ iterate xn+1 in terms of xn. Simplify.

Problem 5.6. One of the roots of the polynomial p(x) = x^2 − x − 1 is the golden ratio

5)/2 = 1. 6180339.... Use NEWTON’s method with initial “guess” x 0 = 2 for the root and compute the iterates x 1 , x 2 and x 3 and also the error in each iterate. Is the rate of convergence about what you would expect?

Problem 5.7. Let p(x) = x^5 − 3 x^3 + 4x + 5. Let x 0 = − 2 be an initial guess to a root.

Use NEWTON’s method to compute successive approximations x 1 , x 2 , x 3 , x 4 and x 5. Given that − 1. 627772774213681160... is the only real root of p(x) find the actual errors in the root estimates. Do they behave as you would expect?

Problem 5.8. Let

f (x) = x^7 + x^6 − 4 x^5 − 6 x^4 + 2x^3 + 8x^2 + 5x + 1

and let

g(x) =

f (x) f ′(x)

so g has the same roots as f , but the roots of g are all simple. Use an initial guess x 0 = 1. 1 and apply NEWTON’s method to f and to g. Comment on the rate of convergence (for example, compare the

errors) to the root

√ 5+ 2 = 1.^6180339887498948482045868343...^ (a double root for^ f^ ).

Accordingly, the next root estimate is

xn+1 = xn + δn = xn −

f (xn) f ′(xn)

HALLEY’s method results from taking a higher order TAYLOR expansion

0 = f (xn + δ) = f (xn) + f ′(xn)δ +

f ′′(ηn)δ^2

form some ηn between xn and xn + δ. This equation is quadratic in δ. We could use the quadratic formula, but we would probably get a headache. Instead note the δ which satisfies f (xn + δ) = 0 is given by

δ = −

f (xn) f ′(ξn)

where of course we do not know ξn. If we substitute this expression for one of the factors of δ in the δ^2 term we obtain

0 = f (xn) + f ′(xn)δ − f (xn)f ′′(ηn) 2 f ′(ξn)

It follows that

δ = −

2 f (xn)f ′(ξn) 2 f ′(xn)f ′(ξn) − f (xn)f ′′(ηn)

Thus, when all works well, we expect δ ≈ ∆n where

∆n = −

2 f (xn)f ′(xn) 2 f ′(xn)^2 − f (xn)f ′′(xn)

Setting xn+1 = xn + ∆n as the next root estimate we obtain HALLEY’s iteration

xn+1 = xn −

f (xn) f ′(xn)

f (xn)f ′′(xn) 2 f ′(xn)^2

If we start sufficiently close to a simple root α then some heavy algebra and analysis shows HAL- LEY’s method yields K(α − xn+1) ≈ (K(α − xn))^3

for a certain constant K, that is, HALLEY’s method is of order 3. In more prosaic terms, if we start sufficiently close to a simple root, then after things settle down we will see roughly a tripling of the number of significant digits with each iteration!

Problem 6.1. The increasing function f defined by

f (x) = x − cos(x)

has a simple root given approximately by

α = 0. 739085133215160641655312087673873404013411758900757465

Starting with an initial guess of x 0 = 0. 1 compute a few NEWTON and HALLEY iterations and the error in each. Comment on your results. Are your results consistent with your expectations? Note: The error in x 4 for NEWTON’s method is about − 1. 03 × 10 −^11 and for HALLEY’s method it is about

  1. 37 × 10 −^49. If you are using the limited precision of an ordinary calculator there is not much point in going past x 2 or x 3 in this example.

7 Roots. Secant Method

Problem 7.1. The polynomial

p(x) = x^3 − 3 x + 1

has a root in the interval [0, 1]. Use the points x 0 = 0. 0 and x 1 = 0. 5 as initial guesses and use one iteration of the secant method to obtain a new approximation to the root. (You must obtain exactly the value given by one iteration of the secant method.)

Problem 7.2. Let p(x) = x^5 − 3 x^3 + 4x + 5. Let x 0 = − 2. 0 and x 1 = − 1. 8 be initial guesses

to a root. Use the secant method to compute successive approximations x 2 , x 3 , x 4 and x 5. Given that − 1. 627772774213681160... is the only real root of p(x) find the actual errors in the root estimates. Do they behave as you would expect?

8 Roots. Miscellaneous

Problem 8.1. The polynomial p(x) = x^5 − 7 x^4 + 10x^2 − 1000 has a simple root at x = 5.

Thus for small  > 0 the polynomial p(x) + x^4 has a root at x = α() which is continuously differentiable in  and satisfies α(0) = 5. Compute the derivative α′(0).

Problem 8.2. The polynomial p(x) = x^5 − 7 x^4 + 10x^2 + 1000 has a simple root at x = 5.

Thus for small  > 0 the polynomial p(x) + x^4 has a root at x = α() which is continuously differentiable in  and satisfies α(0) = 5. Compute the derivative α′(0).

Problem 8.3. Let f (x) = exp(x) − x^2. Prove that f has precisely one real root. Explain why

the root must be in the interval (− 1 , 0). Hint: Sign change.

Problem 8.4. The polynomial p(x) = x^3 + x^2 − x − 1 has a simple root at x = 1. Thus for

small  > 0 the polynomial p(x) + x^2 has a root at x = α() which is continuously differentiable in  and satisfies α(0) = 1. Compute the derivative α′(0). Use your result to estimate a root of p(x) = x^3 + 1. 1 x^2 − x − 1.

9 Fixed Point Iteration

Problem 9.1. Let

g(x) = 1 +

x

Show that g has a unique positive fixed point α. Let x 0 = 2. Does the iteration xn+1 = g(xn) appear to converge to α.

Problem 9.2. If G(x) = 9+

x then G maps the interval I = [9, 49] into itself and | G′(x) | ≤ 5 6 for each^ x^ ∈^ I.^ Part (A).^ How do you know that^ G^ has a unique fixed point in^ [9,^ 49]?^ Part (B). If x 0 = 49 and we define xn+1 = G(xn)

Use the initial point (− 0. 8 , 0 .4) and iterate three times. Given that the actual solution is

(− 0. 865034729 , 0 .450902472)

compute the error in each of your iterates. Comment.

Problem 10.4. Repeat the previous problem, but using the “frozen coefficient matrix” algo-

rithm. Do several more iterations. Comments?

Problem 10.5. Use NEWTON’s method for systems to approximate a solution to the system of

equations

x^2 + y^2 + z^3 = 3 x + 2y − 2 z = 0 x^3 + y^3 − 3 z^2 = 2.

Use the initial point (1. 0 , − 1. 0 , 0) and iterate three times. Given that the actual solution is

(1. 44825 , − 0. 95663 , − 0 .23250)

compute the error in each of your iterates. Comment.

Problem 10.6. Repeat the previous problem, but using the “frozen coefficient matrix” algo-

rithm. Do several more iterations. Comments?

Problem 10.7. The solution of the system

x^2 + y^2 = 1 x^2 + y = − 1

is obviously (0, −1). Use the initial point (0. 25 , − 2 .0) and iterate 5 times. At each step compute the error in your iterate. What behavior of the errors do you observe?

Problem 10.8. Repeat the previous problem, but using the “frozen coefficient matrix” algo-

rithm. Do several more iterations. Comments?

Problem 10.9. Estimate the minimum point of

x^4 + 2y^4 + 3x^2 y^2 + 2xy^3 + 3x − 2 y^2 + 4

by setting the partial derivatives equal to 0 and using NEWTON’s method with 3 iterations and an initial guess of (− 1. 0 , 1 .0).

Problem 10.10. Repeat the previous problem, but using the “frozen coefficient matrix” algo-

rithm. Do several more iterations. Comments?

Problem 10.11. The system of equations

2 x^2 + y^2 = 4 x^2 − 4 xy − y^2 = 0

has four solutions. Use NEWTON’s method with the initial point (1. 0 , 1 .0) and with four iterations to estimate one solution. What happens if you use the initial points (− 1. 0 , 1 .0), (1. 0 , − 1 .0) or (− 1. 0 , − 1 .0)?

Problem 10.12. Repeat the previous problem, but using the “frozen coefficient matrix” algo-

rithm. Do several more iterations. Comments?

11 Secant Method for Systems

The secant iteration for approximating roots can be extended to systems of equations. This method has the advantage of not requiring derivatives, but it does require us to supply 3 initial points (in the case of 2 variables).

To estimate a solution to the system

f (x, y) = 0 g(x, y) = 0

we first choose 3 points (x 1 , y 1 ), (x 2 , y 2 ) and (x 3 , y 3 ) which are close to a solution. By evaluating f at these 3 points we obtain 3 points in 3-space, (xn, yn, f (xn, yn)), n = 1, 2 , 3. If these points are not collinear there is a unique plane P 1 through them. Likewise from g we obtain 3 points (xn, yn, g(xn, yn)), n = 1, 2 , 3. If these points are not collinear there is a unique plane P 2 through them. If the planes P 1 and P 2 are not parallel they intersect in a line and if this line is not parallel to the (x, y)-plane it meets that plane in a point (x 4 , y 4 ). Now use the points (x 2 , y 2 ), (x 3 , y 3 ) and (x 4 , y 4 ) and repeat the construction to obtain the next iterate (x 5 , y 5 ).

Problem 11.1. Use the secant method for systems to approximate a solution to the system of

equations

x^3 − 3 y + 2 = 0 y^3 − 2 x^2 + 3x + 4 = 0.

Use the initial points (− 0. 8 , 0 .4), (− 0. 8 , 0 .5) and (− 0. 9 , 0 .5) and iterate three times. Given that the actual solution is (− 0. 865034729 , 0 .450902472) compute the error in each of your iterates. Com- ment. Remark: As a check on your work note the first iterate is (− 0. 8646900900 , 0 .4492075016).

12 Interpolation polynomials

Problem 12.1. The function f (x) satisfies f (0) = 1, f (1) = 1 and f (2) = 2. (A) Find the

interpolation polynomial of degree at most 2 which interpolates f (x) between these points. (B) Use the result of part (A) to estimate f ( 32 ). (C) What estimate do you get for f ( 32 ) if you use linear interpolation between successive points?

Problem 12.12. Find the interpolation polynomial of degree ≤ 3 through the points (0, 2), (1, 0), (2, 3)

and (3, 1). Ans: − 53 x^3 + 152 x^2 − 476 x + 2

Problem 12.13. Given the following data

x 0 1 2 3 4 5 y 2 2 3 5 6 7

compute the interpolation polynomial of degree ≤ 5 with the given nodes. As a check on your work, compare your result with my graph below.

Interpolation Polynomial

x

13 Interpolation polynomials and NEWTON divided differences

DIVIDED DIFFERENCES

f [x 0 , x 1 ] =

f (x 1 ) − f (x 0 ) x 1 − x 0

f [x 0 , x 1 , · · · , xk ] =

f [x 1 , · · · , xk ] − f [x 0 , · · · , xk− 1 ] xk − x 0 Pn(x) = f (x 0 ) + f [x 0 , x 1 ](x − x 0 ) + · · · + f [x 0 , x 1 , · · · , xn](x − x 0 ) · · · (x − xn− 1 ) = Pn− 1 (x) + f [x 0 , x 1 , · · · , xn](x − x 0 ) · · · (x − xn− 1 )

where Pk (x) is the interpolation polynomial (of degree ≤ k) for the function f with nodes at x 0 , x 1 , · · · , xk.

A remarkable identity which holds for any function f is:

f (x) = Pn(x) + f [x 0 , x 1 , · · · , xn, x](x − x 0 )(x − x 1 ) · · · (x − xn).

A consequence of this identity is if we view Pn(x) as an approximation to f (x) then the error is given by 1 (n + 1)!

f (n+1)(ξ) (x − x 0 )(x − x 1 ) · · · (x − xn)

for some ξ between min(x 0 , x 1 , · · · , xn, x) and max(x 0 , x 1 , · · · , xn, x).

Problem 13.1. Let x 0 = 0, x 1 = 1. 5 and x 2 = 2 and suppose f (x 0 ) = 1, f (x 1 ) =

0 and f (x 2 ) = − 1. Compute the NEWTON divided differences f [x 0 , x 1 ] and f [x 0 , x 1 , x 2 ]. Find the linear interpolation polynomial P 1 (x) through the first two points and the quadratic inter- polation polynomial P 2 (x) through all three points. What estimates do these polynomials give for f (1)?

Problem 13.2. Let f (x) = x^3. Let x 0 , x 1 and x 2 be three distinct points. Compute the

NEWTON divided difference f [x 0 , x 1 , x 2 ].

Problem 13.3. For a certain function f (x) we know the NEWTON divided differences: f [−1] =

2 , f [− 1 , 1] = 1, f [− 1 , 1 , 2] = − 2 , f [− 1 , 1 , 2 , 4] = 2. (A) Find the interpolation polynomial P 3 (x) for f (x) of degree at most 3 with nodes at − 1 , 1 , 2 , 4. (B) Use the interpolation polynomial to estimate f (0). (C) Find a good upper bound for the absolute error in the estimate of f (0) given that |f [− 1 , 1 , 2 , 4 , x]| ≤ 1. 4 for all x in the interval [− 1 , 4].

Problem 13.4. Let f (x) = anxn^ +an− 1 xn−^1 +· · ·+a 1 x+a 0 be a polynomial of degree n and

let x 0 , x 1 , · · · , xn be any n + 1 distinct points. Use properties of the NEWTON divided differences to compute f [x 0 , x 1 , · · · , xn].

Problem 13.5. Carefully fill in the missing entries in the following table of NEWTON divided

differences. k 0 1 2 3 xk − 1 0 1 3 yk 1 0 − 1 2 f [xk− 1 , xk ] × − 1 − 1 f [xk− 2 , xk− 1 , xk ] × × f [xk− 3 , xk− 2 , xk− 1 , xk ] × × ×

Use the NEWTON divided differences to compute the interpolation polynomial of degree at most 3 for the 4 data points (xk , yk ) k = 0, · · · , 3.

Problem 13.6. Fill in the three missing entries in the following table of NEWTON divided

differences. k 0 1 2 3 xk − 1 1 2 4 yk 0 1 3 − 1 f [xk− 1 , xk ] × 1 / 2 2 f [xk− 2 , xk− 1 , xk ] × × − 4 / 3 f [xk− 3 , xk− 2 , xk− 1 , xk ] × × ×