JOVANA
Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

Complex Form, Even/Odd & Half-Range Expansions

Repackage the Fourier series into one compact complex exponential sum, let a function's symmetry kill half the work, and learn the half-range trick that lets a function defined on just half a window become exactly the sine or cosine series a boundary-value problem demands.

One compact form: the complex exponential series

In the previous guide you built the [[trigonometric-fourier-series|trigonometric Fourier series]]: a periodic function written as a_0/2 plus a sum of a_n cos(n omega x) and b_n sin(n omega x), with the coefficients pried out by the Euler-Fourier formulas. It works, but it is a little bulky — two families of coefficients, a_n and b_n, and two kinds of term to keep straight. There is a slicker repackaging that physicists and engineers reach for almost instinctively, and it rests on one identity you already met in Volume I.

The identity is Euler's formula, e^{i theta} = cos(theta) + i sin(theta). Run it both ways and you can trade every cosine and sine for exponentials: cos(theta) = (e^{i theta} + e^{-i theta})/2 and sin(theta) = (e^{i theta} - e^{-i theta})/(2i). Substitute these into the trigonometric series and the two terms at frequency n collapse into exponentials at +n and -n. The whole sum reorganizes into the [[complex-exponential-fourier-series|complex exponential Fourier series]]: f(x) = sum over all integers n, from minus infinity to plus infinity, of c_n e^{i n omega x}. One family of coefficients c_n, one kind of term, and the index now runs over negative integers too.

The coefficient formula is correspondingly clean: c_n = (1/T) times the integral over one period of f(x) e^{-i n omega x} dx, where T is the period and omega = 2 pi / T. Notice it is one formula for every n, positive, negative, and zero — c_0 is just the average of f over a period, the old a_0/2. The minus sign in the exponent is the whole secret: e^{-i n omega x} is the complex exponential that picks out, by orthogonality, exactly the n-th component and zeros out all the others. We unpack that orthogonality next.

Why the minus sign works, and what c_n means

The trig basis was orthogonal because integrals of cos times sin, and of mismatched harmonics, vanish over a period. The exponentials inherit a cleaner version of the same fact. The integral over one period of e^{i n omega x} times e^{-i m omega x} equals T when n = m and exactly zero when n is different from m, because e^{i(n-m) omega x} is a function that wraps a whole number of times around the unit circle and averages to nothing. This is the orthogonality of the trig system, restated in its most economical form. Multiplying f by e^{-i m omega x} and integrating therefore reads off the single coefficient c_m and silences every other term.

What does a negative index mean physically? Nothing mysterious. The terms n and -n always travel as a pair, and when f is a real signal they are complex conjugates: c_{-n} = conjugate of c_n. Add that pair back together and the imaginary parts cancel, regrowing a real cos plus sin oscillation at frequency n. The dictionary back to the old coefficients is c_n = (a_n - i b_n)/2 for n positive. So a negative frequency is just bookkeeping for the conjugate half of a real oscillation — a price worth paying for one tidy formula.

Symmetry does half your work for free

Before computing a single integral, look at the function's symmetry — it can halve the labor outright. Recall the Volume I vocabulary: a function is even if f(-x) = f(x) (a mirror across the vertical axis, like cos or x^2) and odd if f(-x) = -f(x) (a half-turn about the origin, like sin or x^3). The key fact, easy to see from the definite integral as signed area, is that the integral of an odd function over a symmetric interval from -L to L is exactly zero — the left half cancels the right — while an even function's integral is just twice the integral over the right half.

Now feed that into the coefficient integrals. The cosine is even and the sine is odd, so the products inside the Euler-Fourier formulas inherit a parity. If f is even, then f times sin(n omega x) is odd, its integral over the symmetric period vanishes, and every b_n is zero: an even function is a pure cosine series. If f is odd, the same argument kills every a_n, and f is a pure sine series. You can know in advance, just from a glance at the graph, that half the coefficients are zero — and you never compute those integrals at all.

Half-range expansions: inventing the symmetry you need

Here the symmetry idea turns from a labor-saver into a problem-solver. In a physical problem a function is often given only on half a window — say the temperature profile of a rod for 0 <= x <= L, with nothing said about negative x because the rod simply does not extend there. There is no period yet, no left half, no symmetry. The half-range expansion is the move of *choosing* how to extend the function to the left, and choosing it precisely to manufacture the parity that makes the answer pure cosines or pure sines.

Two choices, two outcomes. Reflect f as an even function (mirror it across x = 0) and then repeat it with period 2L: the result is even, its sine coefficients all die, and you get the half-range cosine series, with a_n = (2/L) times the integral from 0 to L of f(x) cos(n pi x / L) dx. Reflect it instead as an odd function (rotate it through the origin) and repeat with period 2L: now the cosines die and you get the half-range sine series, b_n = (2/L) times the integral from 0 to L of f(x) sin(n pi x / L) dx. Same f on [0, L], two completely different series — both correct on the half-window you were given.

Given f(x) on  [0, L]  only.

EVEN extension  ->  period 2L, mirror across x=0
   half-range COSINE series:
   f(x) = a0/2 + sum_{n>=1} a_n cos(n pi x / L)
   a_n = (2/L) * integral_0^L f(x) cos(n pi x / L) dx
   slope zero at the ends:  f'(0) = f'(L) = 0   (Neumann)

ODD extension   ->  period 2L, rotate about origin
   half-range SINE series:
   f(x) = sum_{n>=1} b_n sin(n pi x / L)
   b_n = (2/L) * integral_0^L f(x) sin(n pi x / L) dx
   value zero at the ends:   f(0) = f(L) = 0     (Dirichlet)
The same f on [0, L] yields a cosine series (even extension, zero slope at the ends) or a sine series (odd extension, zero value at the ends) — you pick whichever matches the boundary condition.

Why a boundary-value problem dictates the choice

The choice is not arbitrary — the physics picks it for you. When you solve the heat equation for a rod or the wave equation for a string by separation of variables, the method delivers a family of building-block solutions, and the conditions at the two ends decide which family. If the ends are held at zero (the temperature is clamped to zero, a Dirichlet condition f(0) = f(L) = 0), only the sines fit, because sin(n pi x / L) already vanishes at both ends. If the ends are insulated so no heat flows (a Neumann condition f'(0) = f'(L) = 0), only the cosines fit, because cos(n pi x / L) has zero slope at both ends.

So the half-range expansion is exactly the bridge between the data and the building blocks. To launch the cooling of a heated rod whose ends are iced, you expand the initial temperature profile as a half-range *sine* series, because each sine mode then decays on its own and respects the clamped ends for all time. Were the rod insulated instead, you would expand the same profile as a half-range *cosine* series. The function you were handed never told you whether to use sines or cosines; the boundary condition did.

One honest warning closes the loop. The series equals your f only on [0, L]; outside, it equals the reflected, repeated extension you invented, not anything physical. And the extension's symmetry can introduce a corner: an odd extension of a profile with f(0) different from 0 creates a jump at the origin, and there the [[dirichlet-conditions|Dirichlet conditions]] still apply — the series converges to the midpoint of the jump and, by the Gibbs phenomenon you met last guide, overshoots near it no matter how many terms you keep. The half-range trick is genuinely powerful, but it builds a particular periodic world, and you are responsible only for the half of it you were asked about.

A worked picture: the line f(x) = x on [0, L]

Make it concrete with the plainest possible profile, the straight ramp f(x) = x on [0, L]. Its odd extension is the sawtooth that climbs, drops, and climbs again — a function with a jump of size 2L at every odd multiple of L, since the ramp ends high at x = L but the next copy starts low. Its even extension is the triangle wave that climbs and descends, with no jumps at all, only sharp corners. One profile, two utterly different periodic personalities, chosen entirely by how we folded the missing left half.

  1. Sine choice (odd, sawtooth). Compute b_n = (2/L) times the integral from 0 to L of x sin(n pi x / L) dx with one integration by parts; the result is b_n = (2L/(n pi)) times (-1)^{n+1}. The coefficients fall off only like 1/n — slowly — because the sawtooth has genuine jumps, and a jump always forces a 1/n tail.
  2. Cosine choice (even, triangle). Here a_0/2 = L/2 (the average), and a_n = (2/L) times the integral from 0 to L of x cos(n pi x / L) dx works out to -4L/(n pi)^2 for odd n and 0 for even n. These coefficients fall off like 1/n^2 — much faster — because the triangle wave is continuous, with only corners; no jump, no slow 1/n tail.
  3. Read the moral. Both series reproduce x on [0, L], but the cosine series converges far faster and has no Gibbs overshoot, while the sine series crawls and overshoots near the endpoints. Faster decay of coefficients is the fingerprint of a smoother extension — a Volume I idea reappearing: smoothness controls how fast the high-frequency content dies, here measured term by term.

That contrast is the whole chapter in miniature. The complex form is one tidy package; the even/odd shortcut is a free halving of effort; the half-range expansion is the deliberate manufacture of symmetry to meet a boundary-value problem on its own terms. And the way the coefficients decay quietly reports back on how rough the extension you built really is. Carry that instinct forward — these same orthogonality and symmetry reflexes return, generalized, when the sines and cosines give way to other eigenfunctions on the next rungs.