Docsity

Interpolation Polynomials and Basis Functions in Math 128A, Spring 2007, Assignments of Mathematical Methods for Numerical Analysis and Optimization

Toggle sidebar
bg1
Math 128A, Spring 2007
Homework 3 Solution
4.1.12 (a) L0(x) + L1(x) + L2(x) + L3(x) is the unique polynomial of degree ≤3
interpolating the data (x0,1),(x1,1),(x2,1),(x3,1). Since the polynomial
1 also has degree ≤3 and interpolates the data, we conclude
L0(x) + L1(x) + L2(x) + L3(x) = 1.
(b) In general, L0(x) + ···Ln(x) and 1 are both degree ≤ninterpolants
of (x0,1), . . . , (xn,1), and therefore must be equal.
4.1.13 For j≤3, note that xj
0L0(x)+xj
1L1(x)+xj
2L2(x)+xj
3L3(x) and xjare both
polynomials of degree ≤3 interpolating (x0, xj
0),(x1, xj
1),(x2, xj
2),(x3, xj
3).
Since such interpolants are unique, the two polynomials must be equal.
For j > 3, note that each Li(x) has degree ≤3, so a linear combination
of them can’t have the same degree as xj.
4.1.15 Note: this is the complicated solution.
In analogy to the Lagrange basis {Li(x)}, we want to find a basis {Hi(x)}
for the (vector space of) polynomials of degree ≤3 so that the coordinates
of P(x) with respect to {Hi(x)}are (y0, y0
0, y1, y0
1). The analogous versions
of the requirements
Li(xj) = δij
are
H2i(xj) = δij H0
2i(xj) = 0
H2i+1(xj) = 0 H0
2i+1(xj) = δij
These insure, for example, that H0(x) controls the value of P(x) at 0, but
doesn’t affect the value of P(x) at 1 or the derivative of P(x) at 0 or 1.
The requirements are met by the polynomials
H2i(x) = (1 −2L0
i(xi)(x−xi))L2
i(x) and H2i+1(x) = (x−xi)L2
i(x)
where L0(x) and L1(x) are the usual Lagrange basis elements. I.e.
H0(x) = 1−2
x0−x1
(x−x0) x−x1
x0−x12
H1(x) = (x−x0)x−x1
x0−x12
H2(x) = 1−2
x1−x0
(x−x1) x−x0
x1−x02
H3(x) = (x−x1)x−x0
x1−x02
1
pf3
pf4

Partial preview of the text

Download Interpolation Polynomials and Basis Functions in Math 128A, Spring 2007 and more Assignments Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

Math 128A, Spring 2007

Homework 3 Solution

4.1.12 (a) L 0 (x) + L 1 (x) + L 2 (x) + L 3 (x) is the unique polynomial of degree ≤ 3 interpolating the data (x 0 , 1), (x 1 , 1), (x 2 , 1), (x 3 , 1). Since the polynomial 1 also has degree ≤ 3 and interpolates the data, we conclude

L 0 (x) + L 1 (x) + L 2 (x) + L 3 (x) = 1.

(b) In general, L 0 (x) + · · · Ln(x) and 1 are both degree ≤ n interpolants of (x 0 , 1),... , (xn, 1), and therefore must be equal.

4.1.13 For j ≤ 3, note that xj 0 L 0 (x)+xj 1 L 1 (x)+xj 2 L 2 (x)+xj 3 L 3 (x) and xj^ are both polynomials of degree ≤ 3 interpolating (x 0 , xj 0 ), (x 1 , xj 1 ), (x 2 , xj 2 ), (x 3 , xj 3 ). Since such interpolants are unique, the two polynomials must be equal. For j > 3, note that each Li(x) has degree ≤ 3, so a linear combination of them can’t have the same degree as xj^.

4.1.15 Note: this is the complicated solution.

In analogy to the Lagrange basis {Li(x)}, we want to find a basis {Hi(x)} for the (vector space of) polynomials of degree ≤ 3 so that the coordinates of P (x) with respect to {Hi(x)} are (y 0 , y 0 ′, y 1 , y′ 1 ). The analogous versions of the requirements Li(xj ) = δij are

H 2 i(xj ) = δij H′ 2 i(xj ) = 0 H 2 i+1(xj ) = 0 H′ 2 i+1(xj ) = δij

These insure, for example, that H 0 (x) controls the value of P (x) at 0, but doesn’t affect the value of P (x) at 1 or the derivative of P (x) at 0 or 1. The requirements are met by the polynomials

H 2 i(x) = (1 − 2 L′ i(xi)(x − xi))L^2 i (x) and H 2 i+1(x) = (x − xi)L^2 i (x)

where L 0 (x) and L 1 (x) are the usual Lagrange basis elements. I.e.

H 0 (x) =

x 0 − x 1 (x − x 0 )

x − x 1 x 0 − x 1

H 1 (x) = (x − x 0 )

x − x 1 x 0 − x 1

H 2 (x) =

x 1 − x 0

(x − x 1 )

x − x 0 x 1 − x 0

H 3 (x) = (x − x 1 )

x − x 0 x 1 − x 0

and P (x) = y 0 H 0 (x) + y′ 0 H 1 (x) + y 1 H 2 (x) + y′ 1 H 3 (x)

4.1.16 The divided differences are easy to compute

i xi f [xi] f [xi, xi+1] f [xi, xi+1, xi+2] 0 0 − 1 0 2 1 1 − 1 4 2 1 − 1

(remember that f [x, x] = f ′(x)!) and the polynomial just as easy to read off from the top row:

P (x) = −1 + 0 · x + 2 · x(x − 1)

The method of the previous problem is more complicated. We want poly- nomials {Qi(x)} for i = 0, 1 , 2 which form a basis for the polynomials of degree ≤ 2 so that the coordinates of the polynomial we’re looking for are (− 1 , − 1 , 4). In particular, we require

Q 0 (0) = 1 Q 0 (1) = 0 Q′ 0 (1) = 0 Q 1 (0) = 0 Q 1 (1) = 1 Q′ 1 (1) = 0 Q 2 (0) = 0 Q 2 (1) = 0 Q′ 2 (1) = 1

So we find solutions:

Q 0 (x) = (x − 1)^2 , Q 1 (x) = 1 − (x − 1)^2 , and Q 2 (x) = x(x − 1)

and then write

P (x) = − 1 · (x − 1)^2 − 1 · (1 − (x − 1)^2 ) + 4 · x(x − 1)

4.1.28 Because we have 6 data points and the original polynomial has degree ≤ 5, we know that the interpolating polynomial is the original polynomial. The divided difference algorithm:

i xi f [xi] · · · 0 − 2 − 5 6 − 3 1 0 0 1 − 1 1 0 0 1 0 2 0 1 0 3 1 3 1 1 6 6 4 2 7 18 5 3 25

yields

p(x) = −5 + 6(x + 2) − 3(x + 2)(x + 1) + 1(x + 2)(x + 1)x

so p(x) has degree 3.

and, since the xis have even spacing h,

|x − xn+1| ≤ |x 0 − xn+1| = (n + 1)h

Putting these together yields

|(x − x 0 ) · · · (x − xn)| ≤ (n + 1)!hn+

If instead x ∈ [x 1 , xn+1], a symmetric argument yields the same conclu- sion.

4.2.14 We compute

|ex^ − Pn(x)| ≤

(x − x 0 ) · · · (x − xn) n! ec

n!(1/n)n+ n!

ec^ ≤ (1/n)n+1ec^ ≤ (1/n)n+1e → 0