### 2.4 Usual polynomials

#### 2.4.1 Sturm–Liouville problems and convergence

The Sturm–Liouville problems are eigenvalue problems of the form:

on the interval . , and are real-valued functions such that:
• is continuously differentiable, strictly positive and continuous at .
• is continuous, non-negative and bounded.
• is continuous, non-negative and integrable.

The solutions are then the eigenvalues and the eigenfunctions . The eigenfunctions are orthogonal with respect to the measure :

Singular Sturm–Liouville problems are particularly important for spectral methods. A Sturm–Liouville problem is singular if and only if the function vanishes at the boundaries . One can show, that if the functions of the spectral basis are chosen to be the solutions of a singular Sturm–Liouville problem, then the convergence of the function to its interpolant is faster than any power law of , being the order of the expansion (see Section 5.2 of [57]). One talks about spectral convergence. Let us be precise in saying that this does not necessarily imply that the convergence is exponential. Convergence properties are discussed in more detail for Legendre and Chebyshev polynomials in Section 2.4.4.

Conversely, it can be shown that spectral convergence is not ensured when considering solutions of regular Sturm–Liouville problems [57].

In what follows, two usual types of solutions of singular Sturm–Liouville problems are considered: Legendre and Chebyshev polynomials.

#### 2.4.2 Legendre polynomials

Legendre polynomials are eigenfunctions of the following singular Sturm–Liouville problem:

In the notations of Equation (36), , , and .

It follows that Legendre polynomials are orthogonal on with respect to the measure . Moreover, the scalar product of two polynomials is given by:

Starting from and , the successive polynomials can be computed by the following recurrence expression:

Among the various properties of Legendre polynomials, one can note that i) has the same parity as . ii) is of degree . iii) . iv) has exactly zeros on . The first polynomials are shown in Figure 8.

The weights and locations of the collocation points associated with Legendre polynomials depend on the choice of quadrature.

• Legendre–Gauss: are the nodes of and .
• Legendre–Gauss–Radau: and are the nodes of . The weights are given by and .
• Legendre–Gauss–Lobatto: , and are the nodes of . The weights are .

These values have no analytic expression, but they can be computed numerically in an efficient way.

Some elementary operations can easily be performed on the coefficient space. Let us assume that a function is given by its coefficients so that . Then, the coefficients of can be found as a function of , for various operators . For instance,

• if is multiplication by then:
• if is the derivative:
• if is the second derivative:

These kind of relations enable one to represent the action of as a matrix acting on the vector of , the product being the coefficients of , i.e. the .

#### 2.4.3 Chebyshev polynomials

Chebyshev polynomials are eigenfunctions of the following singular Sturm–Liouville problem:

In the notation of Equation (36), , , and .

It follows that Chebyshev polynomials are orthogonal on with respect to the measure and the scalar product of two polynomials is

Given that and , the higher-order polynomials can be obtained by making use of the recurrence
This implies the following simple properties: i) has the same parity as ; ii) is of degree ; iii) ; iv) has exactly zeros on . The first polynomials are shown in Figure 9.

Contrary to the Legendre case, both the weights and positions of the collocation points are given by analytic formulae:

• Chebyshev–Gauss: and .
• Chebyshev–Gauss–Radau: . The weights are and .
• Chebyshev–Gauss–Lobatto: . The weights are and .

As for the Legendre case, the action of various linear operators can be expressed in the coefficient space. This means that the coefficients of are given as functions of the coefficients of . For instance,

• if is multiplication by :
• if is the derivative:
• if is the second derivative:

#### 2.4.4 Convergence properties

One of the main advantages of spectral methods is the very fast convergence of the interpolant to the function , at least for smooth enough functions. Let us consider a function ; one can place the following upper bounds on the difference between and its interpolant :

• For Legendre:
• For Chebyshev:

The are positive constants. An interesting limit of the above estimates concerns a function. One can then see that the difference between and decays faster than any power of . This is spectral convergence. Let us be precise in saying that this does not necessarily imply that the error decays exponentially (think about , for instance). Exponential convergence is achieved only for analytic functions, i.e. functions that are locally given by a convergent power series.

An example of this very fast convergence is shown in Figure 10. The error clearly decays exponentially, the function being analytic, until it reaches the level of machine precision, 10–14 (one is working in double precision in this particular case). Figure 10 illustrates the fact that, with spectral methods, very good accuracy can be reached with only a moderate number of coefficients.

If the function is less regular (i.e. not ), the error only decays as a power law, thus making the use of spectral method less appealing. It can easily be seen in the worst possible case: that of a discontinuous function. In this case, the estimates (50-52) do not even ensure convergence. Figure 11 shows a step function and its interpolant for various values of . One can see that the maximum difference between the function and its interpolant does not go to zero even when is increasing. This is known as the Gibbs phenomenon.

Finally, Equation (52) shows that, if , the interpolant converges uniformly to the function. Continuous functions that do not converge uniformly to their interpolant, whose existence has been shown by Faber [73] (see Section 2.2), must belong to the functions. Indeed, for the case , Equation (52) does not prove convergence (neither do Equations (50) or (51)).

#### 2.4.5 Trigonometric functions

A detailed presentation of the theory of Fourier transforms is beyond the scope of this work. However, there is a close link between discrete Fourier transforms and their spectral interpolation, which is briefly outlined here. More detail can be found, for instance, in [57].

The Fourier transform of a function of is given by:

The Fourier transform is known to converge rather rapidly to the function itself, if is periodic. However, the coefficients and are given by integrals of the form , that cannot easily be computed (as was the case for the projection of a function on orthogonal polynomials in Section 2.3.1).

The solution to this problem is also very similar to the use of the Gaussian quadratures. Let us introduce collocation points . Then the discrete Fourier coefficients with respect to those points are:

and the interpolant is then given by:

The approximation made by using discrete coefficients in place of real ones is of the same nature as the one made when computing coefficients of projection (30) by means of the Gaussian quadratures. Let us mention that, in the case of a discrete Fourier transform, the first and last collocation points lie on the boundaries of the interval, as for a Gauss-Lobatto quadrature. As for the polynomial interpolation, the convergence of to is spectral for all periodic and functions.

#### 2.4.6 Choice of basis

For periodic functions of , the discrete Fourier transform is the natural choice of basis. If the considered function has also some symmetries, one can use a subset of the trigonometric polynomials. For instance, if the function is i) periodic on and is also odd with respect to , then it can be expanded in terms of sines only. If the function is not periodic, then it is natural to expand it either in Chebyshev or Legendre polynomials. Using Legendre polynomials can be motivated by the fact that the associated measure is very simple: . The multidomain technique presented in Section 2.6.5 is one particular example in which such a property is required. In practice, Legendre and Chebyshev polynomials usually give very similar results.