The Ringing That Never Dies

Layer sine waves onto a square wave. The ringing beside each jump never dies out, no matter how large NN gets.

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}

Examples & Exercises

Compute the sine-series coefficients b2k−1=4π(2k−1)b_{2k-1} = \frac{4}{\pi(2k-1)} of the square wave by direct integration.

bn=2π∫0πsin⁡(nx) dx=2(1−cos⁡nπ)nπb_n = \frac{2}{\pi}\int_0^{\pi} \sin(nx)\,dx = \frac{2(1-\cos n\pi)}{n\pi}
N=5N = 5: the first 5 odd harmonics mimic the step.
Show proof
  1. The square wave is odd on (−π,π)(-\pi, \pi), so cosine coefficients vanish and bn=1π∫−ππf(x)sin⁡(nx) dx=2π∫0πsin⁡(nx) dxb_n = \frac{1}{\pi}\int_{-\pi}^{\pi} f(x)\sin(nx)\,dx = \frac{2}{\pi}\int_0^{\pi}\sin(nx)\,dx.
  2. Integrating gives 2nπ(1−cos⁡nπ)\frac{2}{n\pi}(1 - \cos n\pi): 00 for even nn, 4nπ\frac{4}{n\pi} for odd nn.
  3. So b2k−1=4π(2k−1)b_{2k-1} = \frac{4}{\pi(2k-1)} and b2k=0b_{2k} = 0.

Verify numerically that the peak near the jump tends to ≈1.179\approx 1.179, i.e. about 9% of the jump. (Numerical check)

max⁡SN→2 Si(π)π≈1.17898\max S_N \to \frac{2\,\mathrm{Si}(\pi)}{\pi} \approx 1.17898
N=50N = 50: peak ≈1.179\approx 1.179 — overshooting 1 by 0.1790.179.
Show proof
  1. Measuring the peak just right of the jump at N=50N = 50 gives ≈1.179\approx 1.179 (theory: 2 Si(π)π≈1.17898\frac{2\,\mathrm{Si}(\pi)}{\pi} \approx 1.17898).
  2. The jump size is 22, so the excess 0.1790.179 above 11 is about 8.95%8.95\% of the jump.
  3. This fraction does not go to 0 as NN grows — that is the Gibbs phenomenon. (Verified numerically; the rigorous proof is omitted.)

8. Series of Functions & Fourier