periodic extension
A Fourier series is built entirely from sines and cosines, and every one of those repeats forever with period 2L. So whatever a Fourier series represents, it MUST repeat with that same period — it has no choice. If you feed it a function defined on just one interval of length 2L, the series does not see a lone interval; it sees infinitely many copies of that interval, laid end to end across the whole line. That tiling of copies is the periodic extension.
Concretely, the periodic extension of f takes the values of f on one period and stamps them out repeatedly: the value at x + 2L equals the value at x, for every x. When you compute a Fourier series of f on an interval, you are really computing the Fourier series of this infinite periodic tiling. Everything the series does — where it converges, where it overshoots — is governed by the extended function, not by your original interval in isolation.
The crucial consequence is what happens at the seams. Unless the function's value at the right end matches its value at the left end, the periodic copies do not line up, and the extension has a JUMP at every interval boundary — even if f looked perfectly smooth inside. That manufactured jump is what drives Gibbs ringing and slow convergence at the ends. Choosing a sine, cosine, or full series is really choosing an odd, even, or as-is periodic extension, each engineering the seams differently to match your boundary conditions and keep convergence clean.
Take f(x) = x on the interval -pi to pi and extend it periodically: you get a sawtooth, climbing from -pi up to pi, then dropping instantly back to -pi to start again. The function is smooth inside each period but jumps by 2 pi at every odd multiple of pi. Its Fourier series converges to x in the interior but to 0 (the midpoint) at the jumps, with a Gibbs spike at each.
A smooth-looking function can become a jumpy sawtooth once tiled periodically — and the series sees the sawtooth.
A Fourier series ALWAYS represents the periodic extension, never just your one interval. End-value mismatches you didn't think about become real jumps in the extension, with real Gibbs ringing — so always check whether f's two ends agree before expecting smooth convergence there.