The Gibbs Phenomenon

Why does the bump beside a jump refuse to die?

Zooming into the bump collapses every case onto one curve. Its first peak is fixed near 1.179. More terms narrow the bump but never lower it.

For example, zoom into the corner of a πŸ“· photo. The jagged part gets narrower as you zoom, but how far it sticks out stays the same.

SNβ€²(x)=2Ο€sin⁑(2Nx)sin⁑xS_N'(x) = \frac{2}{\pi}\frac{\sin(2Nx)}{\sin x}
peakβ†’2Ο€Si(Ο€)β‰ˆ1.17898\text{peak} \to \frac{2}{\pi}\mathrm{Si}(\pi) \approx 1.17898

Examples & Exercises

Differentiate SN(x)=4Ο€βˆ‘k=1Nsin⁑((2kβˆ’1)x)2kβˆ’1S_N(x) = \frac{4}{\pi}\sum_{k=1}^{N}\frac{\sin((2k-1)x)}{2k-1} to prove SNβ€²(x)=2Ο€β‹…sin⁑(2Nx)sin⁑xS_N'(x) = \frac{2}{\pi}\cdot\frac{\sin(2Nx)}{\sin x}.

Show the critical points in (0,Ο€)(0, \pi) are xm=mΟ€2Nx_m = \frac{m\pi}{2N}, with the first peak at x1=Ο€2Nx_1 = \frac{\pi}{2N}. (Complete proof)

βˆ‘k=1Ncos⁑((2kβˆ’1)x)=β„œβˆ‘k=1Nei(2kβˆ’1)x=sin⁑(2Nx)2sin⁑x\sum_{k=1}^{N}\cos((2k-1)x) = \Re\sum_{k=1}^{N}e^{i(2k-1)x} = \frac{\sin(2Nx)}{2\sin x}
SNβ€²(x)=4Ο€β‹…sin⁑(2Nx)2sin⁑x=2Ο€β‹…sin⁑(2Nx)sin⁑xS_N'(x) = \frac{4}{\pi}\cdot\frac{\sin(2Nx)}{2\sin x} = \frac{2}{\pi}\cdot\frac{\sin(2Nx)}{\sin x}
xm=mΟ€2N(m=1,…,2Nβˆ’1)x_m = \frac{m\pi}{2N}\quad (m = 1, \dots, 2N-1)
N=12N = 12: the first peak sits at x1=Ο€24β‰ˆ0.1309x_1 = \frac{\pi}{24} \approx 0.1309 β€” the derivative identity's zeros pin down the peak positions.
Show proof
  1. The sum is finite, so termwise differentiation is legitimate: SNβ€²(x)=4Ο€βˆ‘k=1Ncos⁑((2kβˆ’1)x)S_N'(x) = \frac{4}{\pi}\sum_{k=1}^{N}\cos((2k-1)x). View the cosine sum through complex exponentials: βˆ‘k=1Ncos⁑((2kβˆ’1)x)=β„œβˆ‘k=1Nei(2kβˆ’1)x\sum_{k=1}^{N}\cos((2k-1)x) = \Re\sum_{k=1}^{N}e^{i(2k-1)x}.

  2. It is a geometric series: βˆ‘k=1Nei(2kβˆ’1)x=eix1βˆ’ei2Nx1βˆ’ei2x\sum_{k=1}^{N}e^{i(2k-1)x} = e^{ix}\frac{1 - e^{i2Nx}}{1 - e^{i2x}}.

    Factoring, 1βˆ’ei2Nx=βˆ’2i eiNxsin⁑(Nx)1 - e^{i2Nx} = -2i\,e^{iNx}\sin(Nx) and 1βˆ’ei2x=βˆ’2i eixsin⁑x1 - e^{i2x} = -2i\,e^{ix}\sin x, so the ratio is eiNxsin⁑(Nx)eixsin⁑x=ei(Nβˆ’1)xsin⁑(Nx)sin⁑x\frac{e^{iNx}\sin(Nx)}{e^{ix}\sin x} = e^{i(N-1)x}\frac{\sin(Nx)}{\sin x}.

    Multiplying by the leading eixe^{ix} gives eiNxsin⁑(Nx)sin⁑xe^{iNx}\frac{\sin(Nx)}{\sin x}, whose real part is cos⁑(Nx)sin⁑(Nx)sin⁑x=sin⁑(2Nx)2sin⁑x\frac{\cos(Nx)\sin(Nx)}{\sin x} = \frac{\sin(2Nx)}{2\sin x}.

  3. Hence SNβ€²(x)=4Ο€β‹…sin⁑(2Nx)2sin⁑x=2Ο€β‹…sin⁑(2Nx)sin⁑xS_N'(x) = \frac{4}{\pi}\cdot\frac{\sin(2Nx)}{2\sin x} = \frac{2}{\pi}\cdot\frac{\sin(2Nx)}{\sin x} β€” the Dirichlet kernel in closed form for the odd frequencies.

  4. On (0,Ο€)(0, \pi) we have sin⁑xβ‰ 0\sin x \ne 0, so critical points come from sin⁑(2Nx)=0\sin(2Nx) = 0: 2Nx=mΟ€2Nx = m\pi, i.e. xm=mΟ€2Nx_m = \frac{m\pi}{2N} for m=1,…,2Nβˆ’1m = 1, \dots, 2N-1. On (0,Ο€2N)(0, \frac{\pi}{2N}) both sin⁑(2Nx)>0\sin(2Nx) > 0 and sin⁑x>0\sin x > 0, so SNβ€²(x)>0S_N'(x) > 0; starting from SN(0)=0S_N(0) = 0 the sum climbs monotonically to its first maximum (the peak) at x1=Ο€2Nx_1 = \frac{\pi}{2N}.

Show the first peak's height tends to 2Ο€Si(Ο€)β‰ˆ1.17898\frac{2}{\pi}\mathrm{Si}(\pi) \approx 1.17898, marking the step that passes the limit Nβ†’βˆžN \to \infty under the integral as the analysis step.

Also prove Si(t)=∫0tsin⁑uu du\mathrm{Si}(t) = \int_0^t \frac{\sin u}{u}\,du attains its global maximum at t=Ο€t = \pi. (Complete except for the honestly marked analysis step)

SN(x)=2Ο€βˆ«02Nxsin⁑t2Nsin⁑(t/2N) dtS_N(x) = \frac{2}{\pi}\int_0^{2Nx}\frac{\sin t}{2N\sin(t/2N)}\,dt
β†’analysisΒ step2Ο€βˆ«02Nxsin⁑tt dt\xrightarrow{\text{analysis step}} \frac{2}{\pi}\int_0^{2Nx}\frac{\sin t}{t}\,dt
Siβ€²(t)=sin⁑tt>0onΒ (0,Ο€)\mathrm{Si}'(t) = \frac{\sin t}{t} > 0 \quad \text{on } (0, \pi)
N=12N = 12: measured peak β‰ˆ1.17956\approx 1.17956 against the theoretical limit 2Ο€Si(Ο€)β‰ˆ1.17898\frac{2}{\pi}\mathrm{Si}(\pi) \approx 1.17898 β€” error under 0.00060.0006.
Show proof
  1. Since SN(0)=0S_N(0) = 0, we have SN(x)=∫0xSNβ€²(u) duS_N(x) = \int_0^x S_N'(u)\,du. Substituting the previous problem's identity gives SN(x)=2Ο€βˆ«0xsin⁑(2Nu)sin⁑u duS_N(x) = \frac{2}{\pi}\int_0^x \frac{\sin(2Nu)}{\sin u}\,du; the change of variables t=2Nut = 2Nu (dt=2N dudt = 2N\,du) yields SN(x)=2Ο€βˆ«02Nxsin⁑t2Nsin⁑(t/2N) dtS_N(x) = \frac{2}{\pi}\int_0^{2Nx}\frac{\sin t}{2N\sin(t/2N)}\,dt β€” pure algebra so far.

  2. Substitute the peak first, before taking any limit: put xN=x1=Ο€2Nx_N = x_1 = \frac{\pi}{2N}, so 2NxN=Ο€2Nx_N = \pi is fixed and SN(xN)=2Ο€βˆ«0Ο€sin⁑t2Nsin⁑(t/2N) dtS_N(x_N) = \frac{2}{\pi}\int_0^{\pi}\frac{\sin t}{2N\sin(t/2N)}\,dt β€” the domain is now the fixed interval (0,Ο€](0, \pi], independent of NN. For each fixed tt, 2Nsin⁑(t/2N)β†’t2N\sin(t/2N) \to t (since sin⁑v∼v\sin v \sim v), so the integrand converges pointwise to sin⁑tt\frac{\sin t}{t}.

  3. β˜… Here β€” exactly once β€” we use analysis, applying dominated convergence on the fixed domain (0,Ο€](0, \pi]: for t∈(0,Ο€]t \in (0, \pi], v=t2N∈[0,Ο€2]v = \frac{t}{2N} \in [0, \frac{\pi}{2}] and sin⁑vβ‰₯2vΟ€\sin v \ge \frac{2v}{\pi} yields 2Nsin⁑(t/2N)β‰₯2tΟ€2N\sin(t/2N) \ge \frac{2t}{\pi}, i.e. t2Nsin⁑(t/2N)≀π2\frac{t}{2N\sin(t/2N)} \le \frac{\pi}{2}.

    Hence ∣sin⁑t2Nsin⁑(t/2N)∣=t2Nsin⁑(t/2N)β‹…βˆ£sin⁑ttβˆ£β‰€Ο€2∣sin⁑ttβˆ£β‰€Ο€2\left\lvert\frac{\sin t}{2N\sin(t/2N)}\right\rvert = \frac{t}{2N\sin(t/2N)}\cdot\left\lvert\frac{\sin t}{t}\right\rvert \le \frac{\pi}{2}\left\lvert\frac{\sin t}{t}\right\rvert \le \frac{\pi}{2}, and the dominating function Ο€2∣sin⁑tt∣\frac{\pi}{2}\left\lvert\frac{\sin t}{t}\right\rvert (with ∣sin⁑ttβˆ£β‰€1\left\lvert\frac{\sin t}{t}\right\rvert \le 1) is integrable on the finite interval (0,Ο€](0, \pi]. Dominated convergence gives SN(xN)β†’2Ο€βˆ«0Ο€sin⁑tt dt=2Ο€Si(Ο€)β‰ˆ1.17898S_N(x_N) \to \frac{2}{\pi}\int_0^{\pi}\frac{\sin t}{t}\,dt = \frac{2}{\pi}\mathrm{Si}(\pi) \approx 1.17898.

    Numerical cross-check: it agrees with the Fourier scene's observed GIBBS_PEAK=1.178979744472167\mathrm{GIBBS\_PEAK} = 1.178979744472167 to within 10βˆ’910^{-9}.

  4. Since Siβ€²(t)=sin⁑tt>0\mathrm{Si}'(t) = \frac{\sin t}{t} > 0, Si\mathrm{Si} is strictly increasing on (0,Ο€)(0, \pi).

    For t>Ο€t > \pi, split the tail βˆ«Ο€tsin⁑uu du\int_{\pi}^{t}\frac{\sin u}{u}\,du into lobes Lk=∫kΟ€(k+1)Ο€sin⁑uu duL_k = \int_{k\pi}^{(k+1)\pi}\frac{\sin u}{u}\,du (kβ‰₯1k \ge 1): they alternate in sign, shrink because ∣Lk+1∣=∫kΟ€(k+1)Ο€βˆ£sin⁑v∣v+π dv<∫kΟ€(k+1)Ο€βˆ£sin⁑v∣v dv=∣Lk∣\lvert L_{k+1}\rvert = \int_{k\pi}^{(k+1)\pi}\frac{\lvert\sin v\rvert}{v+\pi}\,dv < \int_{k\pi}^{(k+1)\pi}\frac{\lvert\sin v\rvert}{v}\,dv = \lvert L_k\rvert, and the first lobe L1<0L_1 < 0. Every partial sum of this alternating series is negative (even counts are sums of negative pairs, odd counts add one more negative lobe), so Si(t)<Si(Ο€)\mathrm{Si}(t) < \mathrm{Si}(\pi) for t>Ο€t > \pi.

    Hence Si\mathrm{Si} attains its global maximum at t=Ο€t = \pi, with value β‰ˆ1.85194\approx 1.85194.

Compute that the overshoot is about 8.949%8.949\% of the jump (size 2), and prove why it never disappears as Nβ†’βˆžN \to \infty. (Complete proof)

2Ο€Si(Ο€)βˆ’12β‰ˆ0.08948987β‰ˆ8.949%\frac{\frac{2}{\pi}\mathrm{Si}(\pi) - 1}{2} \approx 0.08948987 \approx 8.949\%
SN ⁣(t2N)β€…β€Šβ†’Nβ†’βˆžβ€…β€Š2Ο€Si(t)(N-independentΒ limit)S_N\!\left(\frac{t}{2N}\right) \;\xrightarrow[N\to\infty]{}\; \frac{2}{\pi}\mathrm{Si}(t) \quad \text{(N-independent limit)}
Even at N=12N = 12 the overshoot is already 8.949%8.949\% of the jump β€” and growing NN leaves this fraction untouched.
Show proof
  1. The peak height tends to 2Ο€Si(Ο€)β‰ˆ1.17898\frac{2}{\pi}\mathrm{Si}(\pi) \approx 1.17898 while the square wave sits at 11, so the overshoot is 1.17898βˆ’1=0.178981.17898 - 1 = 0.17898. The jump runs from βˆ’1-1 to 11 (size 22), hence the overshoot fraction is 0.178982=0.08948987β‰ˆ8.949%\frac{0.17898}{2} = 0.08948987 \approx 8.949\%.

  2. Why it never dies: in the rescaled coordinate t=2Nxt = 2Nx the whole curve converges to the NN-independent limit function 2Ο€Si(t)\frac{2}{\pi}\mathrm{Si}(t) (previous problem). The first bump has a fixed shape and height in tt-coordinates.

  3. Back in the original xx-coordinate the tt-interval is squeezed by 1/(2N)1/(2N): the bump's width βˆΌΟ€/Nβ†’0\sim \pi/N \to 0 narrows, but its height tends to the constant 2Ο€Si(Ο€)βˆ’1β‰ˆ0.179\frac{2}{\pi}\mathrm{Si}(\pi) - 1 \approx 0.179. In one sentence: the bump narrows like 1/N1/N but never shrinks.

  4. This is why the Fourier scene's numerical observation had to be exactly 2Ο€Si(Ο€)\frac{2}{\pi}\mathrm{Si}(\pi) β€” analysis catching up to prove the constant the numerics had already seen.

9. Series of Functions & Fourier