Unit 8, lesson 113

Convergence of Fourier Series

When the Fourier series of a piecewise smooth periodic function converges, why it lands on the midpoint of a jump, and why the overshoot near a jump never goes away.

  • Theory part 225
  • Practice part 226
  • Fourier Expansions

A square wave has jumps, yet its Fourier series is built from perfectly smooth sines. Something has to give at the jumps. The series makes a fair compromise there and picks the midpoint of the jump, but near the jump the partial sums overshoot by a fixed amount no matter how many terms you take. Knowing when the series converges, and how, tells you how far to trust a truncated Fourier series.

Key terms

Piecewise smooth periodic functions

Definition A function ff with period 2L2L is piecewise C1C^1 (piecewise smooth) if there is a partition −L=x0<x1<⋯<xk=L-L = x_0 < x_1 < \cdots < x_k = L such that on each open piece (xj−1,xj)(x_{j-1}, x_j) the function ff is continuously differentiable, and ff and f′f' restricted to that piece extend to continuous functions on the closed interval [xj−1,xj][x_{j-1}, x_j]. The values of ff at the finitely many partition points do not matter.

In plain words Cut one period into finitely many pieces. On each piece the graph is a smooth curve that stays smooth right up to both ends, with no infinite slopes and no wild oscillation.

Example The square wave and the sawtooth f(x)=xf(x) = x on (−π,π)(-\pi, \pi), repeated with period 2π2\pi, are piecewise C1C^1. The function ∣x∣\sqrt{\lvert x \rvert} on [−π,π][-\pi, \pi] is not, because its derivative 12x\frac{1}{2\sqrt{x}} becomes unbounded as x→0+x \to 0^+.

One-sided limits of the function and its derivative

Definition At each point xx write

f(x+)=lim⁡t→x+f(t),f(x−)=lim⁡t→x−f(t),f(x^+) = \lim_{t \to x^+} f(t), \qquad f(x^-) = \lim_{t \to x^-} f(t),

and similarly f′(x+)f'(x^+) and f′(x−)f'(x^-) for the one-sided limits of f′f'. For a piecewise C1C^1 function all four limits exist and are finite at every xx. The function is continuous at xx exactly when f(x+)=f(x−)=f(x)f(x^+) = f(x^-) = f(x), and at a jump the jump size is f(x+)−f(x−)f(x^+) - f(x^-).

In plain words Approach the point from the right and from the left, and record where the function and its slope are heading. For a piecewise smooth function both sides always give finite answers.

Example For the sawtooth at x=πx = \pi, the left limit is f(π−)=πf(\pi^-) = \pi. To the right of π\pi the graph has restarted, f(π+t)=−π+tf(\pi + t) = -\pi + t for small t>0t > 0, so f(π+)=−πf(\pi^+) = -\pi. The jump size is −2π-2\pi. The derivative is 11 on both sides, so f′(π+)=f′(π−)=1f'(\pi^+) = f'(\pi^-) = 1.

Convergence to the midpoint

Definition Let ff be 2L2L-periodic and piecewise C1C^1. Then for every real xx its Fourier series converges, and

a02+∑n=1∞(ancos⁡nπxL+bnsin⁡nπxL)=f(x+)+f(x−)2.\frac{a_0}{2} + \sum_{n=1}^{\infty} \left(a_n \cos\frac{n\pi x}{L} + b_n \sin\frac{n\pi x}{L}\right) = \frac{f(x^+) + f(x^-)}{2}.

In particular the series converges to f(x)f(x) at every point where ff is continuous.

In plain words Where the graph is unbroken the series gives the right value. At a jump it gives the average of the two sides, whatever value ff happens to have there.

Example The sawtooth has Fourier series

2∑n=1∞(−1)n+1nsin⁡(nx).2\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n} \sin(nx).

At x=πx = \pi every term is 00, and indeed the midpoint is π+(−π)2=0\frac{\pi + (-\pi)}{2} = 0. At x=π2x = \frac{\pi}{2}, where ff is continuous, the series gives

2(1−13+15−⋯ )=2⋅π4=π2=f(π2).2\left(1 - \frac{1}{3} + \frac{1}{5} - \cdots\right) = 2 \cdot \frac{\pi}{4} = \frac{\pi}{2} = f\left(\frac{\pi}{2}\right).

Periodic extension and the endpoints

Definition A function given only on one interval of length 2L2L, say on (−L,L](-L, L], is turned into a 2L2L-periodic function by its periodic extension, F(x+2kL)=f(x)F(x + 2kL) = f(x) for x∈(−L,L]x \in (-L, L] and every integer kk. The Fourier series of ff is the Fourier series of FF. At x=±Lx = \pm L it converges, for piecewise C1C^1 data, to

f(−L+)+f(L−)2.\frac{f(-L^+) + f(L^-)}{2}.

If f(−L+)≠f(L−)f(-L^+) \neq f(L^-), the extension has a jump at ±L\pm L even when ff is smooth on the open interval.

In plain words The series always treats your function as repeating. If the right end does not meet the left end, the repetition creates a jump there, and the series picks its midpoint.

Example For f(x)=x2f(x) = x^2 on [−π,π][-\pi, \pi] the ends match, since f(−π)=f(π)=π2f(-\pi) = f(\pi) = \pi^2, so the extension is continuous and the series equals π2\pi^2 at x=πx = \pi. Put x=πx = \pi into the Fourier series of x2x^2 and use cos⁡(nπ)=(−1)n\cos(n\pi) = (-1)^n. This gives

π2=π23+4∑n=1∞1n2,so∑n=1∞1n2=π26.\pi^2 = \frac{\pi^2}{3} + 4\sum_{n=1}^{\infty} \frac{1}{n^2}, \qquad \text{so} \qquad \sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}.

Gibbs phenomenon

Definition Let ff be piecewise C1C^1 with a jump of size J=f(x0+)−f(x0−)≠0J = f(x_0^+) - f(x_0^-) \neq 0 at x0x_0. Then the partial sums SNS_N overshoot the jump near x0x_0, and the overshoot does not shrink as N→∞N \to \infty. The largest value of SNS_N just to the right of an upward jump tends to

f(x0+)+J(1π∫0πsin⁡tt dt−12)≈f(x0+)+0.0895 J,f(x_0^+) + J\left(\frac{1}{\pi}\int_0^{\pi} \frac{\sin t}{t} \, dt - \frac{1}{2}\right) \approx f(x_0^+) + 0.0895\, J,

and there is a matching undershoot on the other side. The overshoot moves closer to x0x_0 as NN grows, but its height stays near 99 percent of the jump.

In plain words Next to a jump the partial sums always poke out beyond the function by about 99 percent of the jump. More terms make the spike narrower, not shorter.

Example The square wave jumps from −1-1 to 11 at 00, so J=2J = 2. The peak of SNS_N just right of 00 sits at x=πN+1x = \frac{\pi}{N + 1} for odd NN.

NNPeak of SNS_N
991.18231.1823
49491.17911.1791
1991991.17901.1790
limit1.17901.1790

The overshoot stays near 0.179=0.0895⋅20.179 = 0.0895 \cdot 2.

Pointwise versus uniform behavior

Definition Let ff be 2L2L-periodic and piecewise C1C^1.

  1. If ff is continuous on all of R\mathbb{R}, so that no jumps occur even at ±L\pm L after periodic extension, then its Fourier series converges to ff absolutely and uniformly on R\mathbb{R}.
  2. If ff has a jump at x0x_0, the convergence is pointwise but not uniform on any interval containing x0x_0. The partial sums are continuous, and a uniform limit of continuous functions would be continuous.

In plain words A continuous, piecewise smooth periodic function is matched everywhere at once. A function with a jump is matched only point by point, and the Gibbs overshoot keeps the worst error from shrinking.

Example For ∣x∣\lvert x \rvert on [−π,π][-\pi, \pi] the extension is continuous, and the coefficients satisfy ∣an∣≤4πn2\lvert a_n \rvert \le \frac{4}{\pi n^2}. By the Weierstrass M-test the series converges uniformly. For the square wave the worst error sup⁡x∣SN(x)−f(x)∣\sup_x \lvert S_N(x) - f(x) \rvert stays above 0.170.17 for every large NN, because of the overshoot, so the convergence is not uniform.

Check yourself

  1. To what value does the Fourier series of the square wave converge at x=πx = \pi?
Show the answer

There the wave jumps from 11 to −1-1, so the series converges to the midpoint 1+(−1)2=0\frac{1 + (-1)}{2} = 0. Every term 4nπsin⁡(nπ)\frac{4}{n\pi}\sin(n\pi) is indeed 00.

  1. Let f(x)=exf(x) = e^x on (−π,π](-\pi, \pi], extended with period 2π2\pi. What is the sum of its Fourier series at x=πx = \pi?
Show the answer

The extension jumps at π\pi from eπe^{\pi} to e−πe^{-\pi}, so the sum is the midpoint

eπ+e−π2=cosh⁡π.\frac{e^{\pi} + e^{-\pi}}{2} = \cosh \pi.
  1. Evaluate the Fourier series of x2x^2 at x=0x = 0 to find ∑n=1∞(−1)n+1n2\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n^2}.
Show the answer

The extension is continuous at 00, so the series equals 02=00^2 = 0 there and

0=π23+4∑n=1∞(−1)nn2.0 = \frac{\pi^2}{3} + 4\sum_{n=1}^{\infty} \frac{(-1)^n}{n^2}.

Hence

∑n=1∞(−1)n+1n2=π212.\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n^2} = \frac{\pi^2}{12}.

How this lesson connects