Approximating Functions with Neville's Algorithm and Divided Differences in MATH 128A, Assignments of Mathematical Methods for Numerical Analysis and Optimization

Solutions to problem 3.1.5a and 3.3.1a from the math 128a, summer 2009 homework. It explains how to minimize the error bound using neville's algorithm and construct a divided-difference table to find the coefficients for the newton form of the approximating polynomial.

Typology: Assignments

Pre 2010

Uploaded on 10/01/2009

koofers-user-7dv
koofers-user-7dv 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
MATH 128A, SUMMER 2009: HOMEWORK 3 SOLUTIONS
3.1.5a. To minimize the error bound, we should take as our xithe (n+ 1) points nearest x= 8.4. When
n= 2 there’s a tie; both reasonable answers are shown below.
octave:1> format long
octave:2> neville(8.4,[8.3,8.6], [17.56492, 18.50515]) %n=1
ans = 17.8783300000000
octave:3> neville(8.4,[8.3,8.6,8.1], [17.56492, 18.50515, 16.94410]) %n=2
ans = 17.8771300000000
octave:4> neville(8.4,[8.3,8.6,8.7], [17.56492, 18.50515, 18.82091]) %n=2
ans = 17.8771550000000
octave:5> neville(8.4,[8.3,8.6,8.1,8.7], [17.56492, 18.50515, 16.94410, 18.82091]) %n=3
ans = 17.8771425000000
3.1.19c. There are many ways to find the polynomial. A correct answer, when expanded with a calculator,
should come out to P(x)=0.1970056667x31.06259055x2+ 2.532453189x1.666868305. The
error, for x[1,1.4], is of the form ln(4) (ξ(x))
4! (x1)(x1.1)(x1.3)(x1.4). Since ln(4)(ξ) =
(3)(2)(1)x4=6ξ4, it’s at worst 6(1)4=6. |(x1)(x1.1)(x1.3)(x1.4)|is at
most 4 ·104, attained when x= 1.2. So P(x) approximates ln(x) to within 104on [1,1.4].
Extra. f[0,1,2] = f[1,2]f[0,1]
20=
f[2]f[1]
21f[1]f[0]
10
2=(81)(10)
2= 3.
3.2.11. (a) Calculation shows P(x) = f(x) and Q(x) = f(x) for x=2,1,0,1,2.
(b) Both polynomials are equal (to x33x+ 1), just written in a different form.
3.3.1a. Construct a divided-difference table as follows.
x0= 8.3f[x0] = f(8.3) = 17.56492
f[x0, z0] = f0(8.3) = 3.116256
z0= 8.3f[z0] = f(8.3) = 17.56492 0.0594800
f[z0, x1] = · · · · · · = 3.134100 0.002022222
x1= 8.6f[x1] = f(8.6) = 18.50515 0.0588733
f[x1, z1] = f0(8.3) = 3.151762
z1= 8.6f[z1] = f(8.6) = 18.50515
(See, e.g.,
Table 3.13 in the text.) The coefficients for the Newton form of the approximating polynomial are on the top
edge of this table: H(x) = 17.56492 +3.116256(x8.3) +0.0594800(x8.3)20.002022222(x8.3)2(x8.6).
Date: Due Thursday 7/09.
1

Partial preview of the text

Download Approximating Functions with Neville's Algorithm and Divided Differences in MATH 128A and more Assignments Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

MATH 128A, SUMMER 2009: HOMEWORK 3 SOLUTIONS

3.1.5a. To minimize the error bound, we should take as our xi the (n + 1) points nearest x = 8.4. When n = 2 there’s a tie; both reasonable answers are shown below. octave:1> format long octave:2> neville(8.4,[8.3,8.6], [17.56492, 18.50515]) %n= ans = 17. octave:3> neville(8.4,[8.3,8.6,8.1], [17.56492, 18.50515, 16.94410]) %n= ans = 17. octave:4> neville(8.4,[8.3,8.6,8.7], [17.56492, 18.50515, 18.82091]) %n= ans = 17. octave:5> neville(8.4,[8.3,8.6,8.1,8.7], [17.56492, 18.50515, 16.94410, 18.82091]) %n= ans = 17.

3.1.19c. There are many ways to find the polynomial. A correct answer, when expanded with a calculator, should come out to P (x) = 0. 1970056667 x^3 − 1. 06259055 x^2 + 2. 532453189 x − 1 .666868305. The error, for x ∈ [1, 1 .4], is of the form ln

(4)(ξ(x)) 4! (x^ −^ 1)(x^ −^1 .1)(x^ −^1 .3)(x^ −^1 .4).^ Since ln

(4)(ξ) = (−3)(−2)(−1)x−^4 = − 6 ξ−^4 , it’s at worst −6(1)−^4 = −6. |(x − 1)(x − 1 .1)(x − 1 .3)(x − 1 .4)| is at most 4 · 10 −^4 , attained when x = 1.2. So P (x) approximates ln(x) to within 10−^4 on [1, 1 .4]. Extra. f [0, 1 , 2] = f^ [1,2] 2 −−f 0 [0,1]=

f [2]−f [1] 2 − 1 −^ f [1]−f [0] 1 − 0 2 =^

(8−1)−(1−0) 2 = 3. 3.2.11. (a) Calculation shows P (x) = f (x) and Q(x) = f (x) for x = − 2 , − 1 , 0 , 1 , 2. (b) Both polynomials are equal (to x^3 − 3 x + 1), just written in a different form. 3.3.1a. Construct a divided-difference table as follows. x 0 = 8. 3 f [x 0 ] = f (8.3) = 17. 56492 f [x 0 , z 0 ] = f ′(8.3) = 3. 116256 z 0 = 8. 3 f [z 0 ] = f (8.3) = 17. 56492 0. 0594800 f [z 0 , x 1 ] = · · · · · · = 3. 134100 − 0. 002022222 x 1 = 8. 6 f [x 1 ] = f (8.6) = 18. 50515 0. 0588733 f [x 1 , z 1 ] = f ′(8.3) = 3. 151762 z 1 = 8. 6 f [z 1 ] = f (8.6) = 18. 50515

(See, e.g.,

Table 3.13 in the text.) The coefficients for the Newton form of the approximating polynomial are on the top edge of this table: H(x) = 17.56492+3.116256(x− 8 .3)+0.0594800(x− 8 .3)^2 − 0 .002022222(x− 8 .3)^2 (x− 8 .6).

Date: Due Thursday 7/09. 1