The Relationships Between Chebyshev, Legendre ... - Semantic Scholar

6 downloads 0 Views 526KB Size Report
Jul 19, 2013 - polynomials (including Legendre and Chebyshev) converge equally ..... 4 Properties of the Chebyshev-to-Legendre Transformation Matrices.
J Sci Comput (2014) 59:1–27 DOI 10.1007/s10915-013-9751-7

The Relationships Between Chebyshev, Legendre and Jacobi Polynomials: The Generic Superiority of Chebyshev Polynomials and Three Important Exceptions John P. Boyd · Rolfe Petschek

Received: 23 May 2013 / Revised: 27 June 2013 / Accepted: 3 July 2013 / Published online: 19 July 2013 © Springer Science+Business Media New York 2013

Abstract We analyze the asymptotic rates of convergence of Chebyshev, Legendre and Jacobi polynomials. One complication is that there are many reasonable measures of optimality as enumerated here. Another is that there are at least three exceptions to the general principle that Chebyshev polynomials give the fastest rate of convergence from the larger family of Jacobi polynomials. When f (x) is singular at one or both endpoints, all Gegenbauer polynomials (including Legendre and Chebyshev) converge equally fast at the endpoints, but Gegenbauer polynomials converge more rapidly on the interior with increasing order m. For functions on the surface of the sphere, associated Legendre functions, which are proportional to Gegenbauer polynomials, are best for the latitudinal dependence. Similarly, for functions on the unit disk, Zernike polynomials, which are Jacobi polynomials in radius, are superior in rate-of-convergence to a Chebyshev–Fourier series. It is true, as was conjectured by Lanczos 60 years ago, that excluding these exceptions, the Chebyshev coefficients an usually decrease √ faster than the Legendre coefficients bn by a factor of n. We calculate the proportionality constant a few examples and restrictive classes of functions. The more precise claim that √ for √ bn ∼ π/2 nan , made by Lanczos and later Fox and Parker, is true only for rather special functions. However, individual terms in the large n asymptotics of Chebyshev and Legendre coefficients usually do display this proportionality. Keywords Chebyshev polynomials · Legendre polynomials · Rate of convergence · Jacobi polynomials Mathematics Subject Classification

41A10 · 42C05 · 42A16

J. P. Boyd (B) Department of Atmospheric, Oceanic and Space Science, University of Michigan, 2455 Hayward Avenue, Ann Arbor, MI 48109, USA e-mail: [email protected] R. Petschek Department of Physics, Case Western Reserve University, Cleveland, OH, USA e-mail: [email protected]

123

2

J Sci Comput (2014) 59:1–27

1 Introduction “Chebyshev polynomials are dense in numerical analysis.” —Quoted by J. C. Mason and D. Handscomb on p. 1 of their book [24], where they attribute the comment perhaps to Philip J. Davis, definitely said by George Forsythe, and perhaps others. “Expansions of functions in series of Chebyshev polynomials are thought to converge more rapidly than expansions in series of orthogonal polynomials …Our purpose here is …to provide further solid foundation for the Chebyshev faith.” Theodore “Ted” Rivlin and M. Wayne Wilson [31], p. 312 The popularity of Chebyshev polynomials in numerical analysis has always been haunted by the fact that these are but a particular instance of the vast family of orthogonal polynomials associatedwith the name of Jacobi. Over the years, a continuing quest has been to show that Chebyshev polynomials are optimum in the sense that the maximum pointwise error by a polynomial of degree N is smaller for Chebyshev interpolation and truncated Chebyshev series than for their counterparts in any other Jacobi polynomials. This article has two purposes. The first is to show that there are exceptional situations where Jacobi polynomials are better in an appropriate sense than the Chebyshev polynomials. The second purpose is to explain that the question of the optimality of the Chebyshev polynomials is complicated because there are actually many different definitions of “optimal”. We shall use the standard definitions of the unnormalized Chebyshev and Legendre coefficients as 2 an = π

1 −1

2 f (x)Tn (x) √ dx = 2 π 1−x

2n + 1 bn = 2

1

π f (cos(t)) cos(nt)dt, n > 0

(1)

0

1 f (x)Pn (x)d x, n > 0

(2)

−1

Useful but different definitions of merit include the following: 1. Smallest error in approximating general f (x) in the maximum norm, that is, minimizing E∞ N ≡ max | f (x) − f N (x)| x∈[−1,1]

(3)

2. Smallest error in the weighted L 2 norm α,β EN

1 ≡

(1 + x)α (1 − x)β ( f (x) − f N (x))2 d x

(4)

−1

3. Applicability of the Fast Fourier Transform (FFT) for summation and interpolation. 4. Unweighted integration by parts in variational formulations, i.e., in high order finite element (“spectral element”) methods. 5. Convertibility to a Fourier cosine series. 6. Minimizing interior error for functions with endpoint singularities.

123

J Sci Comput (2014) 59:1–27

3

7. Minimizing the error in approximating functions of the form f (r ) = r m P(r ) where Jacobi polynomials are only used to approximate the factor P(r ), as arise in Fourier expansions of two-dimensional functions on the disc, and similar approximation problems in spherical geometry. As observed by Rivlin and Wilson, there has been a prevailing “Chebyshev faith” which asserts that Chebyshev polynomials are better than any other set of the vast family of Jacobi α,β polynomials Pn (x). Below, we shall talk about the evidence that they and others have offered in support of this “Chebyshev faith”. One obvious exception to the “faith” is that because the Jacobi polynomials are orthogonal with a weight function of (1 + x)α (1 − x)β , it is easy to prove that Jacobi polynomials are optimum for minimizing the weighted least-square (L 2 norm) error with that weight. Of course, minimizing error with a weighting strongly concentrated near one endpoint or the other is usually uninteresting except for special cases noted below. Still, this trivial exception shows the subtle nature of “optimal”. “FFT-Applicability” is important because the Fast Fourier Transform reduces the cost of N -point interpolation or summation from O(N 2 ) operations to O(N log2 (N )), a huge saving when N  1. Legendre polynomials cannot be manipulated by the FFT. However, when partial differential equations are discretized by a variational principle combined with polynomial interpolation, it is helpful to use polynomials which are orthogonal with respect to the trivial weight function. Anthony Patera, who coined the name “spectral elements” for high order finite elements, initially employed Chebyshev polynomials [28]. Shortly thereafter he apostasized from the “Chebyshev faith”: the FFT is useless for the√ low polynomial degree typically employed (N ≤ 9) and the Chebyshev weight function, 1/ 1 − x 2 , creates annoying extra terms when integration-by-parts is applied, as always, to the variational formulation. Today, spectral elements are implemented using Legendre polynomials almost exclusively. The identity Tn (cos(t)) = cos(nt) allows Chebyshev polynomial computations to always be reduced to trigonometric manipulations. Derivatives, for example, can be calculated using the chain rule: dTn 1 =− (−n) sin(nt[x]) dx sin(t)

(5)

and similarly for higher derivatives as reviewed in detail in Appendix E of [6]. The “trignometric connection” is used in the proof of the Lacunary Chebyshev Theorem in the “Appendix”, too. The two remaining categories, optimality for functions with endpoint singularities and optimality for the radial coordinate on the disk and latitudinal coordinate on the sphere, are categories where Gegenbauer polynomials of the appropriate order are much superior to Chebyshev polynomials. Table 1 catalogs these criteria and the best choices for each. These limits to the “Chebyshev faith” will be major themes in what follows. First, though, we will discuss approximation of general f (x) on an interval. Because these questions are difficult, we shall narrow the focus from Jacobi polynomials to the Gegenbauer (also known as “ultraspherical”) polynomials, which are the special case that the weight function is α = β = m −1/2, and often to the even narrower issue of the relationship between Chebyshev and Legendre polynomials. We will return to the cases of endpoint singularities and disk and sphere geometries later. Background material on orthogonal polynomials and their series can be found in [2,3,11,15,18,22,23,25,30,33,34].

123

4

J Sci Comput (2014) 59:1–27

Table 1 Optimality scorecard Criterion of merit

Winner

Remarks

Minimal L ∞ error for general f (x)

Chebyshev

Exceptions noted below

α,β Minimal E N error

α,β Jacobi Pn

FFT-applicability

Chebyshev

Unweighted integration-by-parts (finite/spectral elements) Convertible to Fourier cosine

Legendre Chebyshev

Reduces interpolation cost O(N 2 ) → O(N log2 (N )) Simplifies programming & variational formulation Simplifies programming and theory

Endpoint singularities: minimize interior error Minimize error for f m (θ ) = sinm (θ )P(cos(θ )) where f (λ, θ ) =  m f m (θ ) cos(mλ) Minimize error for f m (r ) = r m P(r ) where f (r, θ ) =  m f m (r ) cos(mθ )

Gegenbauer

Heart of “Gibbs reprojection”

Gegenbauer

Spherical geometry

Jacobi

Cylindrical geometry

By definition

Because the results are not clean (as Lanczos and Fox and Parker claimed) but complicated, we shall examine the problem from multiple perspectives. This is a little confusing, but it is also a sign of topics with depth and interesting mathematics.

2 The Lanczos–Fox–Parker Proposition In 1952, Lanczos [19] offered an argument that Chebyshev series converge more rapidly than series in other Gegenbauer (ultraspherical) polynomials. Fox and Parker [14] elaborated this argument in their book, pp. 17–18. Proposition 1 (Lanczos–Fox–Parker) 1. aˆ nm =

1 dn f (0) n!knm d x n

(6)

2. If the bn are the Legendre coefficients and the an are the Chebyshev coefficients of the same function f (x), then √ πn an , (7) bn ∼ 2 The justification for these two false theorems is as follows. Suppose that the Gegenbauer polynomials are normalized so that Cˆ nm (1) = 1, which is also the maximum value of the polynomial on x ∈ [−1, 1]. (This is not the standard normalization, but has been employed by most authors who have tried to rates of convergence of Chebyshev and Gegenbauer compare ∞ polynomials). Let f (x) = ˆ nm Cˆ nm (x). By repeated integrations-by-parts, the usual n=0 a integral for the coefficients can be written without approximation as

123

J Sci Comput (2014) 59:1–27

5



1

dn f (x)(1 − x 2 )m+n−1/2 d x n −1 d x m aˆ n = 1 n!knm −1 (1 − x 2 )m+n−1/2 d x

(8)

where knm is the coefficient of x n in Cˆ nm (x). The “second law of the mean” in Fox & Parker’s words then gives the exact relationship aˆ nm =

1 dn f (ξ ) n!knm d x n

(9)

for some ξ ∈ [−1, 1]. When m  n, the numerator integrand will be strongly concentrated at the origin. This allows the replacement of ξ by zero, yielding the first part of the proposition. The second follows by substituting the relative magnitudes of knm for the Chebyshev and Legendre poly√ 1/2 nomials, which are respectively kn0 = 2n−1 and kn ∼ 2n / π n. We have to use the vague labels “proposition” and “justification” instead of “theorem” and “proof” because both parts of the proposition are not universally true. Indeed, Fox and Parker furnished their own counterexample, f (x) = |x|, p. 20, which we shall analyze below. The fundamental problem is that the Gegenbauer coefficients live in a two-dimensional parameter space (for a given f (x)), and the Lanczos–Fox–Parker argument corresponds to what Boyd [7] calls the “vertical limit”: m → ∞ for fixed degree n. However, the second part of the proposition is a claim about what happens in the “horizontal limit” of fixed m as n → ∞. Boyd shows that these two limits yield radically different behavior. The second part of the proposition is true occasionally; indeed, we shall prove a theorem that rigorously asserts √ that bn ∼ ( π n/2) an for a restricted class of entire functions, but this Legendre/Chebyshev ratio is not universally true even for all entire functions. The first proposition is not trustworthy either. For the function f (x) = 1/(1 + x 2 ), whose power series has a unit radius of convergence, |d 2n f /d x 2n (0)/(2n!)| = 1 for all n, and √ √ √ LFP = (−1)n (1/4)n−1 ; a2n = 2 (−1)n (3 − 2 2)n = 2 (−1)n (0.17157)n (10) a2n where the exact coefficients are given on p. 51 of [32]. The shakiness of the Lanczos and Fox and Parker arguments was known even to its authors. Rivlin and Wilson [31] tried to add some rigour to the “Chebyshev faith” by proving inequalities about the actual errors. Theorem 1 (Rivlin–Wilson) Suppose f Nm (x) =

N 

aˆ nm Cˆ nm (x)

(11)

n=0

where the Gegenbauer polynomials are normalized so that Cˆ nm (1) = 1. Define m Em N (x) = max | f (x) − f N (x)| x∈[−1,1]

(12)

If either of the conditions is true: 1. aˆ nm ≤ 0 ∀n > m or 2. (−1)n aˆ nm ≤ 0 ∀n > m then m+k Em N ≤ EN , k > 0

(13)

123

6

J Sci Comput (2014) 59:1–27

The conditions are special, so later authors tried to do better. Handscomb [17] proved theorems about error bounds of the form   N ∞      m aˆ n  ≤ ||aˆ m || N ≡ |aˆ nm | (14)  f (x) −   n=N +1

n=0

His strongest theorem requires the assumption that f (x) is analytic within the ellipse in the complex plane defined by (x) = cosh(μ) cos(η), (x) = sinh(μ) sin(η) for η ∈ [−π, π]. He then argues that the error bound will the same as predicted by Lanczos, Fox and Parker, multiplied by the factor H(μ) = 1 − exp(−2μ)

(15)

which we shall dub the “Handscomb” factor. Light [20] provided some counterexamples to show that Chebyshev polynomials do not always give an error smaller than Gegenbauer polynomials for some m > 0. He conjectures, however, that for sufficiently large degree, the Chebyshev polynomials do give the smallest error. He is able to provide some conditions on Chebyshev coefficients, not satisfied by all f (x), which suffice to guarantee Chebyshev are best. However, mere inequalties are not what was asserted by Lanczos, Fox and Parker, who made a much stronger statement about the coefficients, namely that anm is larger than its Chebyshev counterpart by O(n m ), at least in some generic sense. Much more precise relationships between coefficients of different Gegenbauer orders than in the Rivlin and Wilson, Handscomb and Light articles can be obtained by analyzing the elements of the transformation matrices.

3 A Generating Function Illustration The Gegenbauer polynomials, when normalized so that Cˆ nm (1) = 1 [not standard, but convenient for present purposes], have the generating function [33] ∞

 1 = Cnm (1)r n Cˆ nm (x) (1 − 2xr + r 2 )m

(16)

n=0

where r < 1 is a positive constant and where the Cnm without the hat are the Gegenbauer polynomials with standard normalization. From Szegö [34], one obtains Cn(m) (1) =

(n + 2m) n! (2m)

1 ∼ (n + 1)2m−1 √ π



 1 2m−1/2 exp {2m[1 − log(2)]} , m fixed m, n → ∞ n 2m

(17)

The growth of the Gegenbauer coefficients as has two sources. If we expanded the generating function as a series of Chebyshev coefficients, the Chebyshev coefficients are proportional to n m r n where the the n m arises because the function has an m-th order pole on the real axis, though outside the interval x ∈ [−1, 1]. The extra factor of n m in the Gegenbauer coefficients is the “Gegenbauer” penalty: each increase of Gegenbauer superscript m slows convergence of the series by another factor of n. The result is that Chebyshev polynomials are superior here to all members of the Gegenbauer family with larger m.

123

J Sci Comput (2014) 59:1–27

7

The Gegenbauer generating function by itself is far from a proof of the general validity of Lanczos and Fox and Parker’s claim because it is merely an example. We therefore other lines of attack in the following sections. But the generating function turns out to be quite typical.

4 Properties of the Chebyshev-to-Legendre Transformation Matrices Rivlin and Wilson [31] prove a lemma that if f (x) has a uniformly convergent series of Jacobi polynomials, f (x) =

∞ 

f n(α,β) Pn(α,β) (x)

(18)

n=0

then the coefficients in one Jacobi basis are related to those in another basis by (γ ,δ)

fn

=

∞ 

(α,β)

Bn j (α, β; γ , δ) f j

(19)

j=n

where Pn(α,β) (x) =

n 

(γ ,δ)

B jn (α, β; γ , δ) P j

(x)

(20)

j=0

Note that the matrix whose elements are B jn is upper triangular with B jn = 0 for all j > n. Let us specialize to the case where α = β = −1/2 and γ = δ = 0 so that bn =

∞ 

Bn j an

(21)

j=n

where Bn j ≡ Bn j (−1/2, −1/2; 0, 0). Let a be a vector containing the Chebyshev coefficients of a function f (x) and let b denote the corresponding Legendre coefficients. Then

a b = B

(22)

is an upper triangular matrix with the elements where B B00 = 1

(23)

Bnn

(24)

Bn,n+2k B jk

√ π = , n>0 2 (n) (n + 2k)(2n + 1) = − (k − 1) (n + k − 1/2), k > 0, k ∈ N 4k(2n + 2k + 1) = 0 otherwise

(25) (26)

Alpert and Rokhlin [1] have carefully analyzed these matrix elements using the auxiliary functions

123

8

J Sci Comput (2014) 59:1–27

(z + 1/2) (27) (z + 1) √

(z) ≡ z (z) (28) 5 21 399 869 1 1 + − − + + ∼ 1− 8z 128z 2 1, 024z 3 32, 768z 4 4, 194, 304z 6 262, 144z 5 (29) (z) ≡

The asymptotics of the matrix elements in the following are new. Theorem 2 Let Bi j denote the elements of the Chebyshev-to-Legendre transformation matrices. Then 1. √ π Bnn = (30) 2 (n) √ πn 1 (31) = 2 (n) √ πn , n1 (32) ∼ 2 2. (n + 2k)(2n + 1) (k − 1) (n + k − 1/2) (33) Bn,n+2k = − 4k(2n + 2k + 1)

(k − 1) √ (n + k − 1/2)(1 + 2k/n)(1 + 1/(2n)) = − √ n √ (1 + [2k + 1]/[2n]) 1 + [k − 1/2]/n 4k k − 1 √ √ π ∼ n (34) wk , n  1 2 where the elements of the vector w

are independent of n in the asymptotic limit: 1 (k − 1/2) wk ≡ − √ π 2 (k + 1) 1 (k − 1) =−√ √ π 2k k − 1 1 ∼ − √ k −3/2 , k  1 2 π √ 3. The elements wk are the coefficients in the expansion of 1 − z in powers of z. 4. ∞ 

wk = 0

(35) (36) (37)

(38)

k=0

5. ∞  √ (−1)k wk = 2

(39)

k=0

Proof The first two propositions follow from the analytical form of the matrix elements given by Alpert and Rokhlin followed by application of the identity k (k) = (k + 1) and finally application of the asymptotic approximation to (z) given earlier. The third proposition

123

J Sci Comput (2014) 59:1–27

9

Elements of the vector w

1.0 0.8 0.6 0.4

wk 0.2 0 -0.2 -0.4 -0.6

0

1

2

3

4

5

6

7

8

index Fig. 1 Elements of the vector w

such that as n → ∞, the nonzero elements of the Chebyshev-to-Legendre √ √ transformation matrix Bn,n+2k ∼ n( π /2)wk Table 2 Elements of w

and partial sums k

√  − 2 + kj=0 (−1)k w j

1

1

−0.4142

−(1/2) = −0.5

1/2 = 0.4431

0.08579

−(1/8) = −0.125

(3/8) = 0.375

−0.03921

k

wj

0 1 2

j=0 w j

3

−(1/16) = −0.0625

(5/16) = 0.3125

4

−(5/128) = −0.0390625

(35/128) = 0.2734

5

−(7/256) = −0.02734

(63/256) = 0.2461

6

−(21/1, 024) = −0.02051

(231/1, 024) = 0.2256

−0.00894

7

−(33/2, 048) = −0.01611

(429/2, 048) = 0.2095

0.00717

8

−(429/32, 768) = −0.01309

(6, 435/32, 768) = 0.1964

0.02329 −0.01578 0.01157

−0.00592

√ follows from the analytical expression for the power series coefficients of 1 − z. The √ known ∞ k statement that k=0 wk = 0 follows from taking the limit z → 1 in 1 − z = ∞ k=0 wk z ; the fifth is the same idea but in the limit z → −1.   The wk are illustrated in Fig. 1 and their sums displayed in Table 2. The graph and table show several important characteristics. First, the diagonal element √ (Bnn ∼ πn/2) is equal to the Legendre/Chebyshev ratio predicted by Lanczos and by Fox and Parker: their prediction is accurate to the extent that only the diagonal element matters. Second, the diagonal element is opposite in sign to all the off-diagonal elements. This means that if the Chebyshev coefficients are asymptotically one-signed, there will be destructive interference in the sums, and the Legendre/Chebyshev ratios may be much smaller than √ πn/2. Third, if coefficients of the same parity (even or odd degree) alternate in sign, there

123

10

J Sci Comput (2014) 59:1–27

may √be constructive interference in the sums so that the ratio is bigger than the LFP prediction of πn/2. Askey [2] gives the connection coefficients between any two members of the vast Jacobi polynomial family. Thus, our analysis of Legendre-to-Chebyshev coefficients can be greatly generalized.

5 Entire Functions Theorem 3 Let an and bn denote the Chebyshev and Legendre coefficients of a function f (x) where the polynomials are normalized so that Tn (1) = 1 and Pn (1) = 1 for all n. If f (x) is a function such that its Chebyshev coefficients an have the property that for all n > n ∗ |an+k | ≤ exp(−χ(n) k) |an | ∀ k > 0

(40)

where for some positive constant q χ(n) > q log(n) ∀n > n ∗

(41)

√ πn bn ∼ an , 2

(42)

then

Proof The theorem is really a statement that bn ∼ Bnn an because all the other terms in the summation are asymptotically negligible. First, observe from the explicit coefficients given in Table 2 and the asymptotic form for large k that |wk | ≤ (1/2)|w0 | for all k > 0. The assumed bound on the Chebyshev coefficients then implies that ∞ 

|wk an+k | ≤ exp(−χ(n))(1/2)|w0 an |

(43)

k=1

Because exp(−χ(n)) → 0 as n → ∞ because of the of χ(n), it follows that √ assumed √ growth √ indeed bn ∼ Bnn an , which upon inserting Bnn ∼ nw0 = n π/2 yields the theorem.   Theorem 4 All f (x) that satisfy the conditions of the previous theorem are entire functions. Proof The well-known convergence theorem for Jacobi polynomials [34] shows that if we introduce elliptical coordinates in the complex x-plane, then the Jacobi series will converge within the largest ellipse of elliptical radius μ that is free of singularities and also the coefficients can be bounded by |bn | ≤ exp(−[μ + ]n)

(44)

for any finite positive . The unboundedness of χ(n) implies that the only μ consistent with (41) is infinity, which implies that f (x) is an entire function.   Example: Exponential Function. exp(ρ[x − 1]) = exp(−ρ) I0 (ρ) +

∞ 

an Tn (x)

(45)

n=1 ∞

=

 1 {1 − exp(−2ρ)} + bn Pn (x) 2ρ n=1

123

(46)

J Sci Comput (2014) 59:1–27 Table 3 Chebyshev and Legendre coefficients of exp(100[x − 1]) as computed in 100 digits of precision in maple

11 n

an

bn

(bn √ /an ) (2/ π n)

10

4.83534e−02

6.04430e−02

0.446

20

1.07759e−02

2.50252e−02

0.586

30

8.97398e−04

2.95336e−03

0.678

40

2.85829e−05

1.19136e−04

0.744

50

3.58761e−07

1.78131e−06

0.792

60

1.83705e−09

1.04585e−08

0.829

70

3.98409e−12

2.53452e−11

0.858

80

3.80414e−15

2.65497e−14

0.880

90

1.66242e−18

1.25563e−17

0.898

100

3.45337e−22

2.79353e−21

0.913

110

3.53667e−26

3.03910e−25

0.924

120

1.84856e−30

1.67642e−29

0.934

130

5.09488e−35

4.85026e−34

0.942

140

7.63446e−40

7.59583e−39

0.949

150

6.39977e−45

6.63008e−44

0.954

160

3.08205e−50

3.31426e−49

0.959

170

8.74071e−56

9.72998e−55

0.963

180

1.49373e−61

1.71728e−60

0.967

190

1.57146e−67

1.86203e−66

0.970

200

1.03820e−73

1.26561e−72

0.973

where an = 2 exp(−ρ) In (ρ) 2 ∼ exp (n {1 + log(ρ/2)} − (n + 1/2) log(n) − ρ) , n  ρ π √ (2n + 1) 2π bn = √ exp(−ρ) In+1/2 (ρ) 2 ρ

∼ n/2 exp (n {1 + log(ρ/2)} − (n + 1/2) log(n) − ρ) , n  ρ √ 2n + 1 2π exp(−ρ) In+1/2 (ρ) bn = √ an 2 ρ exp(−ρ) 2 In (ρ) √ 1 πn ∼ 1+ + ··· , n  ρ 2 8n

(47) (48) (49) (50) (51) (52)

Although the asymptotic formulas are justified only when n  ρ, numerical computations (Table 3) show that these approximations are in fact not bad even when n ≈ ρ. Example Two: Sum of Bessel functions. The function f (x) = J0 (ρx) + J1 (ρx)

(53)

123

12

J Sci Comput (2014) 59:1–27

0

10

f(x)=J0(80 x)+J1(80 x)

(bn/an)*(2/sqrt(π n)) 1.5

-5

10

1

-10

10

Legendre Chebyshev

0.5

-15

10

-20

10

20 40 60 80 100 120

0

0

degree

50

100

degree

Fig. 2 Left Absolute values of the Chebyshev and Legendre coefficients of f (x) = J0 (ρx) + J1 (ρx). The right is a plot of bn /an , scaled by multiplication by the asymptotic ratio predicted by the theorem; the scaled ratio is predicted to asymptote to one (dashed line) as n → ∞

is also entire where J0 and J1 are the usual Bessel functions. (We add them because J0 is a sum only of even degree polynomials while J1 is odd.) The Chebyshev and Legendre coefficients oscillate for small and moderate degree; the ratio bn /an oscillates wildly without discernible pattern as shown in Fig. 2. However, there is a transition at about degree sixty such that the coefficients fall exponentially with n. Above this degree, the ratio bn /an does indeed asymptote to the predicted ratio. However, the previous theorem is very restrictive. √ Theorem 5 The asymptotic relationship bn ∼ ( π n/2) an is false for some entire functions. Proof by counterexample. By using the m-Lacunary Theorem given in the “Appendix”, for any integer m

exp{ρTm (x)} = I0 (ρ) + 2

∞ 

In (ρ)Tnm (x)

(54)

n=1

Thus, its Chebyshev coefficients are an =

2In/m (ρ), n/m = integer 0, other wise

(55)

The function so defined is an “m-lacunary” series in which each nonzero Chebyshev coefficient is followed by (m − 1) zero coefficients. In contrast, if n is one of the values for which

123

J Sci Comput (2014) 59:1–27

13

f(x)=exponential-cosh, ρ= 500, s=0.5 -1

10

(bn/an)*(2/sqrt( π n))

3

2

-2

10

1 -3

10

0 -4

10

-1 -5

10

-2

Legendre Chebyshev -6

10

0

50

degree

100

-3

0

50

100

degree

Fig. 3 Left Absolute values of the Chebyshev and Legendre coefficients of f (x) =

exp{ρ cos(s)x}cosh ρ sin(s) 1 − x2 for the (arbitrarily chosen) parameter values ρ = 500 and s = 1/2. The right is a plot of bn /an , scaled by multiplication of the asymptotic ratio predicted by Lanczos, Fox and Parker; the scaled ratio is predicted to asymptote to one (dashed line) as n → ∞

an is non-zero and m  1, the matrix transformation shows that √ πn an 2 √ πn an , an−2 = 0 ≈ Bn−2,n an ∼ − 4 √ πn an , an−4 = 0 ≈ Bn−4,n an ∼ − 16 .. .

bn ≈ Bnn an ∼ bn−2 bn−4

(56) (57) (58)

√ The assertion that bn /an ∼ πn/n is not correct in either magnitude or sign for all coefficients.   A less dramatic counterexample is provided by ∞



 exp{ρ cos(s)x}cosh ρ sin(s) 1 − x2 = I0 (ρ) + 2 In (ρ) cos(ns) Tn (x) n=1

Figure 3 shows that the Chebyshev and Legendre coefficients for this function oscillate in degree. However, the local maxima in degree do not coincide. Consquently, the ratio bn /an shown in the right plot oscillates, too, about the ratio predicted by Lanczos, Fox and Parker. However, this example is almost the exception that proves the rule. The curve of Legendre coefficients is clearly above the graph of the Chebyshev coefficients. The right panel of Fig. 3 shows that ratio bn /an is oscillating about the predicted magnitude. The prediction of Lanczos is still true in an averaged sense.

123

14

J Sci Comput (2014) 59:1–27

6 Two Examples of Functions with Geometric Convergence Define elliptical coordinates in the complex plane by x = cosh(μ) cos(η), y = −sinh(μ) sin(η)

(59)

If a function f (x) is singular somewhere on the ellipse μ = μs , but not for smaller μ, then its Gegenbauer series will converge everywhere inside the ellipse μ = μs and its Jacobi coefficients satisfy an inequality of the form |anm | ≤ constant exp(−[μs − ]n) ∀n > n ∗

(60)

where  > 0 is arbitrarily small; the parameter  and the restriction to n > n ∗ are included to accommodate slower-than-exponential factors of n such as powers and logarithms of n in the asymptotic approximation of the Gegenbauer coefficients as n → ∞ [6]. Two useful examples in this class are the functions f 1 (x) ≡

1 , ρ > 1, μs = arccosh(ρ) ρ−x

(61)

1+x , ρ > 0, μs = arcsinh(ρ) ρ2 + x 2

(62)

and f 2 (x) ≡

These have respectively a simple pole at x = ρ on the real axis (but off the interval x ∈ [−1, 1] for ρ > 1) and a pair of poles on the imaginary axis at x = ±iρ. The Chebyshev coefficients for both have the asymptotic magnitude |an | ∼ c exp(−nμ) where the positive constants c are known analytically but their dependence on ρ is irrelevant for present purposes. The difference between these two functions is that the coefficients of f 1 are everywhere positive whereas the coefficients of f 2 of the same parity (even or odd) alternate in sign, i. e., sgn(a2n+2 ) = −sgn(a2n ). It follows that for function f 1 bn /an ≡ r1 (μ) (63) √ π 1√ {w0 an + w1 an+2 + w2 an+4 + · · · } (64) n = an 2 √ √ π = n {w0 + w1 exp(−2μ) + w2 exp(−4μ) + · · · } (65) 2 √ √ π

1 − exp(−2μ) (66) = n 2 where we used an+2k = an exp(−2kμ) for this function to get the third line and exploited the √ fact that third line is in the form of a power series and the wk are the coefficients of 1 − z to obtain the final ratio. Similarly, taking into account the alternation of signs in its coefficients, for f 2 (x) bn /an ≡ r2 (μ) √ π 1√ {w0 an + w1 an+2 + w2 an+4 + · · · } n = an 2 √ √ π = n {w0 − w1 exp(−2μ) + w2 exp(−4μ) + · · · } 2 √ √ π

1 + exp(−2μ) = n 2

123

(67) (68) (69) (70)

J Sci Comput (2014) 59:1–27

15

(b n/a n) / [ sqrt(nπ)/2 ] 2

2

f2= 1/(0.152-x 2) μ=0.149 1.5

1.5

1+exp(-2μ) 1

Lanczos-Fox-Parker

1

Lanczos-Fox-Parker

1-exp(-2μ) 0.5

0.5

f1=1/(1.012-x) μ=0.155 0

0

50

100

150

degree

0

0

50

100

150

degree

Fig. 4 Left Scaled ratio bn /an for f 1 (x; ρ = 1.012) = 1/(1.012 − x) (solid line) and its predicted value,

1 − exp(−2μ) (dashed line) where μ is the elliptical coordinate of the pole of f 1 (x). Right Same but for

f 2 (x; ρ = 0.15) = (1 + x)/(0.152 + x 2 ). The dashed curve is the prediction 1 + exp(−2μ) (dashed line) where μ is the elliptical √coordinate of the pole of f 1 (x).The ratios of Legendre to Chebyshev coefficients were scaled by dividing by π n/2. The Lanczos–Fox–Parker prediction is one, marked by dotted lines

Figure 4 shows that for both these functions, the ratio of bn /an does indeed rapidly asymptote to the predicted values. Neither agrees with the Lanczos–Fox–Parker prediction of a scaled ratio of one. These functions are special in that the Chebyshev coefficients decay monotonically without oscillations except for the regular alternation of signs for f 2 (x). Even for these very “nice” examples, the Lanczos–Fox–Parker prediction is not correct in detail. However, it is correct √ in magnitude in the sense that the Legendre coefficients are indeed O( n) relative to their Chebyshev counterparts

7 An Algebraic Rate of Convergence 7.1 Endpoint Singularities √ The function 1 − x 2 is different from any of the previous examples because (i) this f (x) has branch points at both endpoints of the approximation interval and (ii) the Legendre and Chebyshev coefficients are asymptotically the same except for a proportionality factor which √ is independent of n instead of the n observed in all previous examples:

1 − x2 =

∞ ∞  2 π  + a2n T2 j (x) = + b2n P2n (x) π 4 j=1

(71)

n=1

where a2n = −

1 4 π 4n 2 − 1

(72)

123

16

J Sci Comput (2014) 59:1–27

π , n1 n2 (n − 1/2) (n + 1/2) = −(4n + 1) 8 (n + 1) (n + 2) 1 1 1 1 ∼− 2 + + ··· 2n 4 n3 ∼ (π/2)a2n ∼−

b2n

b2n

(73) (74) (75) (76)

How is this possible given that√ all the elements of the Chebyshev-to-Legendre transformation matrix are individually O( n) for large row number n? Note that ∞ ∞  1 1  1 − (1 + 2k/n)κ wk = w 1 − (77) k (n + 2k)κ nκ (1 + 2k/n)κ k=0 k=0 ∞  ∞  1 − (1 + 2k/n)κ 1  wk − wk (78) = κ n (1 + 2k/n)κ k=0 k=0 ∞  1  1 − (1 + 2k/n)κ wk (79) = − κ n (1 + 2k/n)κ k=0

where we have used (38) in the last line, the fourth proposition of the theorem, to show that the first sum is zero. The remaining summand is zero for k = 0, rises to a small maximum and√then decays monotonically as k −3/2 so that the sum has a magnitude proportional to 1/ n. We shall not attempt to evaluate this sum through more subtle asymptotic arguments because a 40 year-old theorem of David Elliott and his student P. Tuan provides the answer, not only for the Legendre and Chebyshev polynomials but for Jacobi polynomials of all orders. We specialize their result to the Gegenbauer polynomials: Theorem 6 (Gegenbauer Coefficients for Functions with Endpoint Branch Points) Define the Gegenbauer polynomials as those polynomials with the orthogonality integral 1

(1 − x 2 )m−1/2 Cˆ nm (x) Cˆ km (x)d x = 0 k  = n

(80)

−1

where the subscript is the degree of the polynomial and where the polynomials are normalized so that Cˆ nm (1) = 1

(81)

(Warning: this is not the standard textbook normalization, but is convenient for comparing rates of convergence near the endpoints.) Let f (x) = (1 − x)φ =

∞ 

aˆ nm Cˆ nm (x), φ ≥ 0

n=0

which has a branch point at x = 1 whenever φ is not an integer. Then for m ≥ 0 aˆ nm ∼

123

2φ+1 (φ + m + 1/2) 1 , nm (m + 1/2) (−φ) n 2φ+1

(82)

J Sci Comput (2014) 59:1–27

17

Gegenbauer, m=4.5 n=20

0

10

-1

10

-2

10

-3

10

-4

10

-5

10

   9/2  Fig. 5 C20 (x)

-1

-0.5

0

0.5

1

x

Proof The theorem of Tuan and Elliott [35] gives, changing the normalization so that the Gegenbauer polynomials are one at x = 1, k (n + 2m) (n − φ) (n + m + 1/2) 2φ+1 (φ + m + 1/2) (n + 1) (m + 1/2) (−φ) (n + 2m + φ + 1) (n + m + 1/2) 1 2φ+1 (φ + m + 1/2) , n1 ∼ (1 + m/n)2φ+m+1/2 (m + 1/2) (−φ) n 2φ+1

aˆ nm =



2φ+1 (φ + m + 1/2) 1 , nm (m + 1/2) (−φ) n 2φ+1  

This theorem shows that not merely the Chebyshev polynomials (m = 0) and Legendre polynomials (m = 1/2) √ , but all Gegenbauer polynomials have the same rates of convergence, and not merely for 1 − x 2 but for all functions with fractional power branch points at the ends of the interval. This is an immediate refutation of the Lanczos–Fox–Parker principle that aˆ nm ∼ O(n m aˆ n0 ). However, this is not the whole story. When a flow with shock waves or fronts is computed using a Fourier spectral spatial discretization, the Fourier series converges slowly because the shocks are jump discontinuities. Gottlieb and Shu [16] have shown that exponential convergence can be retrieved over most of the interval between discontinuities by projecting the Fourier partial sum onto high order Gegenbauer polynomials. The implicit message is that Gegenbauer series are a series acceleration method for functions with endpoint singularities. This acceleration-on-the-interior principle is not limited to endpoint jumps, but rather the Elliott–Tuan theorem shows that it applies much more generally. When normalized to an amplitude of one√at the endpoints, Cnm (x) oscillates between peaks and valleys of amplitude 2m (m + 1/2)/ πn −m near the center of the interval. The nonuniformity is so great that a logarithmic scale is needed to show it for even moderate m (Fig. 5).

123

18

J Sci Comput (2014) 59:1–27 coeffs. of sqrt(1-x**2)

error in Gegenbauer series 0

even degree Gegenbauer coefficients

10 -1

10

-5

Legendre (m=1/2)

10 -2

10

m=9/2 m=5/2 -10

-3

10

10

m=9/2 -4

10

Legendre (m=1/2)

-15

2

10

10

-1

0

1

x

degree

Fig. 6 Left Gegenbauer coefficients for three different orders m for f (x) = 1 − x 2 . Bottom Legendre polynomials (m = 1/2). Middle m = 5/2. Top: m = 9/2. Right Pointwise errors. Top Legendre polynomials (m = 1/2). Middle m = 5/2. Bottom m = 9/2. Expansions were computed up to degree 200; only the nonzero (even) coefficients were plotted

The result is that for a given truncation, Gegenbauer polynomials of larger m give much smaller errors on the interior of the interval for functions with endpoint branch points than do Chebyshev polynomials. A typical case is illustrated in Fig. 6. 7.2 Algebraically-Decaying Series That Are Not Asymptotically One-Signed It is emphatically not true that merely because Chebyshev coefficients are decaying as an ∼ n −k , the Legendre coefficients will decay at the same rate. Example: the absolute value function. |x| =





n=1

n=1

2  1  + a2n T2n (x) = + b2n P2n (x) π 2 1 4n 2 − 1 1 (−1)n−1 π n2 4n + 1 (2n − 2)! (−1)n−1 (n − 1)!(n + 1)! 22n 1 √ 3/2 πn √ √ √ π√ π na2n ↔ bn ∼ √ nan , n  1 2

a2n = (−1)n−1 ∼ b2n = ∼ b2n ∼

(83) (84) (85) (86) (87) (88)

√ This ratio is bigger than that predicted by Lanczos, Fox and Parker by a factor of 2. On p. 20 of their book, Fox and Parker offered this as a counterexample to the universality of their own predicted Legendre/Chebyshev ratio.

123

J Sci Comput (2014) 59:1–27

19

√ The reason that the coefficients alternate in sign, in contrast to earlier examples like 1 − x 2 , is that |x| is singular at the origin and not at the endpoints. We √ conjecture that the Legendre coefficients of a function with interior singularities are O( n) larger than their Chebyshev counterparts; functions with endpoint singularities are the only exceptions.

8 Expansions in Spherical and Cylindrical Coordinates 8.1 Sphere Spherical harmonics are, except for one flaw noted later, the best spectral basis for approximation of a function of latitude and longitude on the surface of a sphere. The operational global weather forecasting models of the National Centers for Environmental Prediction in the U. S. and of the eighteen nation European Centre for Medium Range Forecasting, employ spherical harmonic spectral methods. Each basis function is the product of a trigonometric factor of longitude λ with a function of colatitude θ : s, n non-negative integers such that n ≥ s

Yns (λ, θ ) ≡ eisλ Pns (θ )

(89)

Yn−s (λ, θ ) ≡ e−isλ Pns (θ ) (−1)s where the “associated Legendre functions” are Pn|s| ≡ (1 − x 2 )|s|/2 (θ ) Cn−|s| (x), x ≡ cos(θ ) s−1/2

(90)

where the Cnm (x) are the Gegenbauer polynomials. Note that with this convention the associated Legendre subscript n is always greater than or equal to the absolute value of the zonal wavenumber s since a polynomial of negative degree is impossible. The definition of the “degree” n in (90) seems rather peculiar in that the degree of the Gegenbauer polynomial is (n − s); it would seem much more natural to define the degree of the spherical harmonic to equal that of the polynomial. However, the convention shown in (90) has become universally adopted. It can be shown through group theory arguments [6] that a truncation which is equally good or bad anywhere on the globe is a “triangular truncation”: only those harmonics with a subscript n less than some cutoff are included: n≤N

(91)

Thus, the standard convention for the subscript of the associated Legendre function simplifies the description of a triangular truncation. The approximation of a function on the sphere is of the form f (λ, x(θ )) =

N  s=−N

f s (x) exp(isλ),

f s = (1 − x 2 )|s|

N −|s|

s+1/2

aks (θ ) Ck

(x)

(92)

k=0

It can be proved that for any function f (λ, θ ) which is analytic on the sphere, f |s| , the longitudinal wavenumber s component of a Fourier series in longitude, must tend to zero proportionally to (1 − x 2 )|s| , which we shall call the “pole factor”. (Because the spherical coordinate system degenerates to a cylindrical system near both poles, the arguments reviewed

123

20

J Sci Comput (2014) 59:1–27

in [10] apply; a direct proof is given in [27].) Note that the number of latitudinal basis functions applied to each longitudinal Fourier coefficient varies from N for f 0 , the longitudeindependent part of f (λ, x[θ ]), to only a single basis function, the constant, for f ±N (x). Although counterintuitive, the triangular truncation ensures that all components included in a truncation of degree N but not in (N − 1) are oscillating at roughly the same rate. More precisely, the spherical harmonics are eigenfunctions of the Laplace operator on the surface of a sphere: ∇ 2 Y Ns = −N (N +1)Y Ns independent of the superscript s. Since the Laplacian operator measures the curvature of the function it operates on, this is equivalent to the statement that spherical harmonics of the same degree N have the same overall curvature. The axisym1/2 metric (s = 0) component includes C N (x) = PN (x), the N-th degree Legendre polynomial, which is oscillating only in latitude. The only s = |N | term is (1 − x 2 ) N /2 exp(i N λ), which is oscillating at the same rate, but purely in the east-west direction. Other Y Ns are oscillating at the same rate, but in both directions. Gegenbauer polynomials oscillate less and less uniformly on x ∈ [−1, 1] as their order m increases. Why, then, do Gegenbauer polynomials of index m = |s| + 1/2 enter the spherical harmonics, which highly uniform? The answer is that the Gegenbauer polynomials by themselves are not the basis functions. Rather, the fundamental latitudinal basis functions are the Associated Legendre functions, which do oscillate between nearly uniform peaks and valleys. Figure 7 shows the Gegenbauer polynomial and pole factor (top panels, using a logarithmic scale), and their product, an Associated Legendre function (lower panel, linear 4 (x)because the huge variations seen in the scale). It is possible to use a linear scale for P24 logarithmic plots largely cancel out. Spherical harmonics are thus not an exception to the general precept that good basis functions oscillate almost uniformly on the domain. They are an exception to the principle that Chebyshev polynomials are always the best among the Gegenbauer family, at least as measured by error and uniformity on the sphere. For decades, the meteorological folk wisdom has held that the NCEP and ECMWF models are doomed. Because the FFT is not applicable to general Gegenbauer polynomials, slow associated Legendre summations and interpolations are consuming ever-more computational resources. It seemed likely that global spectral models of all kinds would be replaced in the near future by Discontinuous-Galerkin spectral elements or by conservative finite volume schemes. However, FFT-like transforms developed by Mark Tygert have shown such promise that the ECMWF plans to stick with spherical harmonics for a few more years. The issue of “optimality” for the Gegenbauer family of polynomials is indeed complicated. 8.2 Approximations on the Unit Disk The analogues of the spherical harmonics for the disk are the Zernike polynomials. Frits Zernike (1888–1966) was a Dutch physicist who won the Nobel prize for physics in 1953 for his invention of the phase contrast microscope, which allows the study of internal cell structure without the need to stain and kill the cells. (He was the great-uncle of Gerardus ’t Hooft, who won the Nobel Prize in physics in 1999.) He observed that it was convenient to expand functions on the disk as a Fourier series in angle combined with one-sided Jacobi polynomials in radius [36]. These “Zernike polynomials” have become very popular in optics because the lowest few terms of a Zernike expansion have a simple optical interpretation [12]. In contrast to spherical harmonics, the Zernike polynomials are not eigenfunctions of the Laplace operator. (The Laplace eigenfunctions are the products of Bessel functions in radius with a Fourier series in polar angle θ ; these are not a good spectral basis for reasons explained in [10].) However, the Zernike polynomial Z nm is a bivariate polynomial of total degree n in

123

J Sci Comput (2014) 59:1–27

21 4.5

0

C20

0

10

-5

10

-1

(1-x 2)(s/2), s=4

10

-5

0

10

1

-1

0

x

1

x 1

4

P24

0.5 0 -0.5 -1 -1

0

1

x 4 (x), Fig. 7 Upper left m = 9/2. Upper right (1 − x 2 )s/2 for s = 4. Middle bottom their product, P24 normalized to a maximum amplitude of one

the Cartesian coordinates (x, y). This is analogous to spherical harmonics, which become trivariate Cartesian polynomials when multiplied by the appropriate power of the spherical radial coordinate ρ. The formal definition of the Zernike polynomials is Z n−m (r, θ ) = Rnm (r ) sin(mθ ) Z nm (r, θ ) = Rnm (r ) cos(mθ )

n ≥ m ≥ 0, n = m, m + 2, m + 4, . . .

(93)

where the radial Zernike polynomials are m,0 (1 − 2r 2 ) Rnm (r ) = (−1)(n−m)/2 r m P(n−m)/2

(94)

α,β

where Pn (r ) is the usual Jacobi polynomial. (Some authors like Livermore et al. [21] give a different definition which is equivalent to ours because of the identity of the Jacobi α,β β,α polynomials Pn (−x) = Pn (x)). This basis set has been independently rediscovered several times [10]. The label “Zernike” is universal in optics, but the name “one-sided Jacobi” is customary in fluid mechanics. The reason for the adjective “one-sided” is that the Jacobi polynomials Ppα,0 (r ) are orthogonal on the interval r ∈ [−1, 1] with respect to the weight function (1 − r )α . Thus, the set m,0 P(n−m)/2 (1 − 2r 2 ) for different n are polynomials of degrees (n − m)/2 in r 2 , orthogonal with a weight function of r 1+2m . We shall not discuss the relative rates of convergence of Zernike versus Chebyshev–Fourier expansions because this is provided in [10]. However, Zernike are usually superior.

123

22

J Sci Comput (2014) 59:1–27

9 A Different Perspective: Contour Integrals Elliott [13] long ago furnished contour integrals for the coefficients of both Chebyshev polynomial and Legendre polynomial series:  1 f (z) (95) an =

n dz √ √ πi 2 − 1 z + z2 − 1 z C  f (z) 1 (96) bn =

n R(z, n) dz √ √ πi 2 2−1 z − 1 z + z C where, defining the auxiliary function √ z2 − 1 u(z) ≡ √ z + z2 − 1 ∞ 1 2n + 1 dt R(z, n) = u(z) 4 {1 + u(z) (cosh(t) − 1)}n+1 −∞ ∞

=

2n + 1 u(z) 2

2n + 1 = 2



−∞

1 dw  n+1

1 + w2 2u(z) + w 2

1

u(z) 2n

(97)

(98)

(99)

∞ d x exp(−x 2 )s(x)d x

(100)

−∞

1 x s(x) ≡ √       n exp(x 2 /n) − 1 1 + exp(x 2 /n) − 1 /(2u(z))

(101)

where the second form follows from the first by making the change of variable w 2 ≡ u(z)[cosh(t) − 1] from whence follows 2 wdw = u sinh(t)dt, dt = dw 2w(1/u(z))/



(w 2 /u(z) + 1)2 − 1, dt = dw2/ w 2 + 2u(z). The third integral follows from the second √ by the further change x n log(1 + w 2 ) which implies d x = (1/ n)wdw/[(1 + w 2 )x]. (Some preliminary algebra was applied to Elliott’s Legendre integral to bring out the similarity to its Chebyshev counterpart.) Thus, the difference between the contour integrals for Chebyshev and Legendre polynomials is captured, for many functions, by the function R(z, n). This would not at first glance seem to be too helpful. We have already seen oscillations in the coefficients due to interference effects between different singularities, making it impossible to give simple relationships between an and bn for individuals degrees n. Furthermore, the integrals are, well, integrals, which means that the influence of R(z, n) is spread over the entire path of integration. However, for large degree, these coefficient contour integrals can be evaluated asymptotically by a combination of the calculus of residues (for the pole singularities of the function being approximated) and by the method of steepest descent (for entire functions) and similar techniques for a wide variety of functions as illustrated by Elliott and his collaborators [13,35], Miller [26], Boyd [4,5,8] and by our own forthcoming companion paper [29]. The crucial point about these various techniques is that the asymptotic approximations are evaluations of the integral at selected points multiplied by various numerical factors.

123

J Sci Comput (2014) 59:1–27

23

For example, each point singularity of f (z) at some z s = z will make an identical contribution to an and bn except that the latter is multiplied by R(z s , n). The asymptotic, large n coefficients will be of the form m  an ∼ Ak (n) + other terms (102) k=1

bn ∼

m 

Ak (n) R(z k , n) + other terms

(103)

k=1

where z = z k is the location of the singularity. (The detailed form of each singularity contribution is irrelevant here although thoroughly discussed in [4,5,8,13,29,35].) For sufficiently large n, the faster-decaying terms can be ignored in favor of only the terms decreasing most slowly with n. However, there may be more than one slowest-decaying singularity contribution, and some of the others may not be negligible for moderate n. The sum of terms, perhaps each oscillating with n at different rates, may display the complicated relationships between an and bn we have already seen. But the relationship between the Legendre and Chebyshev terms for a single k is simple. The “other terms” include contributions from stationary points as arise in the method of steepest descent for asymptotic approximation of integrals, and these “stationary point” terms would seem to mar the simplicity evident in singularity contributions. The integrand rises steeply in the neighborhood of the stationary point, which allows a local approximation, but the steepest descent term is the result of integrating over a short interval, not a point. However, for all the factors except those which control the location of the stationary point, the Taylor expansions about the stationary point are taken only to zeroth order, that is, R(z s , n) is the only way in which R(z, n) appears in the lowest order steepest descent term derived from the stationary point, z = z s . It follows that the value of R(z s , n) at that point completely controls the relative contributions of that term to the Chebyshev coefficients and Legendre coefficients, regardless of whether the contribution comes from a singularity of f (z) or a stationary point of the integrand of the contour integral. The final formula will probably not be simple because each singularity of f (z) and each relevant stationary point contributes its own residue or asymtotic series to the n-th Chebyshev or Legendre coefficients, and we may observe interference √ effects between different contributions. If, however, R(z, n) is consistently O( n) at the points in the complex plane that have substantial contributions to the integral, the Legendre coefficients √ will be the sum of contributions which individually will be larger by the same factor of n compared to their Chebyshev counterparts. Thus, it is useful to study R(z, n). For n  1,

s(x; n) ∼ 1/ 1 + Ax 2 (1 + O(1/n)), A = 1/(2u(z)n), n  1 (104)



1 R(z, n) ∼ n u(z)K 0 (u(z) n) exp(u(z) n) 2u(z) n (1 + O(1/n) ) (105) 2n √ n

u(z) π (1 + O(1/n) ) (106) ∼ 2 where Eqs. (105) and (106) assume that n|u(z)|  1 in this limit: e.g., that the singularity is not at (or too close to) the endpoints. This confirms that generically, each “selected point” on the contour of integration, i. e., a singularity of f (z) or a saddle point of the integral, contributes√to the Legendre and Chebyshev coefficientds identically except for a factor proportional to n. For large |z|, u(z) ∼ 1/2 and

123

24

J Sci Comput (2014) 59:1–27

Fig. 8 Plots of S(z, , N ) for three different Bernstein ellipses with elliptical coordinates μ = 1/100 [top curve, solid black], μ = 1/10 [middle, long red dashes] and μ = 1/2 [bottom, short green dashes]. The other parameters are  = 8 and N = 40; thus, √ what is plotted is R(z, 320)/[ 8R(z, 40)] (Color figure online)

S=R(z,320)/[sqrt(8) R(z,40)] on Bernstein ellipses

μ=1/100

μ=1/10 μ=1/2

η R(z, n) ∼

1√ πn 2

(107)

as expected. To illustrate the validity of the approximation, we plotted the ratio R(z,  N ) S(z, N ,  ) ≡ √  R(z, N )

(108)

where N and  are user-choosable constants. If the lowest order asymptotic approximation is accurate, than S(z, N ,  ) should be 1 + O(1/N ) for all N  1, and thus the nearness of S to one is a test of the accuracy of the asymptotic approximation to R(z, n). Because the isoconvergence contours for the Chebyshev, Legendre and Jacobi polynomials are confocal ellipses with foci at x = ±1 (“Bernstein ellipses”), it is more illuminating to plot S using elliptical coordinates in the complex z-plane, instead of the more obvious Cartesian coordinates. Each Bernstein ellipse is a curve for fixed μ ≥ 0, parameterized by η ∈ [0, 2π]: z = cosh(μ) cos(η) + i sinh(μ) sin(eta)

(109)

It is only necessary to plot S for one-quarter of each ellipse because |R| is symmetric with respect to both the real and imaginary axes. Figure 8 shows that the asymptotic approximation is very good. No graphs for larger μ are shown because on these near-circular contours, which are farther and farther from the real interval z ∈ [−1, 1] as μ increases, S(z, , N ) is graphically indistinguishable from one. Other experiments confirm the expected 1/N error; when N was doubled, the graphs were unchanged if the vertical range of (S − 1) was simultaneously halved. The largest deviations are in a boundary layer of small μ (long, slender ellipse tightly enclosing the real interval z ∈ [−1, 1]) and also small η, which corresponds to the neighborhood of the endpoints z = ±1. We have already seen, however, that the endpoints are special, so the breakdown of the asymptotic approximation for R(z, n) around z = ±1 is expected. The contour integral analysis thus fully confirms all that we have presented in earlier sections.

123

J Sci Comput (2014) 59:1–27

25

10 Summary The relative merit of Chebyshev polynomials versus other members of the Jacobi family is shown to be complicated. Particular Jacobi or Gegenbauer polynomials are better than Chebyshev for the following situations: (i) functions f (x) with endpoint singularities (ii) the radial dependence of functions f (r, θ ) on a disk and (iii) the latitudinal dependence of functions f (λ, θ ) on a sphere. Otherwise, it is generically true that the Legendre coefficients bn converge more √ slowly than the corresponding Chebyshev coefficients an in the sense that bn ∼ O( n)an . It is impossible to give the proportionality constant in the ratio bn /an precisely as this is function-dependent even within the class of entire functions. We have been able to evaluate the precise Legendre-Chebyshev relationship for some special classes and examples. Asymptotically, as n → ∞, the Chebyshev and Legendre coefficients are given by the sum of residues, branch points and steepest descent stationary points. Individually, these contributions are in the predicted√ratio: the Legendre terms are larger than their Chebyshev counterparts by precisely (1/2) π n except for endpoint contributions. The relationships between individual bn and an are more complicated because of interference between different asymptotic terms, each oscillating with degree n at its own frequency. Acknowledgments This work was supported by NSF Grants OCE0451951, ATM 0723440 and OCE 1059703. We thank the reviewer for helpful comments.

Appendix: Lacunary Chebyshev Theorem Definition 1 (m-Lacunary Series) A Chebyshev series of the form f (x) =

∞ 

an Tnm (x)

(110)

n=0

so that each nonzero Chebyshev coefficient is followed by (m − 1) zero coefficients is an m-lacunary series. We must append a warning: the term “lacunary”, which is a Latin adjective that simply means “having gaps”, is often applied in mathematics in the narrow sense of a power series or Fourier series whose gaps of zero coefficients increase as a geometric progression or faster so that the sum is a “lacunary function” which cannot be analytically continued beyond a “natural boundary”. Theorem 7 (m-Lacunary Chebyshev Series) Suppose f (x) ≡ g(Tm (x))

(111)

where m is an integer and g(x) is analytic everywhere on x ∈ [−1, 1] with the Chebyshev series ∞  gn Tn (x) (112) g(x) ≡ n=0

Then all Chebyshev coefficients of f (x) whose degrees are not multipliers of m are zero. More precisely f (x) ≡

∞ 

gn Tnm (x)

(113)

n=0

123

26

J Sci Comput (2014) 59:1–27

Proof With the trigonometric change of coordinate, x = cos(t), f (cos(t)) = g(cos(mt)). With the further change of coordinate T ≡ mt, this becomes g(cos(T )) which, because of the analyticity of g has a nice Fourier cosine series in T : g(cos(T )) ≡

∞ 

gn cos(nT )

(114)

n=0

Converting this series back to t gives a Fourier series in which all terms except those whose degrees are multiples of m are missing. g(cos(mt)) ≡

∞ 

gn cos(nmT )

(115)

n=0

The substitution T = arccos(x) and recalling that Tk (x) = cos(karccos(x)) gives the theorem.   A simpler version of this theorem was proved in [9]. A special case is the long-known identity Tn (Tm (x)) = Tmn (x).

References 1. Alpert, B.A., Rokhlin, V.: A fast algorithm for the evaluation of Legendre expansions. SIAM J. Sci. Comput. 12, 158–179 (1991) 2. Askey, R.: Orthogonal Polynomials and Special Functions. SIAM, Philadelphia (1975) 3. Beals, R., Wong, R.: Special Functions: A Graduate Text. Cambridge University Press, Cambridge (2010) 4. Boyd, J.P.: The rate of convergence of Hermite function series. Math. Comput. 35, 1309–1316 (1980) 5. Boyd, J.P.: The optimization of convergence for Chebyshev polynomial methods in an unbounded domain. J. Comput. Phys. 45, 43–79 (1982) 6. Boyd, J.P.: Chebyshev and Fourier Spectral Methods, 2d edn, p. 665. Dover, Mineola, New York (2001) 7. Boyd, J.P.: Trouble with Gegenbauer reconstruction for defeating Gibbs’ phenomenon: Runge phenomenon in the diagonal limit of Gegenbauer polynomial approximations. J. Comput. Phys. 204, 253–264 (2005) 8. Boyd, J.P.: Asymptotic Fourier coefficients for a c∞ bell (Smoothed-“Top-Hat” Function) and the Fourier Extension Problem. J. Sci. Comput. 29, 1–24 (2006) 9. Boyd, J.P.: Computing the zeros, maxima and inflection points of Chebyshev, Legendre and Fourier series: solving transcendental equations by spectral interpolation and polynomial rootfinding. J. Eng. Math. 56, 203–219 (2006) 10. Boyd, J.P., Yu, F.: Comparing six spectral methods for interpolation and the Poisson equation in a disk: radial basis functions, Logan-Shepp ridge polynomials, Fourier-Bessel, Fourier-Chebyshev, Zernike polynomials, and double Chebyshev series. J. Comput. Phys. 230, 1408–1438 (2011) 11. Cheney, E.W.: Introduction to Approximation Theory. McGraw-Hill Book Co., New York (1966) 12. Dai, G.-M., Mahajan, V.N.: Orthonormal polynomials in wavefront analysis: error analysis. Appl. Opt. 47, 3433–3445 (2008) 13. Elliott, D.: The evaluation and estimation of the coefficients in the Chebyshev series expansion of a function. Math. Comput. 18, 274–284 (1964) 14. Fox, L., Parker, I.B.: Chebyshev Polynomials in Numerical Analysis, 2nd edn. Oxford University Press, London (1972) 15. Gasper, G., Rahman, M.: Basic Hypergeometric Series. Cambridge University Press, Cambridge (2004) 16. Gottlieb, D., Shu, C.-W.: On the Gibbs phenomenon and its resolution. SIAM Rev. 39, 644–668 (1997) 17. Handscomb, D.C.: The relative sizes of the terms in Chebyshev and other ultraspherical expansions. IMA J. Appl. Math. 11, 241–246 (1973) 18. Jackson, D.: The Theory of Approximation, Vol. 11 of Colloquium Publications (American Mathematical Society). The American Mathematical Society, New York (1930) 19. Lanczos, C.: Introduction. In: Tables of Chebyshev polynomials sn (x) and cn (x). Applied Mathematics Series, Technical Report 9, 191 pp. United States Government Printing Office, Washington, DC (1952)

123

J Sci Comput (2014) 59:1–27

27

20. Light, W.A.: Some optimality conditions for Chebyshev expansions. J. Approx. Theory 27, 113–126 (1979) 21. Livermore, P.W., Jones, C.A., Worland, S.J.: Spectral radial basis functions for full sphere computations. J. Comput. Phys. 227(19), 1209–1224 (2007) 22. Luke, Y.L.: The Special Functions and Their Approximations, vol. I & II. Academic Press, New York (1969) 23. Luke, Y.L.: Mathematical Functions and Their Approximations, p. 566. Academic Press, New York (1975) 24. Mason, J.C., Handscomb, D.C.: Chebyshev Polynomials. Chapman and Hall/CRC Press, Boca Raton, Florida (2003) 25. Mastroianni, G., Milovanovic, G.V.: Interpolation Processes: Basic Theory and Applications. Springer, New York (2008) 26. Miller, G.F.: On the convergence of Chebyshev series for functions possessing a singularity in the range of representation. SIAM J. Numer. Anal. 3, 390–409 (1966) 27. Orszag, S.A.: Fourier series on spheres. Mon. Weather Rev. 102, 56–75 (1974) 28. Patera, A.T.: A spectral element method for fluid dynamics: laminar flow in a channel expansion. J. Comput. Phys. 54, 468–488 (1984) 29. Petschek, R., Boyd, J.P.: Asymptotics of the coefficients of expansions in Jacobi polynomials. (2013) (to be submitted) 30. Rivlin, T.J.: Chebyshev Polynomials From Approximation Theory to Algebra and Number Theory. Wiley, New York (1990) 31. Rivlin, T.J., Wilson, M.W.: An optimal property of Chebyshev expansions. J. Approx. Theory 2, 312–317 (1969) 32. Snyder, M.A.: Chebyshev Methods in Numerical Approximation, p. 150. Prentice-Hall, Englewood Cliffs, New Jersey (1966) 33. Srivastava, H., Manocha, H.: A Treatise on Generating Functions. E. Horwood, New York (1984) 34. Szegö, G.: Orthogonal Polynomials, 2d edn. American Mathematical Society, New York (1959) 35. Tuan, P.D., Elliott, D.: Coefficients in series expansions for certain classes of functions. Math. Comput. 26, 213–232 (1972) 36. Zernike, F.: Beugungstheorie des Schneidenverfahrens und seiner verbesserten Form der Phasenkontrastmethode. Physica 1, 689–704 (1934)

123