the Gibbs phenomenon
/ Gibbs: as written /
Add up more and more terms of the Fourier series of a function with a sudden jump — a square wave, say — and you will notice something stubborn. Right next to the jump, the partial sum always overshoots, springing up past the true value into a little spike, then ringing with smaller wiggles. You might expect that adding terms would shrink the overshoot to nothing. It does not. The spike gets NARROWER as you add terms, but its HEIGHT stubbornly refuses to fall below a fixed fraction. That persistent overshoot is the Gibbs phenomenon.
Quantitatively, the overshoot settles at about 9% of the size of the jump — roughly 0.0895 times the gap — no matter how many terms you keep. The spike crowds ever closer to the jump and occupies an ever-thinner sliver, so in the mean-square (energy) sense it does vanish: its contribution to the total squared error goes to zero. But in the pointwise-maximum sense it never disappears. It is not a numerical bug or a sign you made an error — it is an intrinsic feature of approximating a discontinuous function by smooth waves.
The intuition: a finite sum of sines and cosines is perfectly smooth, and a smooth curve simply cannot turn a sharp corner instantly. To mimic a vertical jump it must lunge past and swing back, like a car taking a hairpin too fast. Gibbs ringing shows up everywhere jumps meet truncated expansions — image compression (JPEG ringing around edges), audio, and the spectral numerical methods for PDEs, where it limits accuracy near shocks and discontinuities. Smoothing the cutoff (filtering) tames it, at the cost of blurring the jump.
Sum the first 50 terms of a square wave's Fourier series and plot it. Right beside each jump you see a sharp spike rising about 9% above the flat top, followed by decaying ripples. Push to 500 terms: the spike pins itself even closer to the jump and thins out, but its peak still sits about 9% too high — the overshoot height is locked, only its width shrinks.
More terms narrow the overshoot but never lower it below about 9% of the jump.
The Gibbs overshoot does NOT contradict convergence. The series still converges pointwise (to the midpoint at the jump) and in mean square; the overshoot just migrates to an ever-thinner region, so it never goes to zero as a maximum but does vanish as an area.