Hermite Interpolating Polynomials and Gauss-Legendre Quadrature
Hermite Interpolating Polynomials and Gauss-Legendre Quadrature
Hermite Interpolating Polynomials and Gauss-Legendre Quadrature
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>Hermite</strong> <strong>Interpolating</strong> <strong>Polynomials</strong><br />
<strong>and</strong> <strong>Gauss</strong>-<strong>Legendre</strong> <strong>Quadrature</strong><br />
M581 Supplemental Notes October 3, 2005<br />
Lagrange Interpolation.<br />
Given data discrete points {x1, . . . , xQ} in 1-D <strong>and</strong> given a function f that is defined<br />
at these points, the Lagrange interpolating polynomial is the unique polynomial L of degree<br />
Q − 1 which interpolates the function f at these points. By this we mean<br />
The st<strong>and</strong>ard form for L is<br />
L(xi) = f(xi), i = 1, . . . , Q. (1)<br />
Q<br />
L(x) = cjx<br />
j=1<br />
j−1 . (2)<br />
The coefficients of L can be determined by substituting (2) into (1) <strong>and</strong> solving the resulting<br />
Q×Q linear system for the cj. Alternatively, L one can compute the Lagrange representation<br />
where the Lagrange basis functions are defined by<br />
ℓi(x) =<br />
<br />
1≤k≤Q,k=i(x − xk)<br />
<br />
1≤k≤Q,k=i(xi − xk)<br />
Note that for each i, j = 1, . . . , Q,<br />
Q<br />
L(x) = f(xi) ℓi(x), (3)<br />
i=1<br />
= (x − x1) · · · (x − xi−1)(x − xi+1) · · · (x − xQ)<br />
(xi − x1) · · · (xi − xi−1)(xi − xi+1) · · · (xi − xQ)<br />
ℓi(xj) = δi,j,<br />
where δi,j denotes the Kronacker delta, whose value is 1 of i = j <strong>and</strong> 0 if i = j.<br />
<strong>Quadrature</strong> Rules Based on Lagrange Interpolation.<br />
By integrating (3) we obtain the Lagrange quadrature rule,<br />
where the quadrature weights are given by<br />
b<br />
Q<br />
f(x) dx ≈ f(xi) wi<br />
a<br />
i=1<br />
wi =<br />
b<br />
a<br />
(4)<br />
(5)<br />
ℓi(x) dx. (6)<br />
Example 1: The Lagrange form of the polynomial which interpolates f(x) at x1 = a <strong>and</strong><br />
x2 = b is<br />
x − b x − a<br />
L(x) = f(a) · + f(b) ·<br />
a − b b − a .<br />
1
Integrating L(x) over the interval a ≤ x ≤ b yields the trapazoidal rule<br />
b<br />
a<br />
f(x) dx ≈<br />
b<br />
b<br />
f(a) (x − b) dx/(a − b) + f(b) (x − a) dx/(b − a)<br />
a<br />
a<br />
= f(a) ·<br />
b − a<br />
2<br />
+ f(b) · b − a<br />
2 ,<br />
Here Q = 2, the quadrature points are x1 = a, x2 = b, <strong>and</strong> the quadrature weights are<br />
w1 = w2 = b−a<br />
2 .<br />
Error Analysis for Lagrange <strong>Quadrature</strong>.<br />
If L(x) is the polynomial of degree Q − 1 which interpolates f(x) at {xi} Q<br />
i=1 <strong>and</strong> if<br />
f ∈ C Q [a, b], then it can be shown that the pointwise approximation error is given by<br />
where<br />
f(x) − L(x) = 1 d<br />
Q!<br />
Qf dxQ (ξx) π(x), for some ξx ∈ (a, b), (7)<br />
Q<br />
π(x) ≡ (x − xk) = (x − x1)(x − x2) · · · (x − xQ). (8)<br />
k=1<br />
By integrating (7) we obtain the quadrature error bounds<br />
<br />
<br />
<br />
b<br />
Q<br />
<br />
<br />
<br />
f(x)dx − f(xq)wq<br />
<br />
<br />
a<br />
q=0 <br />
=<br />
<br />
1 <br />
b<br />
d<br />
<br />
Q! a<br />
Qf dxQ (ξx)<br />
≤<br />
<br />
<br />
<br />
π(x) dx<br />
<br />
1<br />
Q! max<br />
<br />
<br />
d<br />
<br />
a≤ξ≤b <br />
Q ≤<br />
<br />
f b<br />
<br />
(ξ) |π(x)| dx<br />
dxQ a<br />
(9)<br />
1<br />
Q! max<br />
<br />
<br />
d<br />
<br />
a≤ξ≤b <br />
Q <br />
f <br />
<br />
(ξ) <br />
dxQ max<br />
a≤x≤b |π(x)|<br />
b<br />
dx<br />
a<br />
≤ const (b − a) Q+1 . (10)<br />
Defining the interval length h = b − a, we obtain O(h Q+1 ) accuracy. The quadrature rule is<br />
exact (i.e., there is no quadrature error) for all polynomials of degree ≤ Q − 1 because the<br />
Qth derivative of these polynomials vanishes.<br />
Continuation of Example 1: For the trapazoidal rule, Q = 2, so the method is exact for<br />
polynomials of degree ≤ 1 <strong>and</strong> the accuracy is O(h 3 ) provided the function being integrated<br />
is twice continuously differentiable.<br />
Exercise 1. Derive Simpson’s rule, which is based on interpolation at points a, (a + b)/2,<br />
<strong>and</strong> b, <strong>and</strong> show that the accuracy is O(h 4 ), where h = b − a.<br />
<strong>Hermite</strong> Interpolation.<br />
Given a differentiable function f defined on discrete points {x1, . . . , xQ}, the <strong>Hermite</strong><br />
interpolating polynomial is the unique polynomial H of degree 2Q − 1 that interpolates f<br />
<strong>and</strong> its derivative,<br />
H(xi) = f(xi),<br />
dH<br />
dx (xi) = df<br />
dx (xi), i = 1, . . . , Q. (11)<br />
2
H(x) does have a st<strong>and</strong>ard representation which is analogous to eqn (2), but to derive<br />
quadrature rules it is convenient to use the <strong>Hermite</strong> representation<br />
where<br />
Q<br />
H(x) = f(xi) hi(x) +<br />
Q<br />
i=1<br />
i=1<br />
hi(x) =<br />
<br />
1 − 2 dℓi<br />
dx (xi)<br />
<br />
(x − xi)<br />
df<br />
dx (xi) hi(x), (12)<br />
ℓ 2 i (x) (13)<br />
hi(x) = (x − xi) ℓ 2 i (x) (14)<br />
with Lagrange basis functions ℓi defined as before in (4).<br />
Exercise 2. Verify that for each i, j = 1, . . . , Q,<br />
hi(xj) = δij,<br />
hi(xj) = 0,<br />
<strong>and</strong> hence, the interpolation conditions (11) hold.<br />
<strong>Gauss</strong>-<strong>Legendre</strong> <strong>Quadrature</strong>.<br />
By integrating (12) we obtain a <strong>Hermite</strong> quadrature rule<br />
b<br />
Q<br />
b<br />
f(x) dx ≈ f(xi) hi(x) dx +<br />
a<br />
i=1<br />
a<br />
<br />
wi<br />
dhi<br />
dx (xj) = 0, (15)<br />
dhi<br />
dx (xj) = δij, (16)<br />
Q<br />
i=1<br />
df<br />
dx (xi)<br />
b<br />
hi(x) dx<br />
a<br />
<br />
wi<br />
. (17)<br />
The key to obtaining a numerical integration scheme, called <strong>Gauss</strong>-<strong>Legendre</strong> quadrature,<br />
which is exact for all polynomials of degree ≤ degree 2Q − 1 is to pick the quadrature points<br />
to be (possibly transformed) roots of <strong>Legendre</strong> polynomials. This will cause the terms wi in<br />
the second sum in (17) to vanish.<br />
Let PQ denote the Qth <strong>Legendre</strong> polynomial. This has leading coefficient 1 <strong>and</strong> it is<br />
orthogonal on the interval [−1, 1] to <strong>Legendre</strong> polynomials Pi of lower degree,<br />
1<br />
PQ(x) Pi(x) dx = 0, i = 1, . . . , Q − 1.<br />
−1<br />
Since any polynomial can be expressed as a linear combination of <strong>Legendre</strong> polynomials,<br />
1<br />
PQ(x)ρ(x) dx for any polynomial ρ of degree < Q. (18)<br />
−1<br />
From (14) one can factor<br />
hi(x) = (x − xi)ℓi(x) ℓi(x) = π(x) × Cℓi(x), (19)<br />
where π is the degree Q polynomial defined in (8) <strong>and</strong> C is some constant. Note that the<br />
degree of ℓi is Q − 1. By selecting the xis to be the roots of the Qth <strong>Legendre</strong> polynomial<br />
PQ, we obtain π(x) = PQ(x), <strong>and</strong> from (18) <strong>and</strong> (19) we obtain<br />
wi =<br />
1<br />
−1<br />
hi(x) dx = 0.<br />
3
Consequently<br />
where<br />
1<br />
Q<br />
f(x) dx ≈ f(xi) wi<br />
−1<br />
i=1<br />
wi =<br />
1<br />
−1<br />
hi(x) dx<br />
whenever the quadrature points xi are taken to be the roots of the <strong>Legendre</strong> polynomial of<br />
degree Q.<br />
Exercise 3. Obtain a corresponding quadrature rule for an arbitrary interval [a, b], by<br />
deriving the linear transformation that maps [a, b] onto [−1, 1] <strong>and</strong> then applying the change<br />
of variables formula for integrals. Provide explicit formulas for the quadrature points <strong>and</strong><br />
weights for [a, b] in terms of the quadrature points <strong>and</strong> weights for [−1, 1].<br />
Error Analysis for <strong>Gauss</strong>-<strong>Legendre</strong> <strong>Quadrature</strong>.<br />
If f ∈ C 2Q [a, b] <strong>and</strong> we select <strong>Gauss</strong>-<strong>Legendre</strong> quadrature points for interpolation, then<br />
f(x) = H(x) + 1 d<br />
(2Q)!<br />
Qf dxQ (ξx) π 2 (x),<br />
where H is the degree 2Q − 1 <strong>Hermite</strong> interpolating polynomial, ξx is some point in the<br />
interval (a, b), <strong>and</strong> π is defined in (8). From the derivations above we obtain<br />
b<br />
a<br />
f(x) dx =<br />
=<br />
b<br />
a<br />
Q<br />
i=1<br />
H(x) dx + 1<br />
b d<br />
(2Q)! a<br />
Qf dxQ (ξx) π 2 (x) dx<br />
f(xi) wi + O(h 2Q+1 ),<br />
with h = b − a. The error term derivation follows as in the case of Lagrange quadrature<br />
error.<br />
The following table summarizes the first two <strong>Gauss</strong>ian quadrature rules for the interval<br />
[−1, 1].<br />
Q = 1 Q = 2<br />
w1 = 2 w1 = w2 = 1<br />
x1 = 0 x1, x2 = ∓ 1<br />
√ 3<br />
3 nd order accuracy 5 th order accuracy<br />
Exercise 4. Derive the <strong>Gauss</strong>ian quadrature rules in the table above. Then give corresponding<br />
rules (i.e., points <strong>and</strong> weights) for the interval [0, 1].<br />
4