0% found this document useful (0 votes)
6 views6 pages

III 5 Interpolation

The document discusses polynomial interpolation and quadrature, highlighting their intrinsic connection where interpolation leads to quadrature rules. It defines key concepts such as interpolatory polynomials, the Vandermonde matrix, and Lagrange basis polynomials, emphasizing the uniqueness of interpolatory polynomials and the ill-conditioning of interpolation at evenly spaced points. Additionally, it presents interpolatory quadrature rules and examples demonstrating their application and accuracy for polynomial integration.

Uploaded by

zorahz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views6 pages

III 5 Interpolation

The document discusses polynomial interpolation and quadrature, highlighting their intrinsic connection where interpolation leads to quadrature rules. It defines key concepts such as interpolatory polynomials, the Vandermonde matrix, and Lagrange basis polynomials, emphasizing the uniqueness of interpolatory polynomials and the ill-conditioning of interpolation at evenly spaced points. Additionally, it presents interpolatory quadrature rules and examples demonstrating their application and accuracy for polynomial integration.

Uploaded by

zorahz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

III.

5 Interpolation and quadrature


Polynomial interpolation is the process of finding a polynomial that equals data at a
precise set of points. Quadrature is the act of approximating an integral by a weighted
sum꞉
b n

∫ f (x)w(x)dx ≈ ∑ wj f (xj ).
a
j=1

In these notes we see that the two concepts are intrinsically linked꞉ interpolation leads
naturally to quadrature rules.
1. Polynomial Interpolation꞉ we describe how to interpolate a function by a polynomial
and a set of points.
2. Interpolatory quadrature rule꞉ polynomial interpolation leads naturally to ways to
integrate
functions, but onely realisable in the simplest cases.
1. Polynomial Interpolation
We already saw a special case of polynomial interpolation, where we saw that the
polynomial
n−1
n k
f (z) ≈ ∑ f̂ z
k
k=0

equaled at evenly spaced points on the unit circle꞉


f . But here we consider the
e
i2πj/n

following꞉
Definition 1 (interpolatory polynomial) Given distinct points
n and x1 , … , xn ∈ R n

samples f1 , … , fn ∈ R, a degree interpolatory polynomial satisfies


n − 1 p(x)

p(xj ) = fj

The easiest way to solve this problem is to invert the Vandermonde system꞉
Definition 2 (Vandermonde) The Vandermonde matrix associated with distinct points n

x1 , … , xn ∈ R is the matrix
n−1
1 x1 ⋯ x
⎡ 1 ⎤

⎢ ⎥
V ꞉= ⎢ ⎥
⎢ ⋮ ⋮ ⋱ ⋮ ⎥

⎣ n−1 ⎦
1 xn ⋯ xn
Proposition 1 (interpolatory polynomial uniqueness) The interpolatory polynomial is
unique, and the Vandermonde matrix is invertible.
Proof Suppose and are both interpolatory polynomials. Then
p p̃ vanishes
p(x) − p̃(x)

at distinct points . By the fundamental theorem of algebra it must be zero, i.e.,


n xj

p = p̃.
For the second part, if for
Vc = 0 then for
c ∈ R we have
q(x) = c1 + ⋯ + cn x
n−1


q(xj ) = e Vc = 0
j

hence vanishes at distinct points and is therefore 0, i.e.,


q n c = 0 .

Thus a quick‑and‑dirty way to to do interpolation is to invert the Vandermonde matrix


(which we saw in the least squares setting with more samples then coefficients)꞉
In [1]: using Plots, LinearAlgebra
f = x -> cos(10x)
n = 5

x = range(0, 1; length=n)# evenly spaced points (BAD for interpolation)


V = x .^ (0:n-1)' # Vandermonde matrix
c = V \ f.(x) # coefficients of interpolatory polynomial
p = x -> dot(c, x .^ (0:n-1))

g = range(0,1; length=1000) # plotting grid


plot(g, f.(g); label="function")
plot!(g, p.(g); label="interpolation")
scatter!(x, f.(x); label="samples")
Out[1]:

But it turns out we can also construct the interpolatory polynomial directly. We will use
the following which equal at one grid point and zero at the others꞉
1

Definition 3 (Lagrange basis polynomial) The Lagrange basis polynomial is defined as


x − xj (x − x1 ) ⋯ (x − xk−1 )(x − xk+1 ) ⋯ (x − xn )
ℓk (x) ꞉= ∏ =
j≠k xk − xj (xk − x1 ) ⋯ (xk − xk−1 )(xk − xk+1 ) ⋯ (xk − xn )

Plugging in the grid points verifies the following꞉


Proposition 2 (delta interpolation)
ℓk (xj ) = δkj

We can use these to construct the interpolatory polynomial꞉


Theorem 1 (Lagrange interpolation) The unique polynomial of degree at most n − 1

that interpolates at distinct points is꞉


f n xj

p(x) = f (x1 )ℓ1 (x) + ⋯ + f (xn )ℓn (x)

Proof Note that


n

p(xj ) = ∑ f (xj )ℓk (xj ) = f (xj )


j=1

so we just need to show it is unique. Suppose is a polynomial of degree at most


p̃(x)

n − 1 that also interpolates . Then


f vanishes at distinct points. Thus by the
p̃ − p n

fundamental theorem of algebra it must be zero.


Example 1 We can interpolate exp(x) at the points 0, 1, 2 ꞉


(x − 1)(x − 2) x(x − 2) x(x − 1)
2 2
p(x) = ℓ1 (x) + eℓ2 (x) + e ℓ3 (x) = + e + e
(−1)(−2) (−1) 2

2 2 2
= (1/2 − e + e /2)x + (−3/2 + 2e − e /2)x + 1

Remark Interpolating at evenly spaced points is a really bad idea꞉ interpolation is


inheritely ill‑conditioned. The labs have explored this issue experimentally.
2. Interpolatory quadrature rules
By integrating an interpolant exactly we get a simple approach to approximating
integrals. Using the Lagrange basis we can rewrite this procedure as a simple weighted
sum꞉
Definition 4 (interpolatory quadrature rule) Given a set of points the x = [x1 , … , xn ]

interpolatory quadrature rule is꞉


n
w,x
Σn [f ] ꞉= ∑ wj f (xj )
j=1

where
b

wj ꞉= ∫ ℓj (x)w(x)dx
a

Proposition 3 (interpolatory quadrature is exact for polynomials) Interpolatory


quadrature is exact for all degree polynomials ꞉
n − 1 p

w,x
∫ p(x)w(x)dx = Σn [p]
a

Proof The result follows since, by uniqueness of interpolatory polynomial꞉


n

p(x) = ∑ p(xj )ℓj (x)


j=1

Example 2 (arbitrary points) Find the interpolatory quadrature rule for w(x) = 1 on
with points
[0, 1] ? We have꞉
[x1 , x2 , x3 ] = [0, 1/4, 1]
1 1
(x − 1/4)(x − 1)
w1 = ∫ w(x)ℓ1 (x)dx = ∫ dx = −1/6
0 0
(−1/4)(−1)

1 1
x(x − 1)
w2 = ∫ w(x)ℓ2 (x)dx = ∫ dx = 8/9
0 0
(1/4)(−3/4)

1 1
x(x − 1/4)
w3 = ∫ w(x)ℓ3 (x)dx = ∫ dx = 5/18
0 0
3/4

That is we have
f (0) 8f (1/4) 5f (1)
w,x
Σn [f ] = − + +
6 9 18

This is indeed exact for polynomials up to degree (and no more)꞉ 2

w,x w,x w,x 2 w,x 3


Σn [1] = 1, Σn [x] = 1/2, Σn [x ] = 1/3, Σn [x ] = 7/24 ≠ 1/4.

Example 3 (Chebyshev roots) Find the interpolatory quadrature rule for


w(x) = 1/√1 − x on 2
with points equal to the roots of
[−1, 1] . This is a special T3 (x)

case of Gaussian quadrature which we will approach in another way below. We use꞉
1 1 1

2
∫ w(x)dx = π, ∫ xw(x)dx = 0, ∫ x w(x)dx = π/2
−1 −1 −1

Recall from before that x1 , x2 , x3 = √3/2, 0, −√3/2 . Thus we have꞉


1 1
x(x + √3/2) π
w1 = ∫ w(x)ℓ1 (x)dx = ∫ dx =
(√3/2)√3√1 − x2 3
−1 −1

1 1
(x − √3/2)(x + √3/2) π
w2 = ∫ w(x)ℓ2 (x)dx = ∫ dx =
(−3/4)√1 − x2 3
−1 −1

1 1
(x − √3/2)x π
w3 = ∫ w(x)ℓ3 (x)dx = ∫ dx =
(−√3)(−√3/2)√1 − x2 3
−1 −1

(It's not a coincidence that they are all the same but this will differ for roots of other
OPs.) That is we have
π
w,x
Σn [f ] = (f (√3/2) + f (0) + f (−√3/2)
3

This is indeed exact for polynomials up to degree n − 1 = 2 , but it goes all the way up
to2n − 1 = 5 ꞉
π
w,x w,x w,x 2
Σn [1] = π, Σn [x] = 0, Σn [x ] = ,
2

w,x 3 w,x 4 w,x 5
Σn [x ] = 0, Σn [x ] = , Σn [x ] = 0
8

9π 5π
w,x 6
Σn [x ] = ≠
32 16
We shall explain this miracle in the next chapter.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy