TBVP Notes: Fourier Series

Nov 19, 2026·Pranesh Mahanta·21MAB201T — Transforms and Boundary Value Problems

Dirichlet’s conditions and Euler’s formulas, the even/odd and half-range machinery, change of interval, Parseval’s identity, and the tabulation method of harmonic analysis — with every expansion worked through.

Contents
  1. Periodic functions and the idea of a Fourier series
  2. Dirichlet’s conditions
  3. Euler formulas and the series on (−π, π)
  4. Fourier series on a general interval
  5. Even and odd functions
  6. Half-range sine series
  7. Half-range cosine series
  8. A full-range series with both parts: x + x2
  9. Change of interval
  10. Parseval’s identity
  11. Harmonic analysis
  12. Convergence, deductions and typical exam uses

1Periodic functions and the idea of a Fourier series

A function f(x) is periodic with period T if f(x + T) = f(x) for all x; sin x and cos x are periodic with period 2π, tan x with period π. The central observation of this unit is that sums of sines and cosines whose frequencies are integer multiples of a fundamental are also periodic, and conversely that an enormous class of periodic functions — including ones with jumps, like square waves and sawtooths — can be represented as such sums. A Fourier series decomposes a periodic function into these sinusoidal components:

f(x) = a0/2 + ∑n=1∞ (an cos nx + bn sin nx)

The terms cos nx and sin nx are the harmonics: n = 1 is the fundamental, n = 2 the second harmonic, and so on. The coefficients an, bn measure how much of each harmonic the function contains, and are computed by the Euler formulas of Section 3. Unlike Taylor series, which need differentiability and only work locally, Fourier series handle discontinuous periodic data globally — which is precisely what boundary value problems in Unit 3 require.

2Dirichlet’s conditions

Fourier’s representation is not valid for arbitrary functions; it is guaranteed by Dirichlet’s conditions. A function f(x) can be expanded in a convergent Fourier series on an interval of length 2π (or 2l in general) if, in any one period:

When these hold, the Fourier series converges to f(x) at every point of continuity, and to the average of the left and right limits, [f(x+) + f(x−)]/2, at each point of discontinuity. This is a statement about convergence, not just formal manipulation.

Dirichlet’s conditions are sufficient, not necessary: some functions outside their scope still possess convergent Fourier series. Also remember the endpoint behaviour — at a jump the series gives the midpoint value, so the expansion of f(x) = x on (−π, π) converges to 0 (not ±π) at x = ±π. Questions frequently exploit exactly this fact to sum numerical series.
f(x) = x on (−π, π), extended with period 2π green dots: series value at the jump x = π x = −π 2π −2π π −π
Figure — periodic extension of f(x) = x from (−π, π). The extension has jump discontinuities at x = ±π, ±3π, … ; by Dirichlet’s theorem the Fourier series takes the average value (green) there, while away from the jumps it reproduces f(x) exactly.

3Euler formulas and the series on (−π, π)

The coefficients of the series on the standard interval (−π, π) come from multiplying the series by cos nx or sin nx and integrating over a period, using the orthogonality relations ∫−ππ cos mx cos nx dx = 0 (m ≠ n), and likewise for the sine products and mixed products. All cross terms vanish, leaving exactly one survivor:

a0 = (1/π) ∫−ππ f(x) dx,   an = (1/π) ∫−ππ f(x) cos nx dx,   bn = (1/π) ∫−ππ f(x) sin nx dx
The constant term is written a0/2 so that the formula for a0 is the n = 0 case of the formula for an. Integrating the series over a period kills every cosine and sine term (their integrals vanish), leaving ∫f dx = πa0.

The same integrations justify the expansion once Dirichlet’s conditions hold: uniqueness means the coefficients found by Euler’s formulas are the only possible ones, so a function and its Fourier coefficients determine each other. In practice, evaluation reduces to repeated integration by parts — keep sin nx, cos nx evaluated at 0 and π handy: sin nπ = 0 and cos nπ = (−1)n.

4Fourier series on a general interval

Most data are not naturally periodic with period 2π. For a function of period 2l, defined on (c, c + 2l), substitute x′ = πx/l into the standard series: the harmonics become cos(nπx/l) and sin(nπx/l), and the Euler formulas rescale by 1/l:

f(x) = a0/2 + ∑n=1∞ [an cos(nπx/l) + bn sin(nπx/l)]
an = (1/l) ∫cc+2l f(x) cos(nπx/l) dx,   bn = (1/l) ∫cc+2l f(x) sin(nπx/l) dx

The integration limits may be any window of length 2l — (0, 2l), (−l, l), (c, c + 2l) — because the integrand is periodic with period 2l. A useful consequence: if f has period 2l and we need its Fourier coefficients, we may integrate over the most convenient window, even one where the original formula for f does not literally apply but its periodic extension does.

Endpoint conventions do not change the series: shifting the interval or redefining f at isolated points alters the coefficients by nothing, because coefficients are integrals. What does matter is the period: using 2l where the true period is l gives a valid but inefficient series containing only even harmonics.

5Even and odd functions

Exploiting symmetry halves the work. An even function satisfies f(−x) = f(x) (graph symmetric about the y-axis: x2, cos x, |x|); an odd function satisfies f(−x) = −f(x) (graph symmetric about the origin: x, x3, sin x). On a symmetric interval (−l, l):

Even f:   bn = 0,   an = (2/l) ∫0l f(x) cos(nπx/l) dx
Odd f:   an = 0 (including a0),   bn = (2/l) ∫0l f(x) sin(nπx/l) dx

Products follow the parity rules: even × even and odd × odd are even; even × odd is odd. So an even f makes f(x)sin(nπx/l) odd and kills every bn; an odd f makes f(x)cos(nπx/l) odd and kills every an. Sums of cosines alone form an even (cosine) series; sums of sines alone form an odd (sine) series. This observation is the engine of the half-range expansions of the next two sections.

Do not assume a function is even or odd — check by substituting −x. And note that a0 follows the same rule as an: an odd function has no constant term, since a0/2 is the mean value over a period and the mean of an odd function is zero.

6Half-range sine series

A function specified only on (0, l) — a “half range” — has no symmetry yet, but we are free to imagine extensions to (−l, 0). Extending oddly (f(−x) = −f(x)) produces a series containing only sines; extending evenly produces only cosines. Both are legitimate Fourier series for the same half-range data; which one to use is decided by the boundary conditions of the problem (Unit 3: sine for fixed ends at zero temperature or displacement, cosine for insulated or free ends).

Half-range sine series on (0, l):   f(x) = ∑n=1∞ bn sin(nπx/l),   bn = (2/l) ∫0l f(x) sin(nπx/l) dx
Worked problem · half-range sine series
Find the half-range sine series for f(x) = x in (0, π), and write out the first three terms.
Coefficient: bn = (2/π) ∫0π x sin nx dx. Integrate by parts with u = x, dv = sin nx dx:
∫0π x sin nx dx = [−x cos nx/n]0π + (1/n) ∫0π cos nx dx = −πcos nπ/n + [sin nx/n2]0π = −π(−1)n/n + 0 = π(−1)n+1/n.
So bn = (2/π) · π(−1)n+1/n = 2(−1)n+1/n.
Series: x = 2[sin x − sin 2x/2 + sin 3x/3 − …] = 2∑n=1∞ (−1)n+1 sin nx/n.
Check at x = π/2: the series gives 2(1 − 0 + (−1)/3 − 0 + 1/5 − …) = 2(1 − 1/3 + 1/5 − …) = 2 · π/4 = π/2, which equals f(π/2). (The alternating Leibniz sum 1 − 1/3 + 1/5 − … = π/4 is one of the classic deductions of this series.)

7Half-range cosine series

The even extension of f on (0, l) gives the cosine series, whose coefficients use only the cosine integral. Because the even extension is continuous at x = 0 whenever f(0) is finite, the cosine series always converges to f(0) at the left endpoint — a point worth remembering when endpoints matter.

Half-range cosine series on (0, l):   f(x) = a0/2 + ∑n=1∞ an cos(nπx/l),   an = (2/l) ∫0l f(x) cos(nπx/l) dx
Worked problem · half-range cosine series
Expand f(x) = x2 as a half-range cosine series in (0, π), and use it to show that ∑(−1)n+1/n2 = π2/12 and ∑1/n2 = π2/6.
Constant term: a0 = (2/π) ∫0π x2 dx = (2/π)(π3/3) = 2π2/3, so a0/2 = π2/3.
Coefficients: an = (2/π) ∫0π x2 cos nx dx. Integrating by parts twice:
∫ x2 cos nx dx = [x2 sin nx/n]0π − (2/n) ∫0π x sin nx dx = 0 − (2/n) · [−x cos nx/n + sin nx/n2]0π = −(2/n) · (−π(−1)n/n) = 2π(−1)n/n2.
So an = (2/π) · 2π(−1)n/n2 = 4(−1)n/n2.
Series: x2 = π2/3 + 4∑n=1∞ (−1)n cos nx/n2 (valid on [0, π] since the even extension is continuous).
First deduction (x = 0): 0 = π2/3 + 4∑(−1)n/n2, hence ∑(−1)n/n2 = −π2/12, i.e. ∑(−1)n+1/n2 = π2/12.
Second deduction (x = π, cos nπ = (−1)n so every term is positive): π2 = π2/3 + 4∑1/n2, hence ∑1/n2 = (2π2/3)/4 = π2/6.

8A full-range series with both parts: x + x2

When a function on (−π, π) is neither even nor odd, split it into its even part and its odd part: fe = [f(x) + f(−x)]/2 and fo = [f(x) − f(−x)]/2. The Fourier series of f is the sum of the cosine series of fe and the sine series of fo. For f(x) = x + x2 the split is visible on sight: x is odd, x2 is even, so the coefficients can be written down from the two half-range results already derived.

Worked problem · full-range expansion
Obtain the Fourier series of f(x) = x + x2 in (−π, π).
Even part: x2 contributes a0 = (1/π) ∫−ππ x2 dx = 2π2/3 (constant term π2/3) and an = (1/π) ∫−ππ x2 cos nx dx = (2/π) ∫0π x2 cos nx dx = 4(−1)n/n2, exactly as in Section 7.
Odd part: x contributes bn = (1/π) ∫−ππ x sin nx dx = (2/π) ∫0π x sin nx dx = 2(−1)n+1/n, exactly as in Section 6.
Series: x + x2 = π2/3 + ∑n=1∞ [ (4(−1)n/n2) cos nx + (2(−1)n+1/n) sin nx ].
Check at x = 0: the series gives π2/3 + 4(−1 + 1/4 − 1/9 + …) = π2/3 + 4(−π2/12) = π2/3 − π2/3 = 0 = f(0). Consistent.
Notice that the same function x2 has produced three different Fourier series in these sections: the half-range cosine series on (0, π), the full-range series on (−π, π), and (in the next section) a series on (0, 2π). All are correct — they represent different periodic extensions of the same formula.

9Change of interval

To expand f(x) on an interval of length 2l, map it to the standard interval by the substitution s = πx/l, expand g(s) = f(ls/π) in the standard series on any window of length 2π, and substitute back. The direct formulas are those of Section 4 with l in place of π. Two recurring special cases: the interval (0, 2l) with the full (not half-range) series, and intervals of arbitrary length c − l ≤ x ≤ c + l where the same rescaling applies around the centre c.

Worked problem · expansion on (0, 2π)
Find the Fourier series of f(x) = x in (0, 2π).
Formulas with l = π, interval (0, 2π): a0 = (1/π) ∫02π x dx = (1/π)(2π2) = 2π, so the constant term is a0/2 = π.
Cosine coefficients: an = (1/π) ∫02π x cos nx dx = (1/π)[x sin nx/n + cos nx/n2]02π = (1/π)(1/n2) · (1 − 1) = 0.
Sine coefficients: bn = (1/π) ∫02π x sin nx dx = (1/π)[−x cos nx/n + sin nx/n2]02π.
Evaluating: [−x cos nx/n]02π = −2πcos(2πn)/n = −2π/n, and [sin nx/n2]02π = 0. So bn = (1/π)(−2π/n) = −2/n.
Series: x = π − 2∑n=1∞ sin nx/n, valid on (0, 2π).
Check at x = π/2: π − 2(1 − 1/3 + 1/5 − …) = π − 2(π/4) = π/2 = f(π/2). Note the contrast with Section 6: same formula x, different interval, different series.

10Parseval’s identity

Parseval’s identity relates the energy of the function to the sum of squares of its Fourier coefficients. It is proved by squaring the series and integrating term by term (justified under Dirichlet’s conditions); all cross terms die by orthogonality, leaving the squares:

Full series on (−l, l):   (1/l) ∫−ll [f(x)]2 dx = a02/2 + ∑(an2 + bn2)
Half-range sine on (0, l):   (2/l) ∫0l [f(x)]2 dx = ∑n=1∞ bn2
Half-range cosine on (0, l):   (2/l) ∫0l [f(x)]2 dx = a02/2 + ∑n=1∞ an2

Dividing by the interval length gives the root mean square (rms) value of f over the period in terms of the coefficients — the Fourier-series analogue of expressing power as the sum of powers of the harmonics. Parseval’s identity is also a machine for summing series of the form ∑1/n2k.

Worked problem · Parseval identity
Using the half-range sine series of f(x) = x on (0, π) found in Section 6 and Parseval’s identity, show that 1 + 1/4 + 1/9 + … = π2/6.
Sine coefficients: bn = 2(−1)n+1/n, so bn2 = 4/n2.
Left side of Parseval: (2/π) ∫0π x2 dx = (2/π)(π3/3) = 2π2/3.
Right side: ∑n=1∞ 4/n2 = 4∑1/n2.
Equate: 2π2/3 = 4∑1/n2, hence ∑1/n2 = π2/6 — agreeing with the value deduced in Section 7 by a different route. Consistent.

11Harmonic analysis

When f is known only through tabulated values — experimental data sampled at equally spaced points over one period — the Euler integrals cannot be evaluated analytically. Harmonic analysis replaces each integral by a numerical quadrature over the sample points, yielding the coefficients of the first few harmonics directly from the table. For N equally spaced ordinates y0, y1, …, yN−1 over a period 2π (spacing h = 2π/N), the trapezoidal-rule replacements are an ≈ (1/π)(2π/N) ∑ yj cos(nxj) and similarly for bn, which for N = 6 gives the closed forms used below.

Worked problem · harmonic analysis
The values of y = f(x) over one period 2π at x = 0°, 60°, 120°, 180°, 240°, 300° are 1.0, 1.4, 1.9, 1.7, 1.3, 0.8. Find the first and third harmonics of the Fourier series, i.e. determine a0, a1, b1, a2, b2, a3 and write y ≈ a0/2 + a1 cos x + b1 sin x + a2 cos 2x + b2 sin 2x + a3 cos 3x.
With six ordinates (spacing 60° = π/3), each coefficient is (1/3) × the sum of yj times the corresponding cosine or sine value. Working term by term:
a0 = (1/3)∑yj = (1.0 + 1.4 + 1.9 + 1.7 + 1.3 + 0.8)/3 = 8.1/3 = 2.7, so a0/2 = 1.35.
a1 = (1/3)[y0 + 0.5y1 − 0.5y2 − y3 − 0.5y4 + 0.5y5] (cosines of 0°, 60°, 120°, 180°, 240°, 300° are 1, 0.5, −0.5, −1, −0.5, 0.5): a1 = (1/3)[1.0 + 0.7 − 0.95 − 1.7 − 0.65 + 0.4] = (1/3)(−1.2) = −0.4.
b1 (sines are 0, √3/2, √3/2, 0, −√3/2, −√3/2): b1 = (√3/9)[y1 + y2 − y4 − y5] = (0.19245)(1.4 + 1.9 − 1.3 − 0.8) = (0.19245)(1.2) = 0.231.
a2 (cos 2xj are 1, −0.5, −0.5, 1, −0.5, −0.5): a2 = (1/3)[1.0 − 0.7 − 0.95 + 1.7 − 0.65 − 0.4] = (1/3)(0) = 0.
b2 (sin 2xj are 0, √3/2, −√3/2, 0, √3/2, −√3/2): b2 = (√3/6)[1.4 − 1.9 + 1.3 − 0.8] = (0.28868)(0) = 0.
a3 (cos 3xj alternate 1, −1, 1, −1, 1, −1): a3 = (1/3)[1.0 − 1.4 + 1.9 − 1.7 + 1.3 − 0.8] = (1/3)(0.3) = 0.1; and b3 = 0 since sin 3xj = 0 at all six points.
Result: y ≈ 1.35 − 0.4 cos x + 0.231 sin x + 0.1 cos 3x.
With N ordinates only the harmonics up to n = N/2 are determinate — six points give at most three harmonics, and b3 is automatically zero. Doubling the number of sample points is the only way to extract more harmonics from the same data.

12Convergence, deductions and typical exam uses

Three consequences of Dirichlet’s theorem do most of the work in exam questions. First, at a jump the series equals the midpoint value: for the sawtooth of Section 9, x = π − 2∑sin nx/n, both sides must be read as the average 0 at x = π, which is useless — but choosing an interior point such as x = π/2 turns the series into a numerical identity, as the checks in Sections 6 and 9 show. Second, substituting special values (0, π, π/2) converts a trigonometric series into a numerical one, giving the classic sums π2/6, π2/12, π/4. Third, Parseval’s identity supplies sums of reciprocal squares and rms values without any new integration.

Near a jump the partial sums overshoot the function by about 9% of the jump on each side (the Gibbs phenomenon) — the overshoot shrinks in width but not in height as more terms are added, a reminder that convergence at a jump is only to the midpoint. In applications, remember the practical hierarchy: symmetry first (even/odd saves half the integrals), half-range expansions for functions given only on (0, l), and the l-scaling of Section 4 for arbitrary periods. Every series in these notes was obtained by the same four-step loop: choose the right form, compute coefficients by Euler’s formulas, state the convergence interval, and deduce a numerical series at a well-chosen point.