Artificial Intelligence 🤖
Power & Fourier Series
Convergence

Convergence

Typically, the approximation of f(x)f(x) given by the Fourier series expansion in Eq. (1.3), improves with the number of modes, nn, used. This is illustrated in Fig. 1.1 below. The function represented by the Fourier series expansion is f(x)=exf(x)=e^{x} (black curve) and the purple and blue curves represent the Fourier series with n=10n=10 and n=100n=100, respectively. The function is defined within [π,π][-\pi, \pi] and is therefore said to be of period 2π2 \pi.

Figure 1.1: Convergence of the Fourier series expansion of f(x)=exf(x)=e^{x} with increasing number of modes.

Dirichlet's theorem

Before stating Dirichlet's theorem, we start this section by giving the definition of a piecewise continuous function.

Definition 1.4 A function f(x)f(x) is piecewise continuous on an interval [a,b][a, b] if:

(a) The limits limxaf(x)\lim _{x \rightarrow a} f(x) and limxbf(x)\lim _{x \rightarrow b} f(x) exist;

(b) f(x)f(x) is continuous at all but possibly a finite number of points;

(c) At points where f(x)f(x) is discontinuous, say x0x_{0}, the left and right limits (i.e. x0x_{0}^{-}and x0+x_{0}^{+}) must exist. Dirichlet's theorem gives sufficient conditions for a function f(x)f(x) to have a Fourier series representation that converges to f(x)f(x).

Theorem: Dirichlet's theorem

The Fourier series of a bounded, periodic and piecewise smooth function, f(x)f(x), (i.e. piecewise continuous f and derivatives) defined on [L,L]f \overline{\text { and derivatives) defined on }[-L}, L], will converge to:

(a) f(x)f(x) at each point in xx where f(x)f(x) is continuous because the left and right limits are equal to f(x)f(x);

(b)

f(x)=12[f(x)+f(x+)]f(x)=\frac{1}{2}\left[f\left(x^{-}\right)+f\left(x^{+}\right)\right]

at those points in xx where f(x)f(x) is discontinuous; xx^{-}and x+x^{+}correspond to points immediately left and right of xx, respectively. So, at a point interior to the interval where f(x)f(x) has a jump discontinuity 1 , the Fourier series converges to the average of the left and right limits there.

In Fig. [1.1, the Fourier series expansion (see purple and blue curves) seems to approach the function f(x)=exf(x)=e^{x} well in the open interval π<t<π-\pi<t<\pi and, as the number of modes increases, the error of the approximation is reduced. As the points of discontinuity are approached however (in Fig. 1.1, the discontinuous points are at x=±πx= \pm \pi ), the Fourier series does not converge to the function f(x)=exf(x)=e^{x}; rather, it is observed to oscillate near the jump discontinuity. These oscillations are not dampened with a higher number of modes; a behaviour known as the Gibbs phenomenon.

As previously mentioned, a function needs to satisfy the periodic condition in order to be represented by a trigonometric Fourier series. In Fig. [1.2, the function (which was defined to be 2π2 \pi-periodic) is plotted over a wider interval, [4π,4π][-4 \pi, 4 \pi]. The main interval function is shown with a thick, red line; this is then repeated on the wider interval. It is observed that the points t=±π,±3πt= \pm \pi, \pm 3 \pi, etc. are discontinuous (these are represented by circle markers in the plot). At the discontinuous points, we expect the Fourier series to converge to the value given by Eq. (1.39); this behaviour is shown at x=±πx= \pm \pi in Fig. 1.1 and indicated by a green, square marker in Fig. 1.2.

1 A{ }^{1} \mathrm{~A} jump discontinuity is one where the limits immediately left and right of it exist, they are finite, but they are not equal to each other.

Figure 1.2: Periodic extension of f(x)=exf(x)=e^{x}. The black and white markers indicate points of discontinuity where the Fourier series will converge to the value given by Eq. (1.39), indicated by the green, square markers. This is also clearly shown to be true at the endpoints of the purple and blue curves in Fig. 1.1. Example 1.3 Consider a periodic function f(x)f(x) of period 2c2 c, defined by:

f(x)={c, for cx03x, for 0<xcf(x)= \begin{cases}c, & \text { for }-c \leq x \leq 0 \\ 3 x, & \text { for } 0<x \leq c\end{cases}

where c>0c>0. Suppose the Fourier series representation of f(x)f(x) is given by fn(x)f_{n}(x). Discuss the convergence of fn(x)f_{n}(x) in [c,3c][-c, 3 c].

Solution The function is defined in [c,c][-c, c]; we need this to be periodic with period 2c2 c. A sketch of this is shown in Fig. [1.3. To discuss the concervence of fn(x)f_{n}(x), we use Dirichlet's theorem (Theorem 1.2): fn(x)f_{n}(x) converges to f(x)f(x) (as nn \rightarrow \infty ) wherever f(x)f(x) is continuous. Within the interval of interest stated in the problem (i.e. [c,3c][-c, 3 c] ), f(x)f(x) is continuous in:

c<x<c,c<x<2c,2c<x<3c.-c<x<c, \quad c<x<2 c, \quad 2 c<x<3 c .

At points of discontinuity, i.e. at x=±c,x±2c,x±3cx= \pm c, x \pm 2 c, x \pm 3 c, we have:

fn(x)12[f(x0)+f(x0+),f_{n}(x) \rightarrow \frac{1}{2}\left[f\left(x_{0}^{-}\right)+f\left(x_{0}^{+}\right),\right.

where at x0x_{0} the graph has a jump. For example, at x0=0x_{0}=0, using Eq. (1.40),

12[f(0)=c+f(0+)=0]=c2;\frac{1}{2}[\underbrace{f\left(0^{-}\right)}_{=c}+\underbrace{f\left(0^{+}\right)}_{=0}]=\frac{c}{2} ;

this is also true at x=2cx=2 c. At x0=cx_{0}=c,

12[f(c)=3c+f(c+)=c]=2c.\frac{1}{2}[\underbrace{f\left(c^{-}\right)}_{=3 c}+\underbrace{f\left(c^{+}\right)}_{=c}]=2 c .

This is also true at x=c,x=3cx=-c, x=3 c. Finally, note that in order to determine the points of convergence of fn(x)f_{n}(x), we did not need to calculate the Fourier series coefficients to find the Fourier series representation of f(x)f(x).

Best approximation property

We have already seen that it is possible to approximate a function f(x)f(x) (given some restrictions on ff ) by a Fourier series expansion. Simply put, we are interested in approximating a function with another (simpler) function. What we discuss in this section is exactly how good an approximation can be. The question we would like to answer is how functions can best be approximated with

Figure 1.3: Plot of the function, f(x)f(x) given in Example 1.3. The black curve shows the function as defined in [c,c][-c, c]. For a function to have Fourier series representation, it needs to satisfy the periodicity condition, i.e. f(x+2c)=f(x)f(x+2 c)=f(x) implying that the function repeats it self every 2c2 c. The periodic extension of f(x)f(x) is shown in red for cx5cc \leq x \leq 5 c.

simpler functions, and how to quantitatively characterise the errors introduced. We start off with a function f(x)f(x) defined on an interval [π,π][-\pi, \pi] which can be represented by a Fourier series (in that interval). So far, we have talked about the Fourier series of a function as an infinite series; now we refer to the sum of the first NN terms of the infinite series as the Nth \boldsymbol{N}^{\text {th }} partial sum, given as follows:

f(x)a02+n=1Nancos(nx)+bnsin(nx).f(x) \approx \frac{a_{0}}{2}+\sum_{n=1}^{N} a_{n} \cos (n x)+b_{n} \sin (n x) .

Note the \approx notation since Eq. (1.41) is said to be an approximation of f(x)f(x) for a fixed value of NN. Now, suppose we have another function F(x)F(x) given as

F(x)=A02+n=1NAncos(nx)+Bnsin(nx),F(x)=\frac{A_{0}}{2}+\sum_{n=1}^{N} A_{n} \cos (n x)+B_{n} \sin (n x),

which is a trigonometric polynomial of the same degree NN as Eq. (1.41). Is Eq. (1.41) the best approximation of ff for fixed NN ? To answer that, we discuss error analysis. We want the error between f(x)f(x) and F(x)F(x) to be as small as possible to consider the approximation a good one. In terms of Fourier series error analysis, we define the square error, EE of FF relative to ff in the interval [π,π][-\pi, \pi] as follows:

E=ππ(fF)2dxE=\int_{-\pi}^{\pi}(f-F)^{2} d x

We want to show that for given NN, the error of the approximation is minimum if the coefficients An(n0)A_{n}(n \geq 0) and Bn(n1)B_{n}(n \geq 1) are the Fourier coefficients. Expanding Eq. (1.43) yields:

E=ππf2dxππ2fFdx+ππF2dxE=\int_{-\pi}^{\pi} f^{2} d x-\int_{-\pi}^{\pi} 2 f F d x+\int_{-\pi}^{\pi} F^{2} d x

We deal with each one of the integrals on the RHS of (1.44) separately. The first one we leave as is since we are computing this for any function f(x)f(x) that has a Fourier series representation in [π,π][-\pi, \pi]. To determine the third integral on the RHS, we need to square Eq. (1.42) and integrate over the interval. This yields integrals of cos(nx),sin(nx),sin(nx)cos(nx)\cos (n x), \sin (n x), \sin (n x) \cos (n x) which are all zero in [π,π][-\pi, \pi]. The only nonzero integrals are those of cos2(nx)\cos ^{2}(n x) and sin2(nx)\sin ^{2}(n x) which are equal to π\pi, when evaluated between π-\pi and π\pi. Upon making the above-mentioned simplifications, we obtain:

ππF2dx=A02π2+πn=1N(An2+Bn2)\int_{-\pi}^{\pi} F^{2} d x=\frac{A_{0}^{2} \pi}{2}+\pi \sum_{n=1}^{N}\left(A_{n}^{2}+B_{n}^{2}\right)

Similary, using Eqs. (1.41) and (1.42) and integrating the second term on the RHS of Eq. (1.44) over the interval, gives:

2ππfFdx=a0A0π+2πn=1N(anAn+bnBn).2 \int_{-\pi}^{\pi} f F d x=a_{0} A_{0} \pi+2 \pi \sum_{n=1}^{N}\left(a_{n} A_{n}+b_{n} B_{n}\right) .

Substituting Eqs. (1.45) and (1.46) in (1.44), yields:

E=ππf2dx2π{a0A02+n=1N(anAn+bnBn)}+π{A022+n=1N(An2+Bn2)}E=\int_{-\pi}^{\pi} f^{2} d x-2 \pi\left\{\frac{a_{0} A_{0}}{2}+\sum_{n=1}^{N}\left(a_{n} A_{n}+b_{n} B_{n}\right)\right\}+\pi\left\{\frac{A_{0}^{2}}{2}+\sum_{n=1}^{N}\left(A_{n}^{2}+B_{n}^{2}\right)\right\}

We now let An=anA_{n}=a_{n} and Bn=bnB_{n}=b_{n} in Eq. (1.47) and call this square error, EE^{*}. This gives:

E=ππf2dxπ[a022+n=1N(an2+bn2)].E^{*}=\int_{-\pi}^{\pi} f^{2} d x-\pi\left[\frac{a_{0}^{2}}{2}+\sum_{n=1}^{N}\left(a_{n}^{2}+b_{n}^{2}\right)\right] .

Finally, we compute the error difference EEE-E^{*} by subtracting Eq. (1.48) from Eq. (1.47):

EE=π{(A0a0)22+n=1N[(Anan)2+(Bnbn)2]}.E-E^{*}=\pi\left\{\frac{\left(A_{0}-a_{0}\right)^{2}}{2}+\sum_{n=1}^{N}\left[\left(A_{n}-a_{n}\right)^{2}+\left(B_{n}-b_{n}\right)^{2}\right]\right\} .

We note that on the RHS of Eq. (1.49), the expression is made up of sums of squares which are always positive for real numbers. Then,

EE0 which in turn implies that EE.E-E^{*} \geq 0 \text { which in turn implies that } E \geq E^{*} .

The two square errors, EE and EE^{*} can only be equal to each other if and only if the coefficients AnA_{n} and BnB_{n} are equal to ana_{n} and bnb_{n}, respectively, which are the Fourier coefficients. It is important to note that the square error EE^{*} as defined in Eq. (1.48) can only decrease with increasing NN. By including more terms in the approximation therefore (i.e. higher values of NN ), the partial sums of the Fourier series of f(x)f(x) yield better approximations to the function f(x)f(x). The results shown in this section yield the following minimum square error theorem.

Theorem Minimum square error theorem

Suppose we have a function f(x)f(x) which has a Fourier series representation on the interval [π,π][-\pi, \pi]. Given a trigonometric polynomial of degree NN

F(x)=A02+n=1NAncos(nx)+Bnsin(nx),F(x)=\frac{A_{0}}{2}+\sum_{n=1}^{N} A_{n} \cos (n x)+B_{n} \sin (n x),

its square error relative to the function f(x)f(x) is minimum if and only if the coefficients in Eq. (1.51) (i.e. An,BnA_{n}, B_{n} ) are the Fourier coefficients of ff. The minimum value of the square error is given by:

E=ππf2dxπ[a022+n=1N(an2+bn2)].E^{*}=\int_{-\pi}^{\pi} f^{2} d x-\pi\left[\frac{a_{0}^{2}}{2}+\sum_{n=1}^{N}\left(a_{n}^{2}+b_{n}^{2}\right)\right] .

It is interesting to observe that increasing NN does not change the best coefficients found for smaller NN. These are always the Fourier series coefficients. The ideas expressed in this section are related to Parseval's theorem which we discuss next. Example 1.4 Compute the minimum square error EE^{*} of F(x)F(x) for fixed NN relative to the function f(x)f(x), where f(x)f(x) is given by:

f(x)=x+π,x(π,π)f(x)=x+\pi, \quad x \in(-\pi, \pi)

Solution To find the minimum square error, we compute the Nth N^{\text {th }} partial sum of F(x)F(x) using the Fourier coefficients of f(x)f(x). This is given by:

F(x)=π+2(sinx12sin(2x)+13sin(3x)+),F(x)=\pi+2\left(\sin x-\frac{1}{2} \sin (2 x)+\frac{1}{3} \sin (3 x)-+\cdots\right),

where a0=π,an=0a_{0}=\pi, a_{n}=0 and bn=2nb_{n}=\frac{2}{n} for n1n \geq 1. Using Eq. (1.52), the minimum square error is calculated from:

E=ππ(x+π)2dxπ(2π2+4n=1N1n2).E^{*}=\int_{-\pi}^{\pi}(x+\pi)^{2} d x-\pi\left(2 \pi^{2}+4 \sum_{n=1}^{N} \frac{1}{n^{2}}\right) .

Parseval's theorem

Parseval's theorem gives a way of relating the Fourier coefficients with the function they describe. In Example 1.5, below, we use this theorem to calculate the sum of an infinite series.

For a piecewise smooth function f(x)f(x) defined on [L,L][-L, L], the Fourier coefficients on [L,L][-L, L] satisfy:

1LLLf(x)2dx=a022+n=1(an2+bn2)\frac{1}{L} \int_{-L}^{L} f(x)^{2} d x=\frac{a_{0}^{2}}{2}+\sum_{n=1}^{\infty}\left(a_{n}^{2}+b_{n}^{2}\right)

To prove Theorem 1.4, we start from the Fourier series expansion given by Eq. (1.29). We multiply Eq. (1.29) by f(x)f(x) to get:

f(x)2=a02f(x)+n=1anf(x)cos(nx)+bnf(x)sin(nx).f(x)^{2}=\frac{a_{0}}{2} f(x)+\sum_{n=1}^{\infty} a_{n} f(x) \cos (n x)+b_{n} f(x) \sin (n x) .

We integrate Eq. (1.55) over [L,L][-L, L] :

LLf(x)2dx=LLa02f(x)dx+LLn=1anf(x)cos(nx)+bnf(x)sin(nx)dx.\int_{-L}^{L} f(x)^{2} d x=\int_{-L}^{L} \frac{a_{0}}{2} f(x) d x+\int_{-L}^{L} \sum_{n=1}^{\infty} a_{n} f(x) \cos (n x)+b_{n} f(x) \sin (n x) d x .

Observe that, by integrating Eq. (1.56) term by term, the integrals in the series on the RHS of Eq. (1.56) are the Fourier coefficients. This gives rise to Eq. (1.54).

Example 1.5 Using Parseval's theorem and the Fourier series of f(x)=x2f(x)=x^{2} on [2,2][-2,2], calculate the sumn=11n4\operatorname{sum} \sum_{n=1}^{\infty} \frac{1}{n^{4}}.

Solution The function f(x)=x2f(x)=x^{2} is even so we only need to compute ana_{n} since bn=0b_{n}=0 for all nn. For n=0n=0,

a0=1202x2dx=43.\begin{aligned} a_{0} & =\frac{1}{2} \int_{0}^{2} x^{2} d x \\ & =\frac{4}{3} . \end{aligned}

For n1n \geq 1,

an=1202x2cos(nπx4)dx=162π2n2\begin{aligned} a_{n} & =\frac{1}{2} \int_{0}^{2} x^{2} \cos \left(\frac{n \pi x}{4}\right) d x \\ & =\frac{16}{2 \pi^{2} n^{2}} \end{aligned}

where we have integrated by parts. The LHS of Eq. (1.54) is given by:

1422x4dx=165\frac{1}{4} \int_{-2}^{2} x^{4} d x=\frac{16}{5}

It follows that Eq. (1.54) yields:

165=(43)2+1622π4n=11n4\frac{16}{5}=\left(\frac{4}{3}\right)^{2}+\frac{16^{2}}{2 \pi^{4}} \sum_{n=1}^{\infty} \frac{1}{n^{4}}

The equation above can be solved for the infinite sum:

n=11n4=π490\sum_{n=1}^{\infty} \frac{1}{n^{4}}=\frac{\pi^{4}}{90}