Gibbs Phenomenon

We have proven the following results concerning convergence of Fourier .

Theorem. Let f : IR → C be periodic of period 2π and be Riemann integrable on [π,π]. Set, for n ∈ ZZ and N ∈ IN,

1 π N c = f(t)e−int dt S (f; x) = c einx n π N n 2 −π − Z n=XN

S f (M) (Convergence in the mean) The sequence N N∈IN converges in the mean to . That is π  2 lim f(x) − SN (f; x) dx =0 N→∞ Z−π

(P1) (Pointwise convergence) Let x ∈ IR, δ > 0 and M > 0. If

f(x + t) − f(x)| ≤ M|t| for all − δ

lim SN (f; x) = f(x) N→∞

(P2) (Pointwise convergence) Let x ∈ IR, δ > 0 and M > 0. If f(x+) = lim f(x + t) t→0 t>0 and f(x−) = lim f(x + t) exist and t→0 t<0

f(x + t) − f(x+)| ≤ M|t| for all 0

then 1 lim SN (f; x) = f(x+) + f(x−) N→∞ 2   (U) () If f is piecewise smooth on [−π,π] (defined below), then the S f sequence N N∈IN converges uniformly to on any closed interval that does not contain f a point of discontinuity of .

c JoelFeldman. 2017. Allrightsreserved. April5,2017 Gibbs Phenomenon 1 Definition. Let a

(i) f has a continuous derivative on xi−1,xi for each i ≤ i ≤ n and (ii) all of the one–sided limits ′ ′  f(xi+), f(xi−), f (xi+), f (xi−), 1 ≤ i

Example. Here is the graph of a piecewise smooth function. At x = x1 the function has a jump discontinuity. At x = x2, the function is continuous, but its derivative has a jump discontinuity.

x0 x1 x2 x3 x4

We are now going to explore further the behaviour of near jump discon- tinuites. To do so, we’ll look at a specific function in some detail. Let h be the function of period 2π whose values on [−π,π] are

−1 if −π

−3π −2π −π π 2π 3π t −1

We shall see below that the Fourier series expansion for the function h(x) is

∞ 4 h(x) = (2n−1)π sin[(2n − 1)x] n=1 X To get some idea of how good the Fourier series expansion works, look at the graphs of N 4 a number of partial sums SN (x) = n=1 (2n−1)π sin[(2n − 1)x] that are given on the last page of these notes. The first graph is of S (x) = 4 sin(x) and is not a very good likeness P 1 π

c JoelFeldman. 2017. Allrightsreserved. April5,2017 Gibbs Phenomenon 2 4 4 of h(x). The second, S2(x) = π sin(x) + 3π sin(3x), is already starting to look a little like h(x). As we add more and more terms the graphs start looking more and more like h(x), except that they exhibit a little “ringing” right at the discontinuities. This “ringing” is always present in partial sums of Fourier series at jump discontinuities. It is called the Gibbs phenomenon. We now derive a more precise statement of Gibbs phenomenon and verify that it persists for all partial sums.

Theorem. ∞ 4 sin[(2n−1)x] (a) h(x) = π 2n−1 for all x ∈ IR n=1 P N 4 sin[(2n−1)x] 2 x sin(2Nt) (b) The partial sum SN (x) = π 2n−1 = π 0 sin t dt n=1 R (c) On (0,π), SN (x) = SN (π − xP) has

◦ local maxima at x1, x3, ··· , x2N−1 and

◦ local minima at x2, x4, ··· , x2N−2 1 mπ ◦ where xm = 2 N . π (d) SN 2N is the largest of the numbers SN (xm) with m =1, ··· ,N − 1. π 2 π sin t (e) lim SN = dt (which is numerically about 1.179). N→∞ 2N π 0 t  R y

1 S4(t)

π t x1 x2 x3 x4 = 2 π

−1

Proof: (a) For n 6= 0, the nth Fourier coefficient

π π 0 1 −inx 1 −inx −inx cn = 2π h(x)e dx = 2π e dx − e dx Z−π  Z0 Z−π  π 0 0 0 1 1 −inx 1 −inx 1 1 −inx 1 −inx = 2π − in e + in e = 2π in e + in e 0 −π π −π     2 n n = 1 2 − 2 (−1) = iπn if is odd 2π in in 0 if n is even   c JoelFeldman. 2017. Allrightsreserved. April5,2017 Gibbs Phenomenon 3 For n =0 π π 0 1 −inx 1 c0 = 2π h(x)e dx = 2π dx − dx =0 Z−π  Z0 Z−π  1 1 Since h is piecewise smooth and h(0) = 2 h(0+) + h(0−) and h(π) = 2 h(π+) + h(π−) , the Fourier series for h(x) converges pointwise to h(x) for all x. So     2 inx 2 inx 2 −inx 4 1 1 inx −inx h(x) = iπn e = iπn e − iπn e = π n 2i e − e n odd n odd n odd X Xn>0 n o Xn>0  ∞ 4 1 4 sin[(2m−1)x] = π n sin(nx) = π 2m−1 n odd m=1 Xn>0 X

(b) We first compute the derivative. For x 6= 0, using that eix = cos x + i sin x,

N N ′ 4 4 i(2n−1)x 4 eix−ei(2N+1)x SN (x) = π cos[(2n − 1)x] = π Re e = π Re 1−e2ix n=1 n=1 X X 4 e2Nxi−1 4 1 e2Nxi−1 2 sin(2Nx) = π Re eix−e−ix = π sin x Re 2i = π sin x

N N ′ 4 4 4N For x = 0, Sn(0) = π cos[(2n − 1)0] = π 1 = π . Since SN (0) = 0, we have n=1 n=1 P Px 2 sin(2Nt) SN (x) = π sin t dt Z0

′ 2 sin(2Nx) ′ (c) We have already seen, in part (b), that Sn(x) = π sin x so that SN (x) = 0 if ′ 1 mπ and only if sin(2Nx) = 0, x 6= 0. Thus, on (0,π), SN (x) has zeroes at xm = 2 N , m =1, 2, ··· , 2N − 1. As − − π S′′ (x ) = 2N sin xm cos(2Nxm) cos xm sin(2Nxm) = 2N sin xm cos(mπ) cos xm sin(mπ) 2 N m sin2 xm sin2 xm =(−1)m 2N sin xm is positive for m even and negative for m odd, SN has local minima at the xm’s with m even and local maxima at the xm’s with m odd. That SN (π − x) = SN (x) follows immediately from the trig identity that, for any odd integer m,

sin(mπ − y) = sin(mπ) cos(y) − cos(mπ) sin(y) = sin(y)

mπ (d) Let, as in part (c), xm = 2N . Then π π xm+1 2N ′ 2N π π sin(2Nt) sin[2N(t +xm)] ′ sin(2Nt+mπ) S (x ) − S (x ) = dt = ′ dt = dt 2 n m+1 2 n m sin t sin(t +xm) sin(t+xm) xm 0 0 Z π Z Z 2N =(−1)m sin(2Nt) dt sin(t+xm) Z0

c JoelFeldman. 2017. Allrightsreserved. April5,2017 Gibbs Phenomenon 4 π Note that for 0 ≤ t ≤ 2N and 1 ≤ m ≤ N − 1, ◦ 0 ≤ 2Nt ≤ π, so that the numerator sin(2Nt) ≥ 0 and π ◦ 0 ≤ t+xm ≤ xm+1 ≤ xN = 2 so that the denominator sin(t+xm) ≥ 0 and furthermore π increases as m increases, since sin x is increasing on 0 ≤ x ≤ 2 .

So π π 2N 2N 0 < sin(2Nt) dt < sin(2Nt) dt sin(t+xm+1) sin(t+xm) Z0 Z0 Consequently, if m ≥ 1 is odd with m +2 ≤ N − 1, the local maximum

xm+2 xm+1 2 sin(2Nt) 2 sin(2Nt) SN (xm) = SM (xm+2) − π sin t dt − π sin t dt xm+1 xm Z π Z π 2N 2N m+1 2 sin(2Nt) m 2 sin(2Nt) = SM (xm+2) − (−1) dt − (−1) dt π sin(t+xm+1) π sin(t+xm) 0 0 π Z π Z 2N 2N = S (x ) − 2 sin(2Nt) dt + 2 sin(2Nt) dt M m+2 π sin(t+xm+1) π sin(t+xm) Z0 Z0 > SM (xm+2) is larger than the next local maximum, SN (xm+2), to its right. (e) π 2N π π 2 sin(2Nt) s=2Nt 2 sin s SN = dt = s ds 2N π sin t π 2N sin 2N Z0 Z0  π π 2 sin s 2 1 1 = ds + sin s s − ds π s π 2N sin 2N s Z0 Z0 But   1 1 sin s s/2N sin(s/2N) sin s s − = 1 − 2N sin 2N s s sin(s/2N) s/2N As lim sin t = 1, there is a constant Msuch that, for all 0

c JoelFeldman. 2017. Allrightsreserved. April5,2017 Gibbs Phenomenon 5 y

1 S1(t)

−3π −2π −π π 2π 3π t −1

y

1 S2(t)

−3π −2π −π π 2π 3π t −1

y

1 S3(t)

−3π −2π −π π 2π 3π t −1

y

1 S10(t)

−3π −2π −π π 2π 3π t −1

y

1 S30(t)

−3π −2π −π π 2π 3π t −1

c JoelFeldman. 2017. Allrightsreserved. April5,2017 Gibbs Phenomenon 6