Lably
Skip to content

Clenshaw–Curtis quadrature

  • 11 min read
  • 7 chapters

Related on Lably

Through Integral, Function (mathematics) and Parity (mathematics)

Briefly, the function f(x) to be integrated is evaluated at the N extrema or roots of a Chebyshev polynomial and these values are used to construct a polynomial approximation for the function. This polynomial is then integrated exactly. In practice, the integration weights for the value of the function at each node are precomputed, and this computation can be performed in O(Nlog⁡N) time by means of fast Fourier transform-related algorithms for the DCT.

General method

A simple way of understanding the algorithm is to realize that Clenshaw–Curtis quadrature (proposed by those authors in 1960) amounts to integrating via a change of variable x = cos(θ). The algorithm is normally expressed for integration of a function f(x) over the interval [−1,1] (any other interval can be obtained by appropriate rescaling). For this integral, we can write:

∫−11f(x)dx=∫0πf(cos⁡θ)sin⁡(θ)dθ.

That is, we have transformed the problem from integrating f(x) to one of integrating f(cos⁡θ)sin⁡θ. This can be performed if we know the cosine series for f(cos⁡θ):

f(cos⁡θ)=a02+∑k=1∞akcos⁡(kθ)

in which case the integral becomes:

∫0πf(cos⁡θ)sin⁡(θ)dθ=a0+∑k=1∞2a2k1−(2k)2.

Of course, in order to calculate the cosine series coefficients

ak=2π∫0πf(cos⁡θ)cos⁡(kθ)dθ,k=0,1,2,…,

one must again perform a numeric integration, so at first this may not seem to have simplified the problem. Unlike computation of arbitrary integrals, however, Fourier-series integrations for periodic functions (like f(cos⁡θ), by construction), up to the Nyquist frequency k=N, are accurately computed by the N+1 equally spaced and equally weighted points θn=nπ/N for n=0,…,N (except the endpoints are weighted by 1/2, to avoid double-counting, equivalent to the trapezoidal rule or the Euler–Maclaurin formula). That is, we approximate the cosine-series integral by the type-I discrete cosine transform (DCT):

ak≈2N[f(1)2+f(−1)2(−1)k+∑n=1N−1f(cos⁡[nπ/N])cos⁡(nkπ/N)]

for k=0,…,N and then use the formula above for the integral in terms of these ak. Because only a2k is needed, the formula simplifies further into a type-I DCT of order N/2, assuming N is an even number:

a2k≈2N[f(1)+f(−1)2+f(0)(−1)k+∑n=1N/2−1{f(cos⁡[nπ/N])+f(−cos⁡[nπ/N])}cos⁡(nkπN/2)]

From this formula, it is clear that the Clenshaw–Curtis quadrature rule is symmetric, in that it weights f(x) and f(−x) equally.

Because of aliasing, one only computes the coefficients a2k up to k = N/2, since discrete sampling of the function makes the frequency of 2k indistinguishable from that of N–2k. Equivalently, the a2k are the amplitudes of the unique bandlimited trigonometric interpolation polynomial passing through the N+1 points where f(cos θ) is evaluated, and we approximate the integral by the integral of this interpolation polynomial. There is some subtlety in how one treats the aN coefficient in the integral, however—to avoid double-counting with its alias it is included with weight 1/2 in the final approximate integral (as can also be seen by examining the interpolating polynomial):

∫0πf(cos⁡θ)sin⁡(θ)dθ≈a0+∑k=1N/2−12a2k1−(2k)2+aN1−N2.

Sign in to keep reading

6 more chapters are free with a Lably account.

More in Topics in mathematics