half-range expansion
Often a problem hands you a function on only half a stretch — a temperature shape along a rod from 0 to L, or the initial pluck of a string fixed at both ends — and says nothing about negative x. A Fourier series, though, lives on a full symmetric period. The half-range expansion is the move of inventing the missing half: you mirror your function into -L to 0 in whatever way you please, then run the ordinary Fourier machinery on the doubled-up function. You get to design the symmetry, and that design decides which harmonics appear.
There are two natural choices. Reflect f evenly, f(-x) = f(x), and the resulting Fourier series has only cosines — the half-range cosine series, with a_n = (2/L) integral from 0 to L of f(x) cos(n pi x / L) dx and all b_n = 0. Reflect f oddly, f(-x) = -f(x), and you get only sines — the half-range sine series, with b_n = (2/L) integral from 0 to L of f(x) sin(n pi x / L) dx and all a_n = 0. Both series equal f on the original interval 0 to L; they merely disagree about the fictitious other half, which you never asked about anyway.
Why bother with two versions of the same function? Because boundary conditions choose for you. A sine series has every term equal to zero at x = 0 and x = L, perfect for a string clamped at both ends or a rod held at zero temperature at its ends (Dirichlet conditions). A cosine series has zero slope at both ends, matching an insulated rod with no heat flux through the boundaries (Neumann conditions). So the half-range expansion is not a stylistic flourish — it is how you make the Fourier building blocks obey the physics at the edges, the first concrete step in separation of variables.
Take f(x) = 1 on 0 < x < pi. Its half-range sine series is (4/pi)[ sin x + sin 3x/3 + sin 5x/5 + ... ] (which vanishes at both ends), while its half-range cosine series is simply 1 (constant, with zero slope at both ends). Same f, two different periodic pictures.
The boundary conditions, not the function, decide whether you want the sine or the cosine half-range series.
The odd extension of a function that is nonzero at x = 0 or x = L creates a jump at the ends of the extended period, so its sine series will overshoot there (Gibbs) and converge to 0 at the endpoints — even though your original f was perfectly continuous on 0 to L.