For a positive weight function, we want to compute
I ( f ) = ∫ a b w ( x ) f ( x ) d x ≈ I n ( f ) = ∑ j = 1 n w j f ( x j ) I(f) = \int_a^b w(x) f(x) \ud x \approx I_n(f) = \sum_{j=1}^n w_j f(x_j) I ( f ) = ∫ a b w ( x ) f ( x ) d x ≈ I n ( f ) = j = 1 ∑ n w j f ( x j ) Moreover, we want the degree of precision of I n I_n I n to be as large as
possible, i.e., 2 n − 1 2n-1 2 n − 1 . The main idea is to construct the Hermite
interpolant of f ( x ) f(x) f ( x ) and take I n ( f ) I_n(f) I n ( f ) to be the exact integral of the
Hermite interpolant.
1 General case ¶ Let { ϕ n } \{ \phi_n\} { ϕ n } be an orthogonal family of polynomials on [ a , b ] [a,b] [ a , b ] with
respect to the above weight function w w w . Denote the zeros of
ϕ n ( x ) \phi_n(x) ϕ n ( x ) by
a < x 1 < x 2 < … < x n < b a < x_1 < x_2 < \ldots < x_n < b a < x 1 < x 2 < … < x n < b These zeroes will
come out as the nodes in the integration formula I n ( f ) I_n(f) I n ( f ) . We recall
some notation used previously. We write ϕ n \phi_n ϕ n in terms of monomials
ϕ n ( x ) = A n x n + B n x n − 1 + … \phi_n(x) = A_n x^n + B_n x^{n-1} + \ldots ϕ n ( x ) = A n x n + B n x n − 1 + … and define
a n = A n + 1 A n , γ n = ( ϕ n , ϕ n ) = ∫ a b w ( x ) [ ϕ n ( x ) ] 2 d x a_n = \frac{A_{n+1}}{A_n}, \qquad \gamma_n = \ip{\phi_n, \phi_n} = \int_a^b w(x) [\phi_n(x)]^2 \ud x a n = A n A n + 1 , γ n = ( ϕ n , ϕ n ) = ∫ a b w ( x ) [ ϕ n ( x ) ] 2 d x For each n ≥ 1 n \ge 1 n ≥ 1 , there is a numerical integration formula I n ( f ) I_n(f) I n ( f ) of
degree of precision 2 n − 1 2n-1 2 n − 1 . Assuming f ∈ C 2 n [ a , b ] f \in \cts^{2n}[a,b] f ∈ C 2 n [ a , b ]
∫ a b w ( x ) f ( x ) d x = ∑ j = 1 n w j f ( x j ) + γ n A n 2 ( 2 n ) ! f ( 2 n ) ( η ) , η ∈ [ a , b ] \int_a^b w(x) f(x) \ud x = \sum_{j=1}^n w_j f(x_j) + \frac{\gamma_n}{A_n^2 (2n)!} f^{(2n)}(\eta), \qquad \eta \in [a,b] ∫ a b w ( x ) f ( x ) d x = j = 1 ∑ n w j f ( x j ) + A n 2 ( 2 n )! γ n f ( 2 n ) ( η ) , η ∈ [ a , b ] The nodes { x j } \{x_j\} { x j } are the zeros of ϕ n ( x ) \phi_n(x) ϕ n ( x ) and
w j = − a n γ n ϕ n ′ ( x j ) ϕ n + 1 ( x j ) w_j = -\frac{a_n \gamma_n}{\phi_n'(x_j) \phi_{n+1}(x_j)} w j = − ϕ n ′ ( x j ) ϕ n + 1 ( x j ) a n γ n (a) Construction of the formula : We will use Hermite
interpolation at the n n n zeros of ϕ n \phi_n ϕ n to construct the quadrature
rule. The interpolant is given by[1]
H n ( x ) = ∑ j = 1 n f ( x j ) h j ( x ) + ∑ j = 1 n f ′ ( x j ) h ~ j ( x ) H_n(x) = \sum_{j=1}^n f(x_j) h_j(x) + \sum_{j=1}^n f'(x_j) \tilde{h}_j(x) H n ( x ) = j = 1 ∑ n f ( x j ) h j ( x ) + j = 1 ∑ n f ′ ( x j ) h ~ j ( x ) where
h j ( x ) = [ 1 − 2 ℓ j ′ ( x j ) ( x − x j ) ] [ ℓ j ( x ) ] 2 , h ~ j ( x ) = ( x − x j ) [ ℓ j ( x ) ] 2 h_j(x) = [1 - 2\ell_j'(x_j)(x-x_j)] [\ell_j(x)]^2, \qquad \tilde{h}_j(x) = (x-x_j) [\ell_j(x)]^2 h j ( x ) = [ 1 − 2 ℓ j ′ ( x j ) ( x − x j )] [ ℓ j ( x ) ] 2 , h ~ j ( x ) = ( x − x j ) [ ℓ j ( x ) ] 2 and
ℓ j ( x ) = ∏ i = 1 , i ≠ j n x − x i x j − x i \ell_j(x) = \prod_{i=1,i\ne j}^n \frac{x-x_i}{x_j - x_i} ℓ j ( x ) = i = 1 , i = j ∏ n x j − x i x − x i The Hermite interpolation error is
e n ( x ) = f ( x ) − H n ( x ) = [ ψ n ( x ) ] 2 f [ x 1 , x 1 , … , x n , x n , x ] = [ ψ n ( x ) ] 2 ( 2 n ) ! f ( 2 n ) ( η ) , η ∈ [ a , b ] \begin{align*}
e_n(x)
&= f(x) - H_n(x) \\
&= [\psi_n(x)]^2 f[x_1,x_1,\ldots,x_n,x_n,x] \\
&= \frac{[\psi_n(x)]^2}{(2n)!} f^{(2n)}(\eta), \quad \eta \in [a,b]
\end{align*} e n ( x ) = f ( x ) − H n ( x ) = [ ψ n ( x ) ] 2 f [ x 1 , x 1 , … , x n , x n , x ] = ( 2 n )! [ ψ n ( x ) ] 2 f ( 2 n ) ( η ) , η ∈ [ a , b ] where
ψ n ( x ) = ( x − x 1 ) … ( x − x n ) = 1 A n ϕ n ( x ) \psi_n(x) = (x-x_1)\ldots(x-x_n) = \frac{1}{A_n} \phi_n(x) ψ n ( x ) = ( x − x 1 ) … ( x − x n ) = A n 1 ϕ n ( x ) Now
∫ a b w ( x ) f ( x ) d x = ∫ a b w ( x ) H n ( x ) d x + ∫ a n w ( x ) e n ( x ) d x = I n ( f ) + E n ( f ) \int_a^b w(x) f(x) \ud x = \int_a^b w(x) H_n(x) \ud x + \int_a^n w(x) e_n(x) \ud x = I_n(f) + E_n(f) ∫ a b w ( x ) f ( x ) d x = ∫ a b w ( x ) H n ( x ) d x + ∫ a n w ( x ) e n ( x ) d x = I n ( f ) + E n ( f ) The degree of precision of I n I_n I n is atleast 2 n − 1 2n-1 2 n − 1 since H n H_n H n is exact
for such polynomials. Moreover
E n ( x 2 n ) = ∫ a b w ( x ) e n ( x ) d x = ∫ a b w ( x ) [ ψ n ( x ) ] 2 ( 2 n ) ! ( 2 n ) ! d x = ∫ a b w ( x ) [ ψ n ( x ) ] 2 d x > 0 \begin{aligned}
E_n(x^{2n})
&= \int_a^b w(x) e_n(x) \ud x \\
&= \int_a^b w(x) \frac{[\psi_n(x)]^2}{(2n)!} (2n)! \ud x \\
&= \int_a^b w(x) [\psi_n(x)]^2 \ud x > 0
\end{aligned} E n ( x 2 n ) = ∫ a b w ( x ) e n ( x ) d x = ∫ a b w ( x ) ( 2 n )! [ ψ n ( x ) ] 2 ( 2 n )! d x = ∫ a b w ( x ) [ ψ n ( x ) ] 2 d x > 0 Hence the degree of precision of I n I_n I n is exactly 2 n − 1 2n-1 2 n − 1 .
(b) Simpler formula for I n ( f ) I_n(f) I n ( f ) : The integration formula is
I n ( f ) = ∑ j = 1 n f ( x j ) ∫ a b w ( x ) h j ( x ) d x + ∑ j = 1 n f ′ ( x j ) ∫ a b w ( x ) h ~ j ( x ) d x I_n(f) = \sum_{j=1}^n f(x_j) \int_a^b w(x) h_j(x) \ud x + \sum_{j=1}^n f'(x_j) \int_a^b w(x) \tilde{h}_j(x) \ud x I n ( f ) = j = 1 ∑ n f ( x j ) ∫ a b w ( x ) h j ( x ) d x + j = 1 ∑ n f ′ ( x j ) ∫ a b w ( x ) h ~ j ( x ) d x Since
ℓ j ( x ) = ψ n ( x ) ( x − x j ) ψ n ′ ( x j ) = ϕ n ( x ) ( x − x j ) ϕ n ′ ( x j ) \ell_j(x) = \frac{\psi_n(x)}{(x-x_j) \psi_n'(x_j)} = \frac{\phi_n(x)}{(x-x_j) \phi_n'(x_j)} ℓ j ( x ) = ( x − x j ) ψ n ′ ( x j ) ψ n ( x ) = ( x − x j ) ϕ n ′ ( x j ) ϕ n ( x ) ⟹ h ~ j ( x ) = ( x − x j ) ℓ j ( x ) ⋅ ℓ j ( x ) = ϕ n ( x ) ϕ n ′ ( x j ) ⋅ ℓ j ( x ) \implies \tilde{h}_j(x) = (x-x_j) \ell_j(x) \cdot \ell_j(x) = \frac{\phi_n(x)}{\phi_n'(x_j)} \cdot \ell_j(x) ⟹ h ~ j ( x ) = ( x − x j ) ℓ j ( x ) ⋅ ℓ j ( x ) = ϕ n ′ ( x j ) ϕ n ( x ) ⋅ ℓ j ( x ) Hence
∫ a b w ( x ) h ~ j ( x ) d x = 1 ϕ n ′ ( x j ) ∫ a b w ( x ) ϕ n ( x ) ℓ j ( x ) d x = 0 , j = 1 , 2 , … , n \int_a^b w(x) \tilde{h}_j(x) \ud x = \frac{1}{\phi_n'(x_j)}\int_a^b w(x) \phi_n(x) \ell_j(x) \ud x = 0, \qquad j=1,2,\ldots,n ∫ a b w ( x ) h ~ j ( x ) d x = ϕ n ′ ( x j ) 1 ∫ a b w ( x ) ϕ n ( x ) ℓ j ( x ) d x = 0 , j = 1 , 2 , … , n since degree( ℓ j ) = n − 1 (\ell_j) = n-1 ( ℓ j ) = n − 1 and ϕ n \phi_n ϕ n is orthogonal to all polynomials of degree < n < n < n . Hence
I n ( f ) = ∑ j = 1 n w j f ( x j ) , w j = ∫ a b w ( x ) h j ( x ) d x I_n(f) = \sum_{j=1}^n w_j f(x_j), \qquad w_j = \int_a^b w(x) h_j(x) \ud x I n ( f ) = j = 1 ∑ n w j f ( x j ) , w j = ∫ a b w ( x ) h j ( x ) d x (c) Uniqueness of I n ( f ) I_n(f) I n ( f ) : Suppose we have another numerical integration formula
∫ a b w ( x ) f ( x ) d x ≈ ∑ j = 1 n v j f ( z j ) \int_a^b w(x) f(x) \ud x \approx \sum_{j=1}^n v_j f(z_j) ∫ a b w ( x ) f ( x ) d x ≈ j = 1 ∑ n v j f ( z j ) that has degree of precision ≥ 2 n − 1 \ge 2n-1 ≥ 2 n − 1 . For any p ∈ P 2 n − 1 p \in \poly_{2n-1} p ∈ P 2 n − 1 , the Hermite interpolant using nodes { z j } \{ z_j \} { z j } is exact and
p ( x ) = ∑ j = 1 n p ( z j ) g j ( x ) + ∑ j = 1 n p ′ ( z j ) g ~ j ( x ) p(x) = \sum_{j=1}^n p(z_j) g_j(x) + \sum_{j=1}^n p'(z_j) \tilde{g}_j(x) p ( x ) = j = 1 ∑ n p ( z j ) g j ( x ) + j = 1 ∑ n p ′ ( z j ) g ~ j ( x ) where
g j ( x ) = [ 1 − 2 ( x − z j ) ℓ ˉ j ( z j ] [ ℓ ˉ j ( x ) ] 2 , g ~ j ( x ) = ( x − z j ) [ ℓ ˉ j ( x ) ] 2 = ℓ ˉ j ( x ) χ n ( x ) χ n ′ ( z j ) g_j(x) = [1 - 2(x-z_j) \bar{\ell}_j(z_j] [\bar{\ell}_j(x)]^2, \qquad \tilde{g}_j(x) = (x-z_j) [\bar{\ell}_j(x)]^2 = \frac{\bar{\ell}_j(x) \chi_n(x)}{\chi_n'(z_j)} g j ( x ) = [ 1 − 2 ( x − z j ) ℓ ˉ j ( z j ] [ ℓ ˉ j ( x ) ] 2 , g ~ j ( x ) = ( x − z j ) [ ℓ ˉ j ( x ) ] 2 = χ n ′ ( z j ) ℓ ˉ j ( x ) χ n ( x ) ℓ ˉ j ( x ) = ∏ i = 1 , i ≠ j n x − z i z j − z i , χ n ( x ) = ( x − z 1 ) … ( x − z n ) \bar{\ell}_j(x) = \prod_{i=1,i\ne j}^n \frac{x-z_i}{z_j - z_i}, \qquad \chi_n(x) = (x-z_1)\ldots(x-z_n) ℓ ˉ j ( x ) = i = 1 , i = j ∏ n z j − z i x − z i , χ n ( x ) = ( x − z 1 ) … ( x − z n ) Since the quadrature formula is exact for p ∈ P 2 n − 1 p \in \poly_{2n-1} p ∈ P 2 n − 1
∑ j = 1 n v j p ( z j ) = ∫ a b w ( x ) p ( x ) d x = ∑ j = 1 n p ( z j ) ∫ a b w ( x ) g j ( x ) d x + ∑ j = 1 n p ′ ( z j ) ∫ a b w ( x ) g ~ j ( x ) d x \begin{align*}
\sum_{j=1}^n v_j p(z_j)
&= \int_a^b w(x) p(x) \ud x \\
&= \sum_{j=1}^n p(z_j) \int_a^b w(x) g_j(x) \ud x + \sum_{j=1}^n p'(z_j) \int_a^b w(x) \tilde{g}_j(x) \ud x
\end{align*} j = 1 ∑ n v j p ( z j ) = ∫ a b w ( x ) p ( x ) d x = j = 1 ∑ n p ( z j ) ∫ a b w ( x ) g j ( x ) d x + j = 1 ∑ n p ′ ( z j ) ∫ a b w ( x ) g ~ j ( x ) d x Take p ( x ) = g ~ i ( x ) p(x) = \tilde{g}_i(x) p ( x ) = g ~ i ( x ) . Note that
g ~ i ( z j ) = 0 , g ~ i ′ ( z j ) = δ i j \tilde{g}_i(z_j) = 0, \qquad \tilde{g}_i'(z_j) = \delta_{ij} g ~ i ( z j ) = 0 , g ~ i ′ ( z j ) = δ ij Hence we get
0 = 0 + g ~ i ′ ( z i ) ∫ a b w ( x ) g ~ i ( x ) d x 0 = 0 + \tilde{g}_i'(z_i) \int_a^b w(x) \tilde{g}_i(x) \ud x 0 = 0 + g ~ i ′ ( z i ) ∫ a b w ( x ) g ~ i ( x ) d x ⟹ ∫ a b w ( x ) g ~ i ( x ) d x = 1 χ n ′ ( z i ) ∫ a b w ( x ) χ n ( x ) ℓ ˉ i ( x ) d x = 0 , i = 1 , 2 , … , n \implies \int_a^b w(x) \tilde{g}_i(x) \ud x = \frac{1}{\chi_n'(z_i)} \int_a^b w(x) \chi_n(x) \bar{\ell}_i(x) \ud x = 0, \qquad i=1,2,\ldots,n ⟹ ∫ a b w ( x ) g ~ i ( x ) d x = χ n ′ ( z i ) 1 ∫ a b w ( x ) χ n ( x ) ℓ ˉ i ( x ) d x = 0 , i = 1 , 2 , … , n Since degree( ℓ ˉ i ) = n − 1 (\bar{\ell}_i)=n-1 ( ℓ ˉ i ) = n − 1 and they form a basis for P n − 1 \poly_{n-1} P n − 1 , we get
∫ a b w ( x ) χ n ( x ) p ( x ) = 0 , ∀ p ∈ P n − 1 \int_a^b w(x) \chi_n(x) p(x) = 0, \qquad \forall p \in \poly_{n-1} ∫ a b w ( x ) χ n ( x ) p ( x ) = 0 , ∀ p ∈ P n − 1 Hence χ n \chi_n χ n is orthogonal to P n − 1 = span ( ϕ 0 , ϕ 1 , … , ϕ n − 1 ) \poly_{n-1} = \textrm{span}(\phi_0,\phi_1, \ldots,\phi_{n-1}) P n − 1 = span ( ϕ 0 , ϕ 1 , … , ϕ n − 1 ) and note that χ n ∈ P n \chi_n \in \poly_n χ n ∈ P n . But orthogonal polynomials are unique upto a multiplicative constant. Hence χ n ( x ) = c ϕ n ( x ) \chi_n(x) = c \phi_n(x) χ n ( x ) = c ϕ n ( x ) and in particular their zeros are same, which imples that z j = x j z_j = x_j z j = x j . Moreover, since degree( h i ) = 2 n − 1 (h_i)=2n-1 ( h i ) = 2 n − 1
w i = ∫ a b w ( x ) h i ( x ) d x = ∑ j = 1 n v j h i ( x j ) ⏟ δ i j = v i w_i = \int_a^b w(x) h_i(x)\ud x = \sum_{j=1}^n v_j \underbrace{h_i(x_j)}_{\delta_{ij}} = v_i w i = ∫ a b w ( x ) h i ( x ) d x = j = 1 ∑ n v j δ ij h i ( x j ) = v i (d) Weights are positive :
w i = ∫ a b w ( x ) h i ( x ) d x = ∫ a b w ( x ) [ 1 − 2 ℓ i ′ ( x i ) ( x − x i ) ] [ ℓ i ( x ) ] 2 d x = ∫ a b w ( x ) [ ℓ i ( x ) ] 2 d x − 2 ℓ i ′ ( x i ) ∫ a b w ( x ) h ~ i ( x ) d x ⏟ = 0 = ∫ a b w ( x ) [ ℓ i ( x ) ] 2 d x > 0 \begin{aligned}
w_i &= \int_a^b w(x) h_i(x) \ud x \\
&= \int_a^b w(x) [1 - 2 \ell_i'(x_i)(x-x_i)] [\ell_i(x)]^2 \ud x \\
&= \int_a^b w(x) [\ell_i(x)]^2 \ud x - 2 \ell_i'(x_i) \underbrace{\int_a^b w(x) \tilde{h}_i(x) \ud x}_{=0} \\
&= \int_a^b w(x) [\ell_i(x)]^2 \ud x > 0
\end{aligned} w i = ∫ a b w ( x ) h i ( x ) d x = ∫ a b w ( x ) [ 1 − 2 ℓ i ′ ( x i ) ( x − x i )] [ ℓ i ( x ) ] 2 d x = ∫ a b w ( x ) [ ℓ i ( x ) ] 2 d x − 2 ℓ i ′ ( x i ) = 0 ∫ a b w ( x ) h ~ i ( x ) d x = ∫ a b w ( x ) [ ℓ i ( x ) ] 2 d x > 0 (e) Error formula : Assume that
f ∈ C 2 n [ a , b ] f \in \cts^{2n}[a,b] f ∈ C 2 n [ a , b ] . Then the integration error is
E n ( f ) = ∫ a b w ( x ) e n ( x ) d x = ∫ a b w ( x ) [ ψ n ( x ) ] 2 f [ x 1 , x 1 , … , x n , x n , x ] d x = f [ x 1 , x 1 , … , x n , x n , ξ ] ∫ a b w ( x ) [ ψ n ( x ) ] 2 d x , ξ ∈ [ a , b ] = f ( 2 n ) ( η ) ( 2 n ) ! 1 A n 2 ∫ a b w ( x ) [ ψ n ( x ) ] 2 d x = f ( 2 n ) ( η ) ( 2 n ) ! 1 A n 2 γ n \begin{aligned}
E_n(f)
&= \int_a^b w(x) e_n(x) \ud x = \int_a^b w(x) [\psi_n(x)]^2 f[x_1,x_1,\ldots,x_n,x_n,x] \ud x \\
&= f[x_1,x_1,\ldots,x_n,x_n,\xi] \int_a^b w(x) [\psi_n(x)]^2 \ud x, \quad \xi\in[a,b] \\
&= \frac{f^{(2n)}(\eta)}{(2n)!} \frac{1}{A_n^2} \int_a^b w(x) [\psi_n(x)]^2 \ud x = \frac{f^{(2n)}(\eta)}{(2n)!} \frac{1}{A_n^2} \gamma_n
\end{aligned} E n ( f ) = ∫ a b w ( x ) e n ( x ) d x = ∫ a b w ( x ) [ ψ n ( x ) ] 2 f [ x 1 , x 1 , … , x n , x n , x ] d x = f [ x 1 , x 1 , … , x n , x n , ξ ] ∫ a b w ( x ) [ ψ n ( x ) ] 2 d x , ξ ∈ [ a , b ] = ( 2 n )! f ( 2 n ) ( η ) A n 2 1 ∫ a b w ( x ) [ ψ n ( x ) ] 2 d x = ( 2 n )! f ( 2 n ) ( η ) A n 2 1 γ n (f) Formula for the weights : We have already shown that the weights are positive. To obtain a simpler formula, take f ( x ) = ℓ i ( x ) f(x) = \ell_i(x) f ( x ) = ℓ i ( x ) and note that degree(ℓ i ) = n − 1 \ell_i)=n-1 ℓ i ) = n − 1
∫ a b w ( x ) ℓ i ( x ) d x = ∑ j = 1 n w j ℓ i ( x j ) + E n ( ℓ i ) = w i + 0 \int_a^b w(x) \ell_i(x) \ud x = \sum_{j=1}^n w_j \ell_i(x_j) + E_n(\ell_i) = w_i + 0 ∫ a b w ( x ) ℓ i ( x ) d x = j = 1 ∑ n w j ℓ i ( x j ) + E n ( ℓ i ) = w i + 0 Hence
w i = ∫ a b w ( x ) ℓ i ( x ) d x = 1 ϕ n ′ ( x i ) ∫ a b w ( x ) ϕ n ( x ) ( x − x i ) d x w_i = \int_a^b w(x) \ell_i(x) \ud x = \frac{1}{\phi_n'(x_i)} \int_a^b \frac{w(x) \phi_n(x)}{(x-x_i)} \ud x w i = ∫ a b w ( x ) ℓ i ( x ) d x = ϕ n ′ ( x i ) 1 ∫ a b ( x − x i ) w ( x ) ϕ n ( x ) d x Recall the Christoffel-Darboux identity
∑ k = 0 n ϕ k ( x ) ϕ k ( y ) γ k = ϕ n + 1 ( x ) ϕ n ( y ) − ϕ n ( x ) ϕ n + 1 ( y ) a n γ n ( x − y ) , x ≠ y \sum_{k=0}^n \frac{\phi_k(x) \phi_k(y)}{\gamma_k} = \frac{\phi_{n+1}(x) \phi_n(y) - \phi_n(x) \phi_{n+1}(y)}{a_n \gamma_n (x-y)}, \qquad x \ne y k = 0 ∑ n γ k ϕ k ( x ) ϕ k ( y ) = a n γ n ( x − y ) ϕ n + 1 ( x ) ϕ n ( y ) − ϕ n ( x ) ϕ n + 1 ( y ) , x = y Take y = x i y = x_i y = x i and use ϕ n ( y ) = ϕ n ( x i ) = 0 \phi_n(y)=\phi_n(x_i)=0 ϕ n ( y ) = ϕ n ( x i ) = 0
∑ k = 0 n − 1 ϕ k ( x ) ϕ k ( x i ) γ k = − ϕ n ( x ) ϕ n + 1 ( x i ) a n γ n ( x − x i ) \sum_{k=0}^{n-1} \frac{\phi_k(x) \phi_k(x_i)}{\gamma_k} = -\frac{\phi_n(x) \phi_{n+1}(x_i)}{a_n \gamma_n (x-x_i)} k = 0 ∑ n − 1 γ k ϕ k ( x ) ϕ k ( x i ) = − a n γ n ( x − x i ) ϕ n ( x ) ϕ n + 1 ( x i ) Multiply by w ( x ) w(x) w ( x ) and integrate both side, and note that
∫ a b w ( x ) ϕ k ( x ) d x = 0 , k ≥ 1 \int_a^b w(x) \phi_k(x) \ud x = 0, \qquad k \ge 1 ∫ a b w ( x ) ϕ k ( x ) d x = 0 , k ≥ 1 and since ϕ 0 ( x ) = \phi_0(x)= ϕ 0 ( x ) = constant, we get
1 γ 0 ∫ a b w ( x ) ϕ 0 ( x ) ϕ 0 ( x i ) d x = 1 = − ϕ n + 1 ( x i ) a n γ n ∫ a b w ( x ) ϕ n ( x ) x − x i d x \frac{1}{\gamma_0} \int_a^b w(x) \phi_0(x)\phi_0(x_i)\ud x = 1 = - \frac{\phi_{n+1}(x_i)}{a_n \gamma_n} \int_a^b \frac{w(x) \phi_n(x)}{x-x_i} \ud x γ 0 1 ∫ a b w ( x ) ϕ 0 ( x ) ϕ 0 ( x i ) d x = 1 = − a n γ n ϕ n + 1 ( x i ) ∫ a b x − x i w ( x ) ϕ n ( x ) d x which proves the formula for the weights.
2 Gauss-Legendre quadrature ¶ For weight function w ( x ) = 1 w(x) = 1 w ( x ) = 1 on [ − 1 , 1 ] [-1,1] [ − 1 , 1 ] the orthogonal polynomials are the Legendre functions P n ( x ) P_n(x) P n ( x ) . The integral is approximated by
I ( f ) = ∫ − 1 1 f ( x ) d x ≈ I n ( f ) = ∑ j = 1 n w j f ( x j ) I(f) = \int_{-1}^1 f(x) \ud x \approx I_n(f) = \sum_{j=1}^n w_j f(x_j) I ( f ) = ∫ − 1 1 f ( x ) d x ≈ I n ( f ) = j = 1 ∑ n w j f ( x j ) The nodes { x j } \{x_j\} { x j } are the zeros of P n ( x ) P_n(x) P n ( x ) and the weights are
w i = − 2 ( n + 1 ) P n ′ ( x i ) P n + 1 ( x i ) , i = 1 , 2 , … , n w_i = -\frac{2}{(n+1) P_n'(x_i) P_{n+1}(x_i)}, \qquad i=1,2,\ldots,n w i = − ( n + 1 ) P n ′ ( x i ) P n + 1 ( x i ) 2 , i = 1 , 2 , … , n and the error is
E n ( f ) = 2 2 n + 1 ( n ! ) 4 ( 2 n + 1 ) [ ( 2 n ) ! ] 2 f ( 2 n ) ( η ) ( 2 n ) ! = e n f ( 2 n ) ( η ) ( 2 n ) ! E_n(f) = \frac{2^{2n+1} (n!)^4}{(2n+1) [(2n)!]^2} \frac{f^{(2n)}(\eta)}{(2n)!} = e_n \frac{f^{(2n)}(\eta)}{(2n)!} E n ( f ) = ( 2 n + 1 ) [( 2 n )! ] 2 2 2 n + 1 ( n ! ) 4 ( 2 n )! f ( 2 n ) ( η ) = e n ( 2 n )! f ( 2 n ) ( η ) 3 Asymptotic behavior of error ¶ Define
M m = max x ∈ [ − 1 , 1 ] ∣ f ( m ) ( x ) ∣ m ! , m ≥ 0 M_m = \max_{x \in [-1,1]} \frac{|f^{(m)}(x)|}{m!}, \qquad m \ge 0 M m = x ∈ [ − 1 , 1 ] max m ! ∣ f ( m ) ( x ) ∣ , m ≥ 0 For a large class of infinitely differentiable functions
∑ m M m ≤ M < ∞ \sum_m M_m \le M < \infty m ∑ M m ≤ M < ∞ In fact, for many functions
lim m → ∞ M m = 0 \lim_{m \to \infty} M_m = 0 m → ∞ lim M m = 0 e.g., analytic functions like e x \ee^x e x , cos ( x ) \cos(x) cos ( x ) , etc. For such functions, the Gauss quadrature has error
∣ E n ( f ) ∣ ≤ e n M 2 n |E_n(f)| \le e_n M_{2n} ∣ E n ( f ) ∣ ≤ e n M 2 n The speed of convergence depends on e n e_n e n . Using Stirling approximation
n ! ≈ e − n n n 2 π n n! \approx \ee^{-n} n^n \sqrt{2\pi n} n ! ≈ e − n n n 2 πn we get
e n ≈ π 4 n e_n \approx \frac{\pi}{4^n} e n ≈ 4 n π E.g., e 5 = 0.00293 e_5 = 0.00293 e 5 = 0.00293 while π / 4 5 = 0.00307 \pi/4^5 = 0.00307 π / 4 5 = 0.00307 . Hence we get the asymptotic error bound
∣ E n ( f ) ∣ ≤ π 4 n M 2 n |E_n(f)| \le \frac{\pi}{4^n} M_{2n} ∣ E n ( f ) ∣ ≤ 4 n π M 2 n This is exponential convergence of the error. Compare this to trapezoidal which has ∣ E n ( f ) ∣ ≤ c / n 2 |E_n(f)| \le c/n^2 ∣ E n ( f ) ∣ ≤ c / n 2 and Simpson which has ∣ E n ( f ) ∣ ≤ c / n 4 |E_n(f)| \le c/n^4 ∣ E n ( f ) ∣ ≤ c / n 4 . Hence for nice functions Gauss quadrature is very accurate.
4 Relation to minimax approximation ¶ We can see the optimal accuracy of Gauss quadrature by its relation to the best approximation.
Assume [ a , b ] [a,b] [ a , b ] is finite. Then the error of Gauss quadrature
∣ E n ( f ) ∣ = ∣ I ( f ) − I n ( f ) ∣ ≤ 2 ρ 2 n − 1 ( f ) ∫ a b w ( x ) d x |E_n(f)| = |I(f) - I_n(f)| \le 2 \rho_{2n-1}(f) \int_a^b w(x) \ud x ∣ E n ( f ) ∣ = ∣ I ( f ) − I n ( f ) ∣ ≤ 2 ρ 2 n − 1 ( f ) ∫ a b w ( x ) d x with ρ 2 n − 1 = inf p ∈ P 2 n − 1 ∥ f − p ∥ ∞ \rho_{2n-1} = \inf_{p \in \poly_{2n-1}} \norm{f - p}_\infty ρ 2 n − 1 = inf p ∈ P 2 n − 1 ∥ f − p ∥ ∞ is
the minimax error.
We have E n ( p ) = 0 E_n(p)=0 E n ( p ) = 0 for any p ∈ P 2 n − 1 p \in \poly_{2n-1} p ∈ P 2 n − 1 and the error E n E_n E n is a linear operator. Take p = q 2 n − 1 ∗ ∈ P 2 n − 1 p = q_{2n-1}^* \in \poly_{2n-1} p = q 2 n − 1 ∗ ∈ P 2 n − 1 be the minimax approximation to f f f on [ a , b ] [a,b] [ a , b ] . Then
E n ( f ) = E n ( f ) − E n ( q 2 n − 1 ∗ ) = E n ( f − q 2 n − 1 ∗ ) = ∫ a b w ( x ) [ f ( x ) − q 2 n − 1 ∗ ( x ) ] d x − ∑ j = 1 n w j [ f ( x j ) − q 2 n − 1 ∗ ( x j ) ] \begin{aligned}
E_n(f)
&= E_n(f) - E_n(q_{2n-1}^*) \\
&= E_n(f - q_{2n-1}^*) \\
&= \int_a^b w(x)[f(x) - q_{2n-1}^*(x)] \ud x - \sum_{j=1}^n w_j[f(x_j) - q_{2n-1}^*(x_j)]
\end{aligned} E n ( f ) = E n ( f ) − E n ( q 2 n − 1 ∗ ) = E n ( f − q 2 n − 1 ∗ ) = ∫ a b w ( x ) [ f ( x ) − q 2 n − 1 ∗ ( x )] d x − j = 1 ∑ n w j [ f ( x j ) − q 2 n − 1 ∗ ( x j )] so that
∣ E n ( f ) ∣ ≤ ∥ f − q 2 n − 1 ∗ ∥ ∞ [ ∫ a b w ( x ) d x + ∑ j = 1 n w j ] |E_n(f)| \le \norm{f - q_{2n-1}^*}_\infty\left[ \int_a^b w(x) \ud x + \sum_{j=1}^n w_j \right] ∣ E n ( f ) ∣ ≤ ∥ f − q 2 n − 1 ∗ ∥ ∞ [ ∫ a b w ( x ) d x + j = 1 ∑ n w j ] since w ( x ) ≥ 0 w(x) \ge 0 w ( x ) ≥ 0 and w j > 0 w_j > 0 w j > 0 . As the quadrature rule is exact for constant function
∫ a b w ( x ) d x = ∑ j = 1 n w j \int_a^b w(x) \ud x = \sum_{j=1}^n w_j ∫ a b w ( x ) d x = j = 1 ∑ n w j which completes the proof.
We can use Gauss quadrature for integrals of the form
I = ∫ 0 ∞ g ( x ) d x I = \int_0^\infty g(x) \ud x I = ∫ 0 ∞ g ( x ) d x by write it as
I = ∫ 0 ∞ e − x [ e x g ( x ) ] d x = ∫ 0 ∞ e − x f ( x ) d x I = \int_0^\infty \ee^{-x}[ \ee^x g(x)] \ud x = \int_0^\infty \ee^{-x} f(x) \ud x I = ∫ 0 ∞ e − x [ e x g ( x )] d x = ∫ 0 ∞ e − x f ( x ) d x We can use quadrature formula based on Laguerre polynomials. See
Atkinson, page 308 and 309.