Fourier Series
A Fourier series is a way of representing a periodic function as a (possibly infinite) sum of sine and cosine functions. It is analogous to a Taylor series, which represents functions as possibly infinite sums of monomial terms.
For functions that are not periodic, the Fourier series is replaced by the Fourier transform. For functions of two variables that are periodic in both variables, the trigonometric basis in the Fourier series is replaced by the spherical harmonics. The Fourier series, as well as its generalizations, is essential throughout the physical sciences since the trigonometric functions are eigenfunctions of the Laplacian, which appears in many physical equations.
Contents
Definition of the Fourier Series
The Fourier series is a particular way of rewriting functions as a series of trigonometric functions. Read on below to learn how this series is constructed.
The Fourier series of a periodic function \(f(x)\) of period \(T\) is
\[f(x) = \frac{a_0}{2} + \sum_{k=1}^{\infty} a_k \cos \frac{2 \pi k x}{T} + \sum_{k=1}^{\infty} b_k \sin \frac{2 \pi k x}{T} ,\]
for some set of Fourier coefficients \(a_k\) and \(b_k\) defined by the integrals
\[a_k = \frac{2}{T} \int_0^T f(x) \cos \frac{2 \pi k x}{T}\:dx, \quad b_k = \frac{2}{T} \int_0^T f(x) \sin \frac{2 \pi k x}{T}\:dx.\]
In order to compute the Fourier series representation of some periodic function \(f\), therefore, one needs only to compute the above set of integrals for arbitrary \(k\). Often, one can immediately set all \(b_k\) or \(a_k\) to zero by noting that the function \(f\) is odd or even since an odd function will have no cosine contributions and vice versa.
The normalization factors in front of the coefficients come from the fact that the cosine and sine functions as defined are orthogonal but not orthonormal. The factor of \(\frac12\) multiplying \(a_0\) therefore comes from the fact that the normalization for \(a_0\) is different, since
\[a_0 = \frac{2}{T} \int_0^T f(x) \,dx\]
is twice the average value of the function \(f\) over \([0,T)\).
Note that, for a periodic function of period \(T\), the integral limits in the definitions of the Fourier coefficients may be shifted by any constant factor as long as the integration window remains length \(T\) always.
Find the Fourier series of the square wave, for which the function over one period is
\[f(x) = \begin{cases} 1 \quad &\text{if }~0\leq x<\frac12 \\ -1 \quad &\text{if }~\frac12 \leq x < 1. \end{cases}\]
The function is odd and has average value zero, with period \(T=1\). Therefore, all \(a_k\) vanish; one must only compute the integrals to find the \(b_k\):
\[ \begin{align} b_k &= 2\int_0^1 f(x) \sin 2 \pi k x\:dx \\ &= 2\int_0^{1/2} \sin 2 \pi k x \:dx - 2 \int_{1/2}^1 \sin 2 \pi k x \:dx \\ &=2\left[ \left. -\frac{\cos 2\pi kx}{2\pi k}\right|_{x=0}^{x=\frac{1}{2}} + \left. \frac{\cos 2\pi kx}{2\pi k}\right|_{x=\frac{1}{2}}^{x=1}\right] \\ &=2\left[ -\frac{\cos \pi k}{2\pi k}+\frac{1}{2\pi k} + \frac{\cos 2\pi k}{2\pi k}-\frac{\cos \pi k}{2\pi k}\right] \\ &= \frac{2}{\pi k} \left(\sin^2 \frac{\pi k}{2} - \frac{1}{2} \cos \pi k + \frac{1}{2} \cos 2\pi k\right) \\ &= \begin{cases} \frac{4}{\pi k} \quad &\text{if }~ k \text{ is odd} \\ 0 \quad &\text{if }~ k \text{ is even}, \end{cases} \end{align}\]
where in the last line the fact that \(k\) is a positive integer was used. Therefore, the Fourier series for the square wave is
\[f(x) = \frac{4}{\pi} \sum_{k = 1,3,5,\ldots} \frac{1}{k} \sin 2\pi k x.\ _\square\]
Note that near the jump discontinuities for the square wave, the finite truncations of the Fourier series tend to overshoot. This is a common aspect of Fourier series for any discontinuous periodic function which is known as the Gibbs phenomenon.
Find the Fourier series of the triangle wave which is defined by
\[f(x) = -2|x-0.5|+1\]
for \(-0.5\leq x \leq 1.5\) and is periodic outside this region.
Hint: Try plotting the given function first.
Applications and Generalizations
\[\] The Heat Equation and Spherical Harmonics:
Fourier originally devised the use of Fourier series as a method of solving the heat equation
\[\frac{\partial T}{\partial t} - \alpha \nabla^2 T = 0,\]
where \(T\) is temperature, \(t\) is time, and \(\alpha\) is some constant.
As can be shown from functional analysis, the set of eigenfunctions of the operator \(\nabla^2 = \frac{\partial^2}{\partial x^2}\) in one dimension are complete, meaning that any function can be represented by a linear combination of them. In one dimension, these eigenfunctions are exactly the sine and cosine functions. Since the heat equation prominently features the operator \(\nabla^2\), by representing functions via their Fourier series, Fourier was able to solve for the asymptotic temperature distribution in a material given an initial temperature distribution.
In a higher-dimensional equation using \(\nabla^2\) such as the Schrödinger equation for the hydrogen atom, it is more appropriate to use the higher-dimensional generalization of the Fourier series, the spherical harmonics.
\[\] The Fourier Transform:
The Fourier series as described above suffices to represent any periodic function. One can also say that this means the trigonometric functions are a complete set for representing functions on a compact interval, since any periodic function may be represented by the function over just one finite period.
For arbitrary functions over the entire real line which are not necessarily periodic, no Fourier series will be everywhere convergent. In this case, however, it is possible to represent a function by its Fourier transform. Given a function \(f(x)\), its Fourier transform is written
\[\hat{f} (k) = \int_{-\infty}^{\infty} f(x) e^{-2\pi i kx} \:dx.\]
One can treat this formula like the same inner product that defines the coefficients of the Fourier series. Previously, the coefficients were numbers indexed by a discrete variable \(k\). Now, the variable \(k\) is continuous, and the function \(\hat{f}(k)\) gives the value of the "coefficient" of the oscillating function \(e^{-2\pi i kx}\), which is one of an uncountable set of trigonometric functions. It is also possible to define the Fourier transform exactly analogous to the Fourier series, where a real trigonometric basis is used rather than a complex basis.
\[\] The Basel Problem:
The Basel Problem is a well-known problem in mathematical analysis, concerned with computing a certain value of the Riemann zeta function:
\[\zeta(s) = \sum_{n=1}^{\infty} \frac{1}{n^s}.\]
It can be shown that for values \(s=2n\), where \(n\) a positive integer, this function takes values
\[\zeta(2n) = \frac{(2\pi)^{2n} (-1)^{n+1} B_{2n}}{2 \cdot (2n)!},\]
where \(B_k\) is the \(k^\text{th}\) Bernoulli number.
The Basel problem asks for computation of \(\zeta(2)\), which can be seen from the above formula to be
\[\zeta(2) = \sum_{n=1}^{\infty} \frac{1}{n^2} = 1+ \frac{1}{4} + \frac{1}{9} + \cdots = \frac{\pi^2}{6}.\]
Solve the Basel problem, i.e. compute \(\zeta(2)\), using Fourier series.
The proof uses Parseval's identity, a generalization of the Pythagorean theorem
\[\sum_{n=-\infty}^{\infty} |a_n|^2 = \frac{1}{2\pi} \int_{-\pi}^{\pi} |f(x)|^2 \:dx,\]
where the \(a_n\) are a modified version of Fourier coefficients of \(f\) defined by
\[a_n = \frac{1}{2\pi} \int_{-\infty}^{\infty} f(x) e^{-inx} \:dx,\]
and \(f\) is a function periodic on \([-\pi, \pi]\).
Consider the function which is defined by \(f(x) = x\) on \([-\pi, \pi]\) and is periodic outside this interval. When \(n=0\), the coeficient \(a_n = 0\) because \(f(x) = x\) is odd. Otherwise, computing these coefficients yields
\[a_n = \frac{1}{2\pi} \int_{-\infty}^{\infty} x e^{-inx} \:dx = \frac{(-1)^{n+1}}{in}.\]
Plugging into Parseval's identity, one has
\[2 \sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{1}{2\pi} \int_{-\pi}^{\pi}x^2 \:dx.\]
Note that the left hand side is equal to \(2\zeta(2)\). Evaluating the integral on the right,
\[ \frac{1}{2\pi} \int_{-\pi}^{\pi}x^2 \:dx = \frac{1}{2\pi} 2 \frac{\pi^3}{3} = \frac{\pi^2}{3}.\]
Therefore, comparing to Parseval's identity above, one finds the result
\[\zeta(2) = \frac{\pi^2}{6}.\ _\square\]
Derivation of the Fourier Series
In linear algebra, a vector \(v\) with components \((v_1,\ldots, v_n)\) in the standard basis can be written in a different, orthonormal basis \(\{b_k\}\) via the formula
\[v = \sum_k b_k (v,b_k),\]
where \((a,b)\) denotes the inner product or dot product of \(a\) and \(b\).
This formula may be generalized to functions, where the inner product between two real functions \(f\) and \(g\) becomes an integral. If both functions are periodic with period \(T\), this inner product is (up to some particular normalization)
\[(f,g) = \frac{2}{T} \int_0^T f(x) g(x) \:dx,\]
and in general a function may be written
\[f = \sum_k b_k (f,b_k)\]
for any set of basis functions \(b_k\).
The Fourier series is simply a particular way of rewriting functions, using the basis \(\{b_k\} = \{f_k\} \cup \{g_k\}\). That is, the basis functions are the combination of two particular sets of functions \(\{f_k\}\) and \(\{g_k\}\). These sets are the functions
\[f_k (x) = \cos \frac{2 \pi k x}{T} , \quad g_k (x) = \sin \frac{2 \pi k x}{T},\]
where \(k \in \{0,1,2,\ldots\}\) ranges over the non-negative integers.
Writing out the basis change with these functions, any function \(f\) can therefore be decomposed into the Fourier series
\[f = \frac{a_0}{2} + \sum_{k=1}^{\infty} a_k \cos \frac{2 \pi k x}{T} + \sum_{k=1}^{\infty} b_k \sin \frac{2 \pi k x}{T}\]
with the coefficients \(a_k\) and \(b_k\) defined by the inner products
\[a_k = \frac{2}{T} \int_0^T f(x) \cos \frac{2 \pi k x}{T} \:dx, \quad b_k = \frac{2}{T} \int_0^T f(x) \sin\frac{2 \pi k x}{T} \:dx,\]
as described previously.
References
- Thenub314, . Fourier series for square wave. Retrieved from https://en.wikipedia.org/wiki/Square_wave