The Definition and Calculation of Fourier Series

Trigonometric Series and Orthogonal Systems of Functions

Trigonometric series

A series of the form

a02+∑n=1∞(ancos⁡nx+bnsin⁡nx)\frac{a_0}{2} + \sum_{n=1}^{\infty} (a_n \cos nx + b_n \sin nx)

is called a trigonometric series, where a0,an,bna_0, a_n, b_n (n=1,2,…n=1,2,\ldots) are all constants.

Theorem1

Orthogonality of the trigonometric system: the trigonometric system

{1,cos⁡x,sin⁡x,cos⁡2x,sin⁡2x,…,cos⁡nx,sin⁡nx,…}\{1, \cos x, \sin x, \cos 2x, \sin 2x, \ldots, \cos nx, \sin nx, \ldots\}

is orthogonal on the interval [−π,π][-\pi, \pi]; that is, the integral over [−π,π][-\pi, \pi] of the product of any two distinct functions in it is zero:

∫−ππcos⁡nx dx=0,∫−ππsin⁡nx dx=0\int_{-\pi}^{\pi} \cos nx \, dx = 0, \quad \int_{-\pi}^{\pi} \sin nx \, dx = 0

∫−ππcos⁡mxcos⁡nx dx=0(m≠n)\int_{-\pi}^{\pi} \cos mx \cos nx \, dx = 0 \quad (m \neq n)

∫−ππsin⁡mxsin⁡nx dx=0(m≠n)\int_{-\pi}^{\pi} \sin mx \sin nx \, dx = 0 \quad (m \neq n)

∫−ππcos⁡mxsin⁡nx dx=0\int_{-\pi}^{\pi} \cos mx \sin nx \, dx = 0

while the integral of the square of the same function is:

∫−ππ12 dx=2π,∫−ππcos⁡2nx dx=π,∫−ππsin⁡2nx dx=π\int_{-\pi}^{\pi} 1^2 \, dx = 2\pi, \quad \int_{-\pi}^{\pi} \cos^2 nx \, dx = \pi, \quad \int_{-\pi}^{\pi} \sin^2 nx \, dx = \pi

Fourier Coefficients

Fourier coefficients

Let f(x)f(x) be a function of period 2π2\pi that is integrable on [−π,π][-\pi, \pi]. Then

an=1π∫−ππf(x)cos⁡nx dx(n=0,1,2,…)a_n = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \cos nx \, dx \quad (n = 0, 1, 2, \ldots)

bn=1π∫−ππf(x)sin⁡nx dx(n=1,2,…)b_n = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \sin nx \, dx \quad (n = 1, 2, \ldots)

are called the Fourier coefficients of f(x)f(x). The trigonometric series formed from these coefficients,

a02+∑n=1∞(ancos⁡nx+bnsin⁡nx)\frac{a_0}{2} + \sum_{n=1}^{\infty} (a_n \cos nx + b_n \sin nx)

is called the Fourier series of f(x)f(x), and is written

f(x)∼a02+∑n=1∞(ancos⁡nx+bnsin⁡nx)f(x) \sim \frac{a_0}{2} + \sum_{n=1}^{\infty} (a_n \cos nx + b_n \sin nx)

Dirichlet’s Convergence Theorem

Theorem2

Dirichlet’s convergence theorem: suppose f(x)f(x) is a periodic function of period 2π2\pi satisfying:

  1. it is continuous on one period, or has only finitely many discontinuities of the first kind;
  2. it has at most finitely many points of extremum in one period.

Then the Fourier series of f(x)f(x) converges, and:

  • when xx is a point of continuity of f(x)f(x), the series converges to f(x)f(x);
  • when xx is a point of discontinuity of f(x)f(x), the series converges to f(x−)+f(x+)2\frac{f(x^-) + f(x^+)}{2}, that is, the average of the left-hand and right-hand limits.

Fourier Series of Odd and Even Functions

Theorem3
  1. Odd functions: if f(x)f(x) is an odd function of period 2π2\pi, then its Fourier coefficients are

an=0(n=0,1,2,…)a_n = 0 \quad (n = 0, 1, 2, \ldots)

bn=2π∫0πf(x)sin⁡nx dx(n=1,2,…)b_n = \frac{2}{\pi} \int_0^{\pi} f(x) \sin nx \, dx \quad (n = 1, 2, \ldots)

The Fourier series then contains only sine terms and is called a sine series:

f(x)∼∑n=1∞bnsin⁡nxf(x) \sim \sum_{n=1}^{\infty} b_n \sin nx

  1. Even functions: if f(x)f(x) is an even function of period 2π2\pi, then its Fourier coefficients are

bn=0(n=1,2,…)b_n = 0 \quad (n = 1, 2, \ldots)

an=2π∫0πf(x)cos⁡nx dx(n=0,1,2,…)a_n = \frac{2}{\pi} \int_0^{\pi} f(x) \cos nx \, dx \quad (n = 0, 1, 2, \ldots)

The Fourier series then contains only cosine terms (together with the constant term) and is called a cosine series:

f(x)∼a02+∑n=1∞ancos⁡nxf(x) \sim \frac{a_0}{2} + \sum_{n=1}^{\infty} a_n \cos nx

Worked Examples

Example 1: The Fourier Series of a Square Wave

Let f(x)f(x) be a function of period 2π2\pi with f(x)={−1,−π≤x<01,0≤x<πf(x) = \begin{cases} -1, & -\pi \leq x < 0 \\ 1, & 0 \leq x < \pi \end{cases} on [−π,π)[-\pi, \pi). Find its Fourier series expansion.

Fourier seriesodd functionsine seriessquare wave

Approach:

First use the parity to settle which coefficients vanish, and then use the coefficient formula to compute the remaining ones by integration.

Steps:

  1. f(x)f(x) is odd, so an=0a_n = 0 (n=0,1,2,…n=0,1,2,\ldots)
  2. bn=2π∫0π1⋅sin⁡nx dx=2π[−cos⁡nxn]0π=2nπ(1−cos⁡nπ)=2nπ(1−(−1)n)b_n = \frac{2}{\pi}\int_0^{\pi} 1 \cdot \sin nx \, dx = \frac{2}{\pi}\left[-\frac{\cos nx}{n}\right]_0^{\pi} = \frac{2}{n\pi}(1 - \cos n\pi) = \frac{2}{n\pi}(1 - (-1)^n)
  3. When nn is even, bn=0b_n = 0; when nn is odd, bn=4nπb_n = \frac{4}{n\pi}
  4. The Fourier series: f(x)∼4π∑k=1∞sin⁡(2k−1)x2k−1=4π(sin⁡x+sin⁡3x3+sin⁡5x5+⋯ )f(x) \sim \frac{4}{\pi}\sum_{k=1}^{\infty} \frac{\sin(2k-1)x}{2k-1} = \frac{4}{\pi}(\sin x + \frac{\sin 3x}{3} + \frac{\sin 5x}{5} + \cdots)
  5. By the convergence theorem: at the points of continuity x≠kπx \neq k\pi the series converges to f(x)f(x), and at the points of discontinuity x=kπx = k\pi it converges to −1+12=0\frac{-1+1}{2} = 0

Answer: f(x)=4π∑k=1∞sin⁡(2k−1)x2k−1f(x) = \frac{4}{\pi}\sum_{k=1}^{\infty} \frac{\sin(2k-1)x}{2k-1} (x≠kπx \neq k\pi), and at x=kπx=k\pi the sum of the series is 0.

Example 2: The Fourier Series of a Sawtooth Wave

Let f(x)f(x) be a function of period 2π2\pi with f(x)=xf(x) = x on [−π,π)[-\pi, \pi). Find its Fourier series expansion.

Fourier seriesodd functionsine seriessawtooth wave

Approach:

Again an odd function, but here the integrand is a polynomial, and the integration gives simple coefficients with alternating signs.

Steps:

  1. f(x)=xf(x) = x is odd, so an=0a_n = 0
  2. bn=2π∫0πxsin⁡nx dxb_n = \frac{2}{\pi}\int_0^{\pi} x \sin nx \, dx; integrating by parts: =2π[−xcos⁡nxn]0π+2π∫0πcos⁡nxndx=2π⋅(−πcos⁡nπn)+0=−2n(−1)n=2(−1)n+1n= \frac{2}{\pi}\left[-\frac{x\cos nx}{n}\right]_0^{\pi} + \frac{2}{\pi}\int_0^{\pi} \frac{\cos nx}{n} dx = \frac{2}{\pi} \cdot (-\frac{\pi\cos n\pi}{n}) + 0 = -\frac{2}{n}(-1)^n = \frac{2(-1)^{n+1}}{n}
  3. The Fourier series: f(x)∼2∑n=1∞(−1)n+1nsin⁡nx=2(sin⁡x−sin⁡2x2+sin⁡3x3−⋯ )f(x) \sim 2\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n}\sin nx = 2(\sin x - \frac{\sin 2x}{2} + \frac{\sin 3x}{3} - \cdots)
  4. By the convergence theorem: for x∈(−π,π)x \in (-\pi, \pi) the series converges to xx, and at x=±πx = \pm\pi it converges to −π+π2=0\frac{-\pi+\pi}{2} = 0

Answer: x=2∑n=1∞(−1)n+1nsin⁡nxx = 2\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n}\sin nx (x∈(−π,π)x \in (-\pi, \pi)).

Example 3: The Fourier Series of an Even Function

Let f(x)f(x) be a function of period 2π2\pi with f(x)=x2f(x) = x^2 on [−π,π][-\pi, \pi]. Find its Fourier series expansion.

Fourier serieseven functioncosine series

Approach:

An even function has only cosine terms, and the coefficient integral is a standard trigonometric integral.

Steps:

  1. f(x)=x2f(x) = x^2 is even, so bn=0b_n = 0
  2. a0=2π∫0πx2dx=2π⋅π33=2π23a_0 = \frac{2}{\pi}\int_0^{\pi} x^2 dx = \frac{2}{\pi} \cdot \frac{\pi^3}{3} = \frac{2\pi^2}{3}
  3. an=2π∫0πx2cos⁡nx dxa_n = \frac{2}{\pi}\int_0^{\pi} x^2 \cos nx \, dx; integrating by parts twice: =2π[x2sin⁡nxn]0π−4nπ∫0πxsin⁡nx dx=0−4nπ[−xcos⁡nxn]0π−4n2π∫0πcos⁡nx dx= \frac{2}{\pi}\left[\frac{x^2\sin nx}{n}\right]_0^{\pi} - \frac{4}{n\pi}\int_0^{\pi} x\sin nx \, dx = 0 - \frac{4}{n\pi}\left[-\frac{x\cos nx}{n}\right]_0^{\pi} - \frac{4}{n^2\pi}\int_0^{\pi}\cos nx \, dx =4n2cos⁡nπ−0=4(−1)nn2= \frac{4}{n^2}\cos n\pi - 0 = \frac{4(-1)^n}{n^2}
  4. The Fourier series: f(x)∼π23+4∑n=1∞(−1)nn2cos⁡nxf(x) \sim \frac{\pi^2}{3} + 4\sum_{n=1}^{\infty} \frac{(-1)^n}{n^2}\cos nx
  5. f(x)=x2f(x) = x^2 is continuous everywhere, so the series converges to x2x^2 everywhere

Answer: x2=π23+4∑n=1∞(−1)nn2cos⁡nxx^2 = \frac{\pi^2}{3} + 4\sum_{n=1}^{\infty} \frac{(-1)^n}{n^2}\cos nx (x∈[−π,π]x \in [-\pi, \pi]).

Exercises

Exercise 1

Let f(x)f(x) be a function of period 2π2\pi with f(x)=∣x∣f(x) = |x| on [−π,π)[-\pi, \pi). Find its Fourier series.

Fourier serieseven functioncosine series

Approach:

The function is even, but the absolute value means it is not smooth everywhere in a period, so the integration has to be done in pieces.

Steps:

  1. f(x)=∣x∣f(x) = |x| is even, so bn=0b_n = 0
  2. a0=2π∫0πxdx=πa_0 = \frac{2}{\pi}\int_0^{\pi} x dx = \pi
  3. an=2π∫0πxcos⁡nxdx=2π[xsin⁡nxn+cos⁡nxn2]0π=2n2π(cos⁡nπ−1)=2n2π((−1)n−1)a_n = \frac{2}{\pi}\int_0^{\pi} x\cos nx dx = \frac{2}{\pi}\left[\frac{x\sin nx}{n} + \frac{\cos nx}{n^2}\right]_0^{\pi} = \frac{2}{n^2\pi}(\cos n\pi - 1) = \frac{2}{n^2\pi}((-1)^n - 1)
  4. an=0a_n=0 when nn is even, and an=−4n2πa_n = -\frac{4}{n^2\pi} when nn is odd
  5. ∣x∣=π2−4π∑k=1∞cos⁡(2k−1)x(2k−1)2|x| = \frac{\pi}{2} - \frac{4}{\pi}\sum_{k=1}^{\infty} \frac{\cos(2k-1)x}{(2k-1)^2}

Answer: ∣x∣=π2−4π∑k=1∞cos⁡(2k−1)x(2k−1)2|x| = \frac{\pi}{2} - \frac{4}{\pi}\sum_{k=1}^{\infty} \frac{\cos(2k-1)x}{(2k-1)^2} (x∈[−π,π]x \in [-\pi, \pi]).

Exercise 2

Using the Fourier expansion of x2x^2, find the sum of ∑n=1∞1n2\sum_{n=1}^{\infty} \frac{1}{n^2}.

Fourier seriessumming a seriesthe Basel problem

Approach:

Evaluating the expansion at a suitable point (or integrating it) turns the classic series into an equation you can solve.

Steps:

  1. From Example 3: x2=π23+4∑n=1∞(−1)nn2cos⁡nxx^2 = \frac{\pi^2}{3} + 4\sum_{n=1}^{\infty} \frac{(-1)^n}{n^2}\cos nx
  2. Put x=πx = \pi (a point of continuity): π2=π23+4∑n=1∞(−1)nn2cos⁡nπ=π23+4∑n=1∞(−1)nn2(−1)n=π23+4∑n=1∞1n2\pi^2 = \frac{\pi^2}{3} + 4\sum_{n=1}^{\infty} \frac{(-1)^n}{n^2}\cos n\pi = \frac{\pi^2}{3} + 4\sum_{n=1}^{\infty} \frac{(-1)^n}{n^2}(-1)^n = \frac{\pi^2}{3} + 4\sum_{n=1}^{\infty} \frac{1}{n^2}
  3. Solving: 4∑n=1∞1n2=π2−π23=2π234\sum_{n=1}^{\infty} \frac{1}{n^2} = \pi^2 - \frac{\pi^2}{3} = \frac{2\pi^2}{3}
  4. ∑n=1∞1n2=π26\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}

Answer: ∑n=1∞1n2=π26\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6} (this is the famous solution of the Basel problem).

Summary

Symbols Used in This Article

SymbolTypePronunciation/ExplanationMeaning in This Article
an,bna_n, b_nFourier coefficientsFourier coefficientsThe coefficients of the Fourier series
a0a_0Constant coefficienta zeroThe coefficient of the constant term of the Fourier series
f(x−)f(x^-)Left limitleft limitThe left-hand limit of the function at xx
f(x+)f(x^+)Right limitright limitThe right-hand limit of the function at xx
∼\simCorresponds tocorresponds toThe function corresponds to its Fourier series
2π2\piPeriodperiodThe period of the function

Found an issue with this content?

Tell us what could be improved.