Skip to main content

20  Numerical Quadrature

Numerical quadrature approximates the definite integral of a continuous function \(f : [a, b] \to \fR\) by a finite linear combination of sampled function values: \[ \begin{align} I(f) = \int_a^b f(x)\,dx \approx Q_n(f) = \sum_{i=0}^n w_i f(x_i). \end{align} \] The points \(x_i \in [a, b]\) are the quadrature nodes, and the scalar coefficients \(w_i \in \fR\) are the quadrature weights. The design of quadrature rules balances algebraic precision, computational cost, and numerical stability.

20.1 Degree of Exactness and Interpolatory Quadrature

The standard criterion for evaluating a quadrature rule is its algebraic precision, defined by the highest degree of polynomials it integrates without error.

NoteExample

On \([0,1]\), suppose we use just the two endpoint values and seek \(Q(f)=w_0f(0)+w_1f(1)\). Exact integration of \(1\) requires \(w_0+w_1=1\). Exact integration of \(x\) requires \(w_1=1/2\). Thus both weights are \(1/2\), giving the trapezoidal rule.

WarningExercise

Test this rule on \(x^2\). Is the quadrature value above or below the integral? Derive the endpoint weights on \([a,b]\) in the same way. Relate the result to the area under the line joining the two endpoint values.

NoteDefinition: Degree of Exactness (Algebraic Precision)

A quadrature rule \(Q_n\) has degree of exactness \(m\) if \[ \begin{align} Q_n(p) = \int_a^b p(x)\,dx \qquad \text{for all } p \in \mathcal{P}_m, \end{align} \] and there exists at least one polynomial \(q \in \mathcal{P}_{m+1}\) for which \(Q_n(q) \neq \int_a^b q(x)\,dx\).

NoteTheorem: Interpolatory Quadrature Rules

Let \(x_0, x_1, ..., x_n\) be \(n+1\) distinct nodes in \([a, b]\). The interpolatory quadrature rule approximates \(I(f)\) by integrating the polynomial interpolant \(P_n(x) = \sum_{i=0}^n f(x_i) L_i(x)\) in Lagrange form: \[ \begin{align} Q_n(f) = \int_a^b P_n(x)\,dx = \sum_{i=0}^n w_i f(x_i), \qquad w_i = \int_a^b L_i(x)\,dx. \end{align} \] Every interpolatory quadrature rule with \(n+1\) distinct nodes has degree of exactness at least \(n\).

The Lagrange polynomials satisfy \(L_i(x_j)=\delta_{ij}\). Therefore for any data values \(f(x_i)\), the polynomial \[ \begin{align} P_n(x)=\sum_{i=0}^n f(x_i)L_i(x) \end{align} \] interpolates those values. Its integral is a finite sum, so linearity of integration gives \[ \begin{align} \int_a^bP_n(x)\,dx =\sum_{i=0}^nf(x_i)\int_a^bL_i(x)\,dx =\sum_{i=0}^nw_i f(x_i). \end{align} \] This is the proposed quadrature rule.

To establish exactness, take a polynomial \(p\) of degree at most \(n\). It already satisfies the interpolation conditions for its own data. Uniqueness of interpolation implies that the constructed \(P_n\) equals \(p\) everywhere, not only at the nodes. Consequently \[ \begin{align} Q_n(p)=\int_a^bP_n(x)\,dx=\int_a^bp(x)\,dx. \end{align} \] The argument applies to every polynomial in \(\mathcal P_n\). Thus the rule has degree of exactness at least \(n\). It may be exact for higher degrees because additional cancellation can occur, so this argument establishes a lower bound for the degree rather than its exact value.

WarningExercise

Integrate \(p(x)=\sum_i p(x_i)L_i(x)\) term by term to prove the theorem. Deduce \(\sum_iw_i=b-a\) by choosing \(p=1\). For the nodes \(-1,0,1\), integrate the three Lagrange basis polynomials to obtain Simpson’s weights. Use symmetry to explain why the rule is exact for cubics as well as quadratics.

20.2 Newton–Cotes Formulas and Composite Rules

Newton–Cotes rules are interpolatory quadrature formulas built on equally spaced nodes. Because high-order single-panel Newton–Cotes rules suffer from negative weights and Runge’s phenomenon, practical computations use composite rules on small subintervals of uniform width \(h = (b - a)/N\).

NoteDefinition: Composite Trapezoidal and Simpson’s Rules

Dividing \([a, b]\) into \(N\) subintervals with uniform width \(h = (b - a)/N\) and grid points \(x_j = a + jh\):

  1. The Composite Trapezoidal Rule is \[ \begin{align} T_N(f) = h \left[ \frac{f(a) + f(b)}{2} + \sum_{j=1}^{N-1} f(x_j) \right]. \end{align} \]

  2. For an even number of panels \(N\), the Composite Simpson’s Rule is \[ \begin{align} S_N(f) = \frac{h}{3} \left[ f(x_0) + 4\sum_{\substack{j=1 \\ j \text{ odd}}}^{N-1} f(x_j) + 2\sum_{\substack{j=2 \\ j \text{ even}}}^{N-2} f(x_j) + f(x_N) \right]. \end{align} \]

NoteTheorem: Composite Error Formulas

Let \(f \in C^2[a, b]\) for the trapezoidal rule, and let \(f \in C^4[a, b]\) for Simpson’s rule.

  1. The composite trapezoidal error satisfies \[ \begin{align} I(f) - T_N(f) = -\frac{b - a}{12} h^2 f''(\xi_T), \qquad \xi_T \in (a, b). \end{align} \]

  2. The composite Simpson error satisfies \[ \begin{align} I(f) - S_N(f) = -\frac{b - a}{180} h^4 f^{(4)}(\xi_S), \qquad \xi_S \in (a, b). \end{align} \]

For the trapezoidal rule on panel \([x_j, x_{j+1}]\), the Cauchy interpolation error formula (the referenced result) gives \[ \begin{align} f(x) - P_1(x) = \frac{f''(\xi_j(x))}{2}(x - x_j)(x - x_{j+1}). \end{align} \] Because \((x - x_j)(x - x_{j+1}) \leq 0\) on this panel, the Mean Value Theorem for Integrals implies there exists \(\mu_j \in (x_j, x_{j+1})\) such that \[ \begin{align} \int_{x_j}^{x_{j+1}} [f(x) - P_1(x)]\,dx = \frac{f''(\mu_j)}{2} \int_{x_j}^{x_{j+1}} (x - x_j)(x - x_{j+1})\,dx = -\frac{h^3}{12} f''(\mu_j). \end{align} \] Summing across all \(N\) panels and applying the Intermediate Value Theorem to the average \(\frac{1}{N}\sum_{j=0}^{N-1} f''(\mu_j) = f''(\xi_T)\) yields the trapezoidal error formula: \[ \begin{align} I(f) - T_N(f) = -\frac{h^3}{12} \sum_{j=0}^{N-1} f''(\mu_j) = -\frac{N h^3}{12} f''(\xi_T) = -\frac{b - a}{12} h^2 f''(\xi_T). \end{align} \] The intermediate mean-value expression for the trapezoidal rule can be justified without assuming that a choice of \(\xi_j(x)\) is continuous: the minimum and maximum of \(f''\) bound the pointwise interpolation error multiplied by its fixed-sign nodal factor. Integrating these bounds puts the scaled panel error between the minimum and maximum values of \(f''\). Continuity then supplies the stated \(\mu_j\).

For Simpson’s rule use the integral form of Taylor’s theorem, which requires only \(f\in C^4\). On the reference interval \([-1,1]\), the error functional annihilates cubics. Its fourth-derivative kernel is \[ \begin{align} K(t)&=\frac{1}{6}E_x((x-t)_+^3)\\ &=\frac{(1-t)^4}{24}-\frac{2}{9}(-t)_+^3-\frac{(1-t)^3}{18}\\ &=-\frac{(1-|t|)^3(1+3|t|)}{72},\qquad -1\leq t\leq1. \end{align} \] The notation \(E_x\) means that the quadrature-error operator acts on the variable \(x\), with \(t\) held fixed. The factor \(1/6\) comes from the third power in Taylor’s integral remainder. On \([-1,1]\), integrating \((x-t)_+^3/6\) gives \((1-t)^4/24\). Evaluating it at the Simpson nodes gives exactly the two nonzero sampled terms displayed above.

Thus \(K\leq0\) and \(\int_{-1}^1K(t)\,dt=-1/90\). Taylor’s integral remainder gives \(E(f)=\int_{-1}^1K(t)f^{(4)}(t)\,dt\); the next theorem proves this general kernel representation. A weighted mean-value argument and scaling \(x=c_j+ht\) give the double-panel error \(-h^5 f^{(4)}(\mu_j)/90\). Summing the \(N/2\) double panels and using continuity of \(f^{(4)}\) proves the composite formula.

On a double panel, \(x=c_j+ht\) has Jacobian \(h\) and its fourth derivative with respect to \(t\) is \(h^4 f^{(4)}(c_j+ht)\). These give the combined factor \(h^5\). There are \(N/2\) such panels, so \(-(N/2)h^5/90=-(b-a)h^4/180\), which is the composite constant.

WarningExercise

Verify the Simpson kernel formula separately for \(t\geq0\) and \(t\leq0\), and integrate it. Apply the single-panel formulas to \(f(x)=x^2\) for the trapezoidal rule and \(f(x)=x^4\) for Simpson’s rule. Check both the sign and the power of \(h\).

20.3 Peano Kernel Error Representation

A quadrature error \(E(f)\) is linear in \(f\). If the rule integrates every polynomial of degree at most \(m\) exactly, those polynomial terms contribute no error. Taylor’s formula then lets us express the whole error using \(f^{(m+1)}\). The function multiplying this derivative under the integral is called the Peano kernel. Once we know that function, we can estimate the error for many different integrands without repeating the derivation.

NoteTheorem: Peano Kernel Theorem

Let \(Q\) be a quadrature rule on \([a, b]\) with error functional \(E(f) = \int_a^b f(x)\,dx - Q(f)\). If \(E(p) = 0\) for all \(p \in \mathcal{P}_m\), then for every \(f \in C^{m+1}[a, b]\), \[ \begin{align} E(f) = \int_a^b f^{(m+1)}(t) K(t)\,dt, \end{align} \] where the Peano kernel \(K(t)\) is defined by applying the error functional to the truncated power function: \[ \begin{align} K(t) = \frac{1}{m!} E_x \left( (x - t)_+^m \right), \qquad (x - t)_+ = \max(0, x - t). \end{align} \] For \(m=0\), interpret \((x-t)_+^0\) as \(1\) when \(x>t\) and \(0\) when \(x\leq t\).

If \(K(t)\) does not change sign on \([a, b]\), then there exists \(\xi \in (a, b)\) such that \[ \begin{align} E(f) = \frac{f^{(m+1)}(\xi)}{(m+1)!} E(x^{m+1}). \end{align} \]

By Taylor’s theorem with integral remainder expanded about \(a\): \[ \begin{align} f(x) = \sum_{k=0}^m \frac{f^{(k)}(a)}{k!} (x - a)^k + \frac{1}{m!} \int_a^x f^{(m+1)}(t) (x - t)^m\,dt. \end{align} \] Extending the upper integration limit using the truncated power notation \((x - t)_+^m\) allows writing the remainder as \(\frac{1}{m!} \int_a^b f^{(m+1)}(t) (x - t)_+^m\,dt\). The truncated power makes the integrand zero for \(t>x\), so extending the upper limit adds only zeros. It is useful because both the quadrature sum and the integral can then act on functions of \(x\) over a fixed interval.

Applying the linear functional \(E\) to both sides, the polynomial terms vanish because \(E(p) = 0\) for all \(p \in \mathcal{P}_m\). Exchanging the order of integration and the functional gives \[ \begin{align} E(f)&=E_x\left(\frac1{m!}\int_a^b f^{(m+1)}(t)(x-t)_+^m\,dt\right)\\ &=\int_a^b f^{(m+1)}(t) \left[\frac1{m!}E_x((x-t)_+^m)\right]dt\\ &=\int_a^b f^{(m+1)}(t)K(t)\,dt. \end{align} \] Interchanging a finite quadrature sum with integration follows from linearity. Interchanging the two ordinary integrals follows from continuity and integrability on the compact triangle. Thus no convergence of an infinite sum is needed in this step.

If \(K\) has constant sign, the weighted mean-value theorem gives \[ \begin{align} E(f)=f^{(m+1)}(\xi)\int_a^b K(t)\,dt. \end{align} \] Testing the identity with \(f(x) = x^{m+1}\), we have \(f^{(m+1)}(x) = (m+1)!\), which yields \(E(x^{m+1}) = (m+1)! \int_a^b K(t)\,dt\). Substituting this integral proves the claim.

If \(K\) is identically zero, the error is zero and the final identity is immediate. Otherwise use \(|K|\) as a nonnegative weight: the integral average of the continuous derivative lies between its minimum and maximum, so the intermediate value theorem supplies a point attaining that average. This is the weighted mean-value step used above.

WarningExercise

Peano kernel of the trapezoidal rule. Consider the single-panel trapezoidal rule on \([0, h]\) with error functional \(E(f) = \int_0^h f(x)\,dx - \frac{h}{2}[f(0) + f(h)]\).

  1. Show that \(E(1) = 0\) and \(E(x) = 0\), so \(m = 1\).

  2. Evaluate the Peano kernel \(K(t) = E_x((x - t)_+) = \int_0^h (x - t)_+\,dx - \frac{h}{2}[(0 - t)_+ + (h - t)_+]\).

  3. Show that \(K(t) = \frac{1}{2}t(t - h) \leq 0\) for all \(t \in [0, h]\).

  4. Apply the referenced result to compute \(\int_0^h K(t)\,dt = -\frac{h^3}{12}\) and recover the exact error term \(-\frac{h^3}{12} f''(\xi)\).

20.4 Gauss–Legendre Quadrature

Newton–Cotes rules fix equispaced nodes and optimize only the weights. Gaussian quadrature optimizes both the nodes \(x_1, ..., x_p\) and the weights \(w_1, ..., w_p\), providing \(2p\) degrees of freedom to maximize the degree of exactness.

We need polynomials orthogonal for the ordinary integral on \([-1,1]\), rather than the Chebyshev weight. Applying Gram–Schmidt to \(1,x,x^2,...\) with inner product \(\int_{-1}^1p(x)q(x)\,dx\) constructs them. Up to normalization these are the Legendre polynomials. Orthogonality will make part of the quadrature error vanish without adding more nodes.

WarningExercise

Construct the first three polynomials in this process. You may leave their norms arbitrary. Show that the polynomial of degree two is proportional to \(x^2-1/3\). Use its roots and exactness for \(1\) and \(x\) to derive the two-point Gaussian rule.

NoteLemma: Roots of Orthogonal Polynomials

Let \(P_p(x)\) be the degree-\(p\) Legendre polynomial orthogonal on \([-1, 1]\) with respect to weight \(w(x) \equiv 1\): \[ \begin{align} \int_{-1}^1 P_p(x) q(x)\,dx = 0 \qquad \text{for all } q \in \mathcal{P}_{p-1}. \end{align} \] Then \(P_p(x)\) has exactly \(p\) distinct, real roots, and all roots lie in the open interval \((-1, 1)\).

Let \(x_1, ..., x_k\) denote the points in \((-1, 1)\) where \(P_p(x)\) changes sign. Because \(P_p\) is continuous and orthogonal to the constant polynomial \(q(x) = 1\), we have \(\int_{-1}^1 P_p(x)\,dx = 0\), so \(P_p\) must change sign at least once in \((-1, 1)\), meaning \(k \geq 1\). We count sign-changing roots rather than all roots. A root of even multiplicity does not reverse the sign, whereas a root of odd multiplicity does. The polynomial is nonzero, so it cannot vanish on an interval.

Suppose for contradiction that \(k < p\). Construct the polynomial \(q(x) = \prod_{j=1}^k (x - x_j) \in \mathcal{P}_k\). By construction, \(P_p(x)\) and \(q(x)\) change sign at identical points in \((-1, 1)\), so their product \(P_p(x) q(x)\) has constant sign on \([-1, 1]\) and is not identically zero. Consequently, \[ \begin{align} \int_{-1}^1 P_p(x) q(x)\,dx \neq 0. \end{align} \] Across each listed point, both factors change sign and their product does not. At every other root, \(P_p\) has even multiplicity and again the product does not change sign. Away from finitely many roots the product is nonzero. Its integral over the interval therefore cannot vanish.

However, because \(\deg(q) = k < p\), orthogonality requires \(\int_{-1}^1 P_p(x) q(x)\,dx = 0\), producing a contradiction. Therefore, \(k = p\), proving that \(P_p\) has \(p\) distinct real roots in \((-1, 1)\).

A degree-\(p\) polynomial cannot have more than \(p\) distinct roots. The argument has found \(p\) distinct sign-changing roots inside the interval, exhausting the degree. Thus they are simple and there are no other roots, real or complex.

NoteTheorem: Fundamental Theorem of Gaussian Quadrature

Let \(x_1, ..., x_p\) be the roots of the degree-\(p\) Legendre polynomial \(P_p(x)\) on \([-1, 1]\), and let \(w_i = \int_{-1}^1 L_i(x)\,dx\). The \(p\)-point Gauss–Legendre quadrature rule \[ \begin{align} \int_{-1}^1 f(x)\,dx \approx \sum_{i=1}^p w_i f(x_i) \end{align} \] has degree of exactness \(2p - 1\). No \(p\)-point quadrature rule can achieve a degree of exactness higher than \(2p - 1\). Furthermore, all weights are strictly positive: \(w_i > 0\) for all \(i = 1, ..., p\).

Let \(f \in \mathcal{P}_{2p-1}\). Polynomial long division of \(f(x)\) by \(P_p(x)\) yields \[ \begin{align} f(x) = q(x) P_p(x) + r(x), \qquad \deg(q) \leq p - 1, \quad \deg(r) \leq p - 1. \end{align} \] Integrating both sides over \([-1, 1]\): \[ \begin{align} \int_{-1}^1 f(x)\,dx = \int_{-1}^1 q(x) P_p(x)\,dx + \int_{-1}^1 r(x)\,dx. \end{align} \] Because \(\deg(q) \leq p - 1\), orthogonality of \(P_p\) against \(\mathcal{P}_{p-1}\) implies \(\int_{-1}^1 q(x) P_p(x)\,dx = 0\), giving \[ \begin{align} \int_{-1}^1 f(x)\,dx = \int_{-1}^1 r(x)\,dx. \end{align} \] Applying the \(p\)-point quadrature sum at the Legendre roots \(\{x_i\}_{i=1}^p\) where \(P_p(x_i) = 0\): \[ \begin{align} \sum_{i=1}^p w_i f(x_i) &= \sum_{i=1}^p w_i \left[ q(x_i) P_p(x_i) + r(x_i) \right] \\ &= \sum_{i=1}^p w_i \left[ 0 + r(x_i) \right] = \sum_{i=1}^p w_i r(x_i). \end{align} \] Because \(\deg(r) \leq p - 1\), interpolatory quadrature on \(p\) distinct nodes integrates \(r(x)\) exactly by the referenced result: \[ \begin{align} \sum_{i=1}^p w_i r(x_i) = \int_{-1}^1 r(x)\,dx = \int_{-1}^1 f(x)\,dx. \end{align} \] Thus \(\sum_{i=1}^p w_i f(x_i) = \int_{-1}^1 f(x)\,dx\) for all \(f \in \mathcal{P}_{2p-1}\). Both the exact integral and the quadrature value have now been reduced to the same remainder polynomial \(r\) of degree at most \(p-1\). This proves exactness through degree \(2p-1\), rather than merely through the interpolation degree.

To prove that \(2p - 1\) is the maximal degree, define the nodal polynomial \[ \begin{align} g(x) = \prod_{i=1}^p (x - x_i)^2 \in \mathcal{P}_{2p}. \end{align} \] Because \(g(x) \geq 0\) and vanishes only at isolated points, its integral is strictly positive: \[ \begin{align} \int_{-1}^1 g(x)\,dx > 0. \end{align} \] However, evaluating the quadrature sum yields \[ \begin{align} \sum_{i=1}^p w_i g(x_i) = \sum_{i=1}^p w_i \cdot 0 = 0 \neq \int_{-1}^1 g(x)\,dx. \end{align} \] Therefore no \(p\)-point quadrature rule can integrate all degree-\(2p\) polynomials. This obstruction applies to any proposed \(p\) nodes, regardless of their weights. The squared nodal polynomial is tailored to those nodes, has a positive integral, and is invisible to the quadrature rule.

For weight positivity, let \(L_i \in \mathcal{P}_{p-1}\) be the \(i\)-th Lagrange basis polynomial. The square satisfies \(\deg(L_i^2) = 2p - 2 \leq 2p - 1\). The rule integrates \(L_i^2\) exactly: \[ \begin{align} 0 < \int_{-1}^1 L_i^2(x)\,dx = \sum_{j=1}^p w_j L_i^2(x_j) = \sum_{j=1}^p w_j \delta_{ij} = w_i. \end{align} \] Every weight \(w_i\) is strictly positive.

The positivity integral is strict because \(L_i(x_i)=1\), so \(L_i\) is not the zero polynomial and its square is positive on a neighborhood. The equality with the single weight uses \(L_i(x_j)^2=\delta_{ij}\). Gaussian quadrature and its error arguments are developed in Stoer and Bulirsch (2002).

20.5 Richardson Extrapolation and Romberg Integration

When the error of a numerical method admits an asymptotic expansion in powers of \(h\), Richardson extrapolation algebraically cancels the leading error terms.

NoteTheorem: Euler–Maclaurin Summation and Romberg Integration

Let \(f \in C^{2m+2}[a, b]\). The composite trapezoidal rule satisfies the asymptotic expansion \[ \begin{align} T(h) = I(f) + c_2 h^2 + c_4 h^4 + c_6 h^6 + ... + c_{2m} h^{2m} + O(h^{2m+2}), \end{align} \] where \(c_{2k} = \frac{B_{2k}}{(2k)!}[f^{(2k-1)}(b) - f^{(2k-1)}(a)]\) depend on the Bernoulli numbers \(B_{2k}\). Romberg integration systematically eliminates powers of \(h^2\) via the tableau recurrence \[ \begin{align} R(k, 0) = T(h_k), \qquad R(k, j) = \frac{4^j R(k, j-1) - R(k-1, j-1)}{4^j - 1} \quad (1 \leq j \leq k), \end{align} \] where \(h_k = (b - a)/2^k\). Column \(j\) achieves order \(O(h^{2j+2})\).

Consider two consecutive grid widths, \(h_k\) and \(h_{k-1}=2h_k\). The first trapezoidal expansion gives \[ \begin{align} R(k,0)&=I+c_2h_k^2+c_4h_k^4+O(h_k^6),\\ R(k-1,0)&=I+4c_2h_k^2+16c_4h_k^4+O(h_k^6). \end{align} \] Multiply the first by four and subtract the second. The \(h_k^2\) terms cancel, while the constant term becomes \(3I\). Dividing by three therefore gives \[ \begin{align} R(k,1)=\frac{4R(k,0)-R(k-1,0)}3=I+O(h_k^4). \end{align} \] This proves the first extrapolation step, including the reason for its two weights.

For the general step, suppose column \(j-1\) has an expansion whose first possible error term has order \(2j\): \[ \begin{align} R(k,j-1)=I+d_{2j}h_k^{2j}+O(h_k^{2j+2}). \end{align} \] The coefficients here are the same when the entire construction is carried out with width \(2h_k\), because the expansion coefficients are independent of the width. Hence \[ \begin{align} R(k-1,j-1)=I+2^{2j}d_{2j}h_k^{2j}+O(h_k^{2j+2}). \end{align} \] Since \(2^{2j}=4^j\), the combination in the stated recurrence cancels this leading term and divides its constant term by \(4^j-1\). Thus \(R(k,j)=I+O(h_k^{2j+2})\). Induction proves the order of each fixed column for which the assumed smoothness supplies the required expansion. The starting Euler–Maclaurin expansion itself is a standard result of quadrature theory (Stoer and Bulirsch 2002).

20.6 Periodic Functions and Spectral Convergence

NoteTheorem: Spectral Accuracy of the Trapezoidal Rule on Periodic Domains

Let \(f\) be a smooth, \(2\pi\)-periodic function on \(\fR\). All endpoint derivatives in the Euler–Maclaurin expansion cancel identically: \[ \begin{align} f^{(2k-1)}(2\pi) - f^{(2k-1)}(0) = 0 \qquad \text{for all } k \geq 1. \end{align} \] Consequently, all algebraic error coefficients \(c_2, c_4, c_6, ...\) vanish. If \(f\) is analytic and bounded in a strip \(\{z \in \fC : |\operatorname{Im}(z)| < d\}\), the composite trapezoidal rule converges exponentially fast: \[ \begin{align} |I(f) - T_N(f)| \leq C e^{-d N}. \end{align} \] On smooth periodic domains, the composite trapezoidal rule achieves spectral accuracy.

Because \(f\) is periodic and smooth, \(f^{(m)}(2\pi) = f^{(m)}(0)\) for all \(m \geq 0\). Every term \(c_{2k}\) in the Euler–Maclaurin formula is proportional to \(f^{(2k-1)}(2\pi) - f^{(2k-1)}(0) = 0\), so the error decays faster than any power of \(h = 2\pi / N\). For any chosen algebraic power, apply Euler–Maclaurin with enough derivatives. Its endpoint terms vanish and only a remainder of higher order remains. This is the meaning of faster-than-algebraic convergence for a smooth periodic function. Exponential convergence requires the additional analyticity assumption.

To quantify the exponential rate, expand \(f(x)\) in its Fourier series: \[ \begin{align} f(x) = \sum_{k=-\infty}^\infty \hat{f}_k e^{ikx}, \qquad \hat{f}_k = \frac{1}{2\pi} \int_0^{2\pi} f(x) e^{-ikx}\,dx. \end{align} \] The exact integral is \(I(f) = \int_0^{2\pi} f(x)\,dx = 2\pi \hat{f}_0\). The composite trapezoidal rule with \(h = 2\pi / N\) and nodes \(x_j = 2\pi j / N\) for \(j = 0, ..., N - 1\) gives \[ \begin{align} T_N(f) = \frac{2\pi}{N} \sum_{j=0}^{N-1} f(x_j) &= \frac{2\pi}{N} \sum_{j=0}^{N-1} \sum_{k=-\infty}^\infty \hat{f}_k e^{2\pi i j k / N} \\ &= 2\pi \sum_{k=-\infty}^\infty \hat{f}_k \left( \frac{1}{N} \sum_{j=0}^{N-1} e^{2\pi i j k / N} \right). \end{align} \] The inner sum satisfies discrete orthogonality: \[ \begin{align} \frac{1}{N} \sum_{j=0}^{N-1} e^{2\pi i j k / N} = \begin{cases} 1, & k = mN \text{ for some } m \in \fZ, \\ 0, & k \not\equiv 0 \pmod N. \end{cases} \end{align} \] For a frequency not divisible by \(N\), the inner sum is a geometric sum with ratio \(r=e^{2\pi i k/N}\neq1\) and \(r^N=1\). Its value is \((1-r^N)/(1-r)=0\). If \(k\) is divisible by \(N\), every term is one and the normalized sum is one.

Substituting this indicator isolates the aliased modes: \[ \begin{align} T_N(f) = 2\pi \sum_{m=-\infty}^\infty \hat{f}_{mN} = 2\pi \hat{f}_0 + 2\pi \sum_{m \neq 0} \hat{f}_{mN}. \end{align} \] The quadrature error is therefore the tail sum: \[ \begin{align} I(f) - T_N(f) = -2\pi \sum_{m \neq 0} \hat{f}_{mN}. \end{align} \] Because \(f\) is analytic and bounded by \(M_0\) in the strip \(|\operatorname{Im}(z)| < d\), shifting the integration path in the definition of \(\hat{f}_k\) gives the geometric decay \(|\hat{f}_k| \leq M e^{-d|k|}\). Applying this bound: \[ \begin{align} |I(f) - T_N(f)| \leq 2\pi M \sum_{m \neq 0} e^{-d|m|N} = 4\pi M \sum_{m=1}^\infty (e^{-dN})^m = 4\pi M \frac{e^{-dN}}{1 - e^{-dN}} = O(e^{-dN}). \end{align} \]

Because \(d>0\) and \(N\geq1\), \(1-e^{-dN}\geq1-e^{-d}>0\). Hence the displayed fraction is bounded by a fixed constant times \(e^{-dN}\). This supplies a constant independent of \(N\) for the claimed geometric bound.

20.7 Further Exercises

WarningExercise

Method of undetermined coefficients. Find the nodes and weights for a symmetric 3-point rule on \([-1, 1]\) of the form \(\int_{-1}^1 f(x)\,dx \approx w_0 f(-\alpha) + w_1 f(0) + w_2 f(\alpha)\).

  1. For fixed \(\alpha = 1\), enforce exactness for \(f(x) = 1, x, x^2\) to derive the weights of Simpson’s rule: \(w_0 = 1/3, w_1 = 4/3, w_2 = 1/3\).

  2. Let \(\alpha\) be a free parameter. Enforce exactness for \(f(x)=1,x^2,x^4\) to obtain the three-point Gauss–Legendre rule: \(\alpha=\sqrt{3/5}\), \(w_0=w_2=5/9\), and \(w_1=8/9\). Use symmetry to establish exactness for odd powers, then test \(x^6\) to determine the degree of exactness.

  3. Compare the degree of exactness of both rules.

WarningExercise

Romberg tableau construction. Approximate the integral \(I = \int_0^1 e^{-x^2}\,dx\).

  1. Compute \(T(h)\) for \(h = 1, 1/2, 1/4\) using the composite trapezoidal rule.

  2. Construct the first three rows of the Romberg tableau to evaluate \(R(1, 1), R(2, 1)\), and \(R(2, 2)\).

  3. Confirm that \(R(1, 1)\) matches composite Simpson’s rule with \(N = 2\).

WarningExercise

Change of interval and Gaussian quadrature. Let \(\int_a^b f(t)\,dt\) be an integral on an arbitrary interval \([a, b]\).

  1. Derive the affine substitution \(t(x) = \frac{b - a}{2}x + \frac{a + b}{2}\) mapping \(x \in [-1, 1]\) to \(t \in [a, b]\).

  2. Transform the 2-point Gauss–Legendre rule to \([0, 3]\) and approximate \(\int_0^3 \sqrt{1 + t^3}\,dt\).

  3. Compare the result with Simpson’s rule, which uses three evaluations rather than two. Report both the error and the evaluation count.

WarningExercise

Spectral accuracy on periodic integrals. Consider the integral \(I = \int_0^{2\pi} \frac{dx}{2 + \cos x} = \frac{2\pi}{\sqrt{3}}\).

  1. Identify the complex poles of \(f(z) = \frac{1}{2 + \cos z}\) by solving \(\cos z = -2\).

  2. Determine the half-width \(d\) of the strip of analyticity around the real axis.

  3. Evaluate \(T_N(f)\) for \(N = 4, 8, 16\). Confirm that \(|I - T_N(f)|\) decays as \(e^{-d N}\).

NoteFurther reading

Stoer and Bulirsch give a classical numerical-analysis treatment of interpolation and quadrature (Stoer and Bulirsch 2002). Trefethen is especially useful for polynomial approximation, and de Boor for splines (Trefethen 2013; Boor 2001). The short paper by Clenshaw and Curtis is a good example of an algorithmic quadrature paper that remains approachable (Clenshaw and Curtis 1960).