Advanced Calculus / Engineering Math

Fourier Series

Representing periodic functions as infinite sums of sines and cosines — with full coverage of Fourier coefficients, convergence, even/odd series, Parseval's theorem, and engineering applications.

Periodic Functions: Period, Frequency, and Amplitude

A function f(x) is periodic with period T if f(x + T) = f(x) for all x. The smallest positive such T is the fundamental period.

Period T

f(x + T) = f(x)

The length of one complete cycle. For sin(x) and cos(x), the period is 2*pi. For sin(2x), the period is pi.

Frequency f

f = 1/T

Cycles per unit. Higher frequency means more oscillations per unit length. Angular frequency omega = 2*pi/T.

Amplitude A

A = max|f(x)|

The peak value of the function above its midline. For A*sin(x), the amplitude is A and the range is [-A, A].

Identifying Period from a Formula

FunctionPeriodNotes
sin(x), cos(x)2*piFundamental sinusoids
sin(n*x), cos(n*x)2*pi/nn-th harmonic; period shrinks by factor n
sin(2*pi*x/L)LStandard form for period L
tan(x)piHalf-period of sine/cosine

The Fourier Series Formula

Any periodic function satisfying mild conditions can be written as a Fourier series — an infinite sum of harmonically related sines and cosines.

General form (period 2L)

f(x) = a(0)/2 + sum(n=1 to inf) [ a(n)*cos(n*pi*x/L) + b(n)*sin(n*pi*x/L) ]

Each term a(n)*cos(n*pi*x/L) + b(n)*sin(n*pi*x/L) is the n-th harmonic. The term a(0)/2 is the average value (DC component) of f over one period.

Constant term a(0)/2

The average value of f over one period: (1/2L) times the integral of f(x) from -L to L. It shifts the entire series up or down.

Cosine coefficients a(n)

Capture the even (symmetric) part of f at each frequency. Nonzero whenever f is not purely odd.

Sine coefficients b(n)

Capture the odd (antisymmetric) part of f at each frequency. Nonzero whenever f is not purely even.

Computing Fourier Coefficients

The coefficients are extracted using orthogonality: the integral of sin(m*x)*sin(n*x) over a full period is zero unless m = n, and similarly for cosines and cross terms.

Constant coefficient a(0)

a(0) = (1/L) * integral[-L to L] f(x) dx

Twice the average value of f. The factor 1/2 in the series formula makes a(0)/2 the true mean.

Cosine coefficient a(n) (n = 1, 2, 3, ...)

a(n) = (1/L) * integral[-L to L] f(x) * cos(n*pi*x/L) dx

Multiply f by the n-th cosine harmonic and integrate. The orthogonality of cosines isolates the n-th coefficient.

Sine coefficient b(n) (n = 1, 2, 3, ...)

b(n) = (1/L) * integral[-L to L] f(x) * sin(n*pi*x/L) dx

Multiply f by the n-th sine harmonic and integrate. For even functions all b(n) = 0; for odd functions all a(n) = 0.

Special case: period 2*pi (L = pi)

When L = pi, the formulas simplify to: a(n) = (1/pi) * integral[-pi to pi] f(x)*cos(n*x) dx and b(n) = (1/pi) * integral[-pi to pi] f(x)*sin(n*x) dx. This is the most common form in textbooks.

Even and Odd Functions: Cosine and Sine Series

Symmetry dramatically simplifies Fourier series. Before computing any integral, check whether f is even, odd, or neither.

Even Function — Cosine Series

f(-x) = f(x). Symmetric about the y-axis. Examples: cos(x), x^2, |x|.

b(n) = 0 for all n
f(x) = a(0)/2 + sum(n=1 to inf) a(n)*cos(n*pi*x/L)

The cosine integral over [-L, L] equals twice the integral over [0, L]: a(n) = (2/L) * integral[0 to L] f(x)*cos(n*pi*x/L) dx

Odd Function — Sine Series

f(-x) = -f(x). Antisymmetric about the y-axis. Examples: sin(x), x, x^3.

a(0) = 0 and a(n) = 0 for all n
f(x) = sum(n=1 to inf) b(n)*sin(n*pi*x/L)

The sine integral over [-L, L] equals twice the integral over [0, L]: b(n) = (2/L) * integral[0 to L] f(x)*sin(n*pi*x/L) dx

Half-Range Extensions

If f is defined only on (0, L), you can extend it in two ways to get a series on (-L, L):

E

Even extension → Fourier cosine series

Define f(-x) = f(x) for x in (-L, 0). This gives an expansion using only cosines — useful for problems with Neumann boundary conditions (zero derivative at endpoints).

O

Odd extension → Fourier sine series

Define f(-x) = -f(x) for x in (-L, 0). This gives an expansion using only sines — useful for problems with Dirichlet boundary conditions (zero value at endpoints).

Dirichlet Conditions for Convergence

The Dirichlet theorem tells us exactly when a Fourier series converges, and to what value.

1

f is periodic

f(x + T) = f(x) for all x. The Fourier series represents f over all of the real line by repeating the pattern.

2

f is single-valued and bounded

f(x) takes exactly one value at each x and does not blow up to infinity anywhere in one period.

3

Finitely many maxima and minima

f does not oscillate infinitely often in any finite interval. Functions like sin(1/x) near x = 0 violate this.

4

Finitely many finite jump discontinuities

f may have jumps, but only a finite number of them per period, and each jump has a finite size.

Convergence theorem

If f satisfies the Dirichlet conditions, the Fourier series converges to f(x) at every point of continuity, and to (1/2)(f(x0+) + f(x0-)) at every jump discontinuity x0 — that is, the average of the left and right limits.

The Gibbs Phenomenon

When a Fourier series is truncated at a finite number N of terms near a jump discontinuity, the partial sum overshoots the true function value. This overshoot does not decrease as N grows — it converges to approximately 9% of the jump height on each side.

Overshoot magnitude

For a jump of size J, the Fourier partial sum (N terms) overshoots by approximately 0.0895 * J = about 9% of J. This constant is related to the integral of sin(x)/x from 0 to pi.

Engineering consequence

In signal processing, the Gibbs phenomenon causes ringing artifacts when a signal is filtered with a sharp frequency cutoff. Using a window function (Hann, Hamming, Blackman) smooths the cutoff and reduces ringing at the cost of wider transition bands.

Parseval's Theorem

Parseval's theorem equates the energy of a function to the sum of the squared Fourier coefficients — a frequency-domain energy audit.

Parseval's identity (period 2L)

(1/L) * integral[-L to L] |f(x)|^2 dx = (a(0)^2)/2 + sum(n=1 to inf) (a(n)^2 + b(n)^2)

Uses of Parseval's theorem

Summing infinite series

Expand a known function f in a Fourier series, apply Parseval's theorem, and read off the value of a series like sum(1/n^2). Example: the Fourier series of f(x) = x on (-pi, pi) gives the famous result sum(1/n^2, n=1 to inf) = pi^2/6.

Checking expansions

After computing Fourier coefficients, verify that the right-hand side of Parseval's identity matches the left-hand side integral. A large discrepancy signals a computational error.

Signal energy

In electrical engineering, the left side is proportional to the total signal power. Parseval's theorem says power is conserved between time domain and frequency domain — no energy is lost in the transformation.

Complex Exponential Form

Using Euler's formula e^(i*theta) = cos(theta) + i*sin(theta), the Fourier series can be written as a single sum over both positive and negative integers.

Complex Fourier series

f(x) = sum(n = -inf to +inf) c(n) * e^(i*n*pi*x/L)
c(n) = (1/(2L)) * integral[-L to L] f(x) * e^(-i*n*pi*x/L) dx

Relationship to real coefficients

c(0) = a(0)/2

c(n) = (a(n) - i*b(n)) / 2   for n > 0

c(-n) = (a(n) + i*b(n)) / 2  for n > 0

When f is real-valued, c(-n) is the complex conjugate of c(n). The magnitude |c(n)| gives the amplitude of the n-th harmonic, and arg(c(n)) gives its phase.

From Fourier Series to the Fourier Transform

As the period T = 2L grows to infinity, the discrete set of frequencies (n*pi/L) becomes a continuous variable omega, and the Fourier series sum becomes an integral — the Fourier transform.

Fourier transform

F(omega) = integral[-inf to inf] f(t) * e^(-i*omega*t) dt

Decomposes a non-periodic signal into a continuous spectrum of frequencies.

Inverse Fourier transform

f(t) = (1/(2*pi)) * integral[-inf to inf] F(omega) * e^(i*omega*t) d(omega)

Reconstructs f(t) from its frequency-domain representation F(omega).

Discrete Fourier Transform (DFT)

Finite-length discrete signals. Computed in O(N^2) operations. The basis of spectrum analysis.

Fast Fourier Transform (FFT)

Computes the DFT in O(N log N). Invented by Cooley and Tukey in 1965. Used in virtually every DSP chip.

Short-Time Fourier Transform (STFT)

Applies FFT to overlapping windows of a time-varying signal. Produces a spectrogram showing how frequency content changes over time.

Applications of Fourier Series

Signal Processing

Audio equalizers split sound into frequency bands using Fourier decomposition. MP3 encoding discards high-frequency coefficients below the threshold of human hearing. Noise filters act on the frequency-domain representation of a signal.

Heat Equation

The solution to the 1D heat equation on a rod with fixed-temperature ends is a Fourier sine series. Each mode decays exponentially in time at a rate proportional to n^2, so higher harmonics vanish first.

Vibrations and Acoustics

The overtone series of a vibrating string is its Fourier series. The fundamental frequency sets pitch; the amplitudes of the harmonics shape the timbre. Musicians equalize by adjusting Fourier coefficients.

Electrical Engineering

AC circuits driven by non-sinusoidal periodic voltages are analyzed harmonic-by-harmonic using Fourier series. Each harmonic is treated independently by the linear circuit, then results are superimposed.

Image Processing

Two-dimensional Fourier series decompose images into spatial frequency components. JPEG compression stores low-frequency DCT (discrete cosine transform) coefficients and discards high-frequency detail.

Medical Imaging (MRI)

MRI scanners collect data directly in the Fourier domain (k-space). Reconstructing an image from an MRI scan is literally computing an inverse Fourier transform of the measured signal.

Worked Examples

Example 1 — Fourier series of the square wave f(x) = sign(x) on (-pi, pi)

f(x) = -1 for x in (-pi, 0), f(x) = 1 for x in (0, pi)

f is odd, so all a(n) = 0. Compute b(n):

b(n) = (2/pi) * integral[0 to pi] 1 * sin(n*x) dx

b(n) = (2/pi) * [-cos(n*x)/n] from 0 to pi

b(n) = (2/(n*pi)) * (1 - cos(n*pi))

For even n: cos(n*pi) = 1, so b(n) = 0

For odd n: cos(n*pi) = -1, so b(n) = 4/(n*pi)

f(x) = (4/pi) * (sin(x) + sin(3x)/3 + sin(5x)/5 + sin(7x)/7 + ...)

At x = pi/2: f(pi/2) = 1 = (4/pi)*(1 - 1/3 + 1/5 - 1/7 + ...) giving pi/4 = 1 - 1/3 + 1/5 - ... (Leibniz formula)

Example 2 — Fourier cosine series of f(x) = x on (0, pi)

Even extension of f(x) = x onto (-pi, pi):

a(0) = (2/pi) * integral[0 to pi] x dx = (2/pi) * (pi^2/2) = pi

a(n) = (2/pi) * integral[0 to pi] x*cos(n*x) dx

= (2/pi) * [x*sin(n*x)/n + cos(n*x)/n^2] from 0 to pi

= (2/(n^2*pi)) * (cos(n*pi) - 1)

For even n: a(n) = 0

For odd n: a(n) = -4/(n^2*pi)

x = pi/2 - (4/pi) * (cos(x) + cos(3x)/9 + cos(5x)/25 + ...) for x in (0, pi)

Applying Parseval: sum(1/n^4, n odd) = pi^4/96, leading to sum(1/n^4, all n) = pi^4/90.

Example 3 — Applying Parseval's theorem to find sum(1/n^2)

Fourier series of f(x) = x on (-pi, pi) (odd function):

b(n) = (-1)^(n+1) * (2/n) for n = 1, 2, 3, ...

f(x) = 2*(sin(x) - sin(2x)/2 + sin(3x)/3 - ...)

Apply Parseval's theorem:

(1/pi)*integral[-pi to pi] x^2 dx = sum(n=1 to inf) b(n)^2

(1/pi)*(2*pi^3/3) = sum(n=1 to inf) 4/n^2

2*pi^2/3 = 4 * sum(1/n^2)

sum(1/n^2, n=1 to inf) = pi^2/6

This is the Basel problem, first solved by Euler in 1735 using a different method. Parseval gives an elegant alternative proof.

Frequently Asked Questions

What is a Fourier series?

A Fourier series is a way to represent a periodic function as an infinite sum of sines and cosines. Any sufficiently well-behaved periodic function f(x) with period 2L can be written as f(x) = a0/2 + sum of (an cos(n*pi*x/L) + bn sin(n*pi*x/L)) for n from 1 to infinity. The constants a0, an, and bn are called Fourier coefficients and are computed using integral formulas. The series converts a complicated periodic signal into its frequency components — a fundamental tool in signal processing, physics, and engineering.

How do you compute Fourier coefficients?

For a function f(x) with period 2L defined on the interval (-L, L): The constant term a0 = (1/L) times the integral from -L to L of f(x) dx. The cosine coefficients are an = (1/L) times the integral from -L to L of f(x)*cos(n*pi*x/L) dx for n = 1, 2, 3, ... The sine coefficients are bn = (1/L) times the integral from -L to L of f(x)*sin(n*pi*x/L) dx for n = 1, 2, 3, ... For the common case of period 2*pi (L = pi), replace L with pi in all formulas.

What is the difference between a Fourier cosine series and a Fourier sine series?

When f(x) is an even function — meaning f(-x) = f(x) — all sine coefficients bn vanish and the Fourier series contains only cosines: f(x) = a0/2 + sum of an*cos(n*pi*x/L). This is the Fourier cosine series. When f(x) is an odd function — meaning f(-x) = -f(x) — all cosine coefficients a0 and an vanish and the series contains only sines: f(x) = sum of bn*sin(n*pi*x/L). This is the Fourier sine series. Recognizing symmetry before computing integrals saves significant work. For functions defined only on (0, L), you can force either expansion using a half-range extension.

What are the Dirichlet conditions for convergence of a Fourier series?

A Fourier series converges to f(x) at every point of continuity when f satisfies the Dirichlet conditions: (1) f is periodic; (2) f is single-valued and bounded on one period; (3) f has a finite number of maxima and minima on one period; and (4) f has a finite number of finite jump discontinuities on one period. At a point of discontinuity x0, the Fourier series converges to the average of the left and right limits: (1/2)(f(x0+) + f(x0-)). Almost every function encountered in physics and engineering satisfies these conditions.

What is the Gibbs phenomenon?

The Gibbs phenomenon is the overshoot that occurs near a jump discontinuity when a Fourier series is truncated to a finite number of terms. No matter how many terms are included, the partial sum overshoots the function value by approximately 9% of the jump height on each side of the discontinuity. The overshoot does not disappear as more terms are added — it only narrows in width and moves closer to the point of discontinuity. The Gibbs phenomenon is important in signal processing because it causes ringing artifacts near sharp edges when using finite-bandwidth filters.

What does Parseval's theorem say about Fourier series?

Parseval's theorem states that the total energy of a periodic function equals the sum of the energies of its Fourier components. Specifically, for a function f(x) with Fourier coefficients a0, an, bn on (-L, L): (1/L) times the integral from -L to L of |f(x)|^2 dx = (a0^2)/2 + sum from n=1 to infinity of (an^2 + bn^2). This is an equality between the energy in the time/space domain and the energy in the frequency domain. Parseval's theorem is used to find the sum of infinite series (by matching the formula to a known function's Fourier expansion) and to verify that a Fourier expansion is correct.

How does a Fourier series relate to the Fourier transform?

A Fourier series applies to periodic functions and produces a discrete spectrum — a countable set of frequency components at integer multiples of the fundamental frequency. The Fourier transform extends this idea to non-periodic functions by taking the period to infinity. The result is a continuous spectrum F(omega) defined for all frequencies omega. The Fourier transform is F(omega) = integral from -infinity to infinity of f(t)*e^(-i*omega*t) dt, and the inverse transform recovers f(t) from F(omega). In engineering, the discrete Fourier transform (DFT) and fast Fourier transform (FFT) are the computational versions of these ideas.

What are common applications of Fourier series?

Fourier series appear throughout science and engineering: (1) Signal processing — audio equalizers decompose sound into frequency bands; data compression codecs (MP3, JPEG) discard high-frequency coefficients to reduce file size. (2) Heat equation — the temperature distribution in a rod with periodic boundary conditions is solved by writing the initial condition as a Fourier series and letting each mode decay exponentially in time. (3) Vibrations and acoustics — the overtone structure of a musical instrument's note is its Fourier series. (4) Electrical circuits — AC circuit analysis uses Fourier series to handle non-sinusoidal periodic voltages. (5) Image processing — two-dimensional Fourier series underlie filtering, edge detection, and MRI reconstruction.

What is the complex exponential form of a Fourier series?

Using Euler's formula e^(i*theta) = cos(theta) + i*sin(theta), the Fourier series can be written compactly as f(x) = sum from n = -infinity to +infinity of cn * e^(i*n*pi*x/L), where the complex coefficients are cn = (1/(2L)) times the integral from -L to L of f(x)*e^(-i*n*pi*x/L) dx. The relationship between real and complex coefficients is: c0 = a0/2, cn = (an - i*bn)/2 for n > 0, and c(-n) = cn* (complex conjugate) for n > 0. The complex form is more compact and is the natural starting point for the Fourier transform.

Related Topics

Practice Fourier Series Problems

Interactive problems with step-by-step solutions and private tutoring — free to try.

Start Practicing Free