Skip to content

Fourier Series

Fourier series are a way to represent a periodic function as a superposition of elementary waves.
FOURIER SERIES
Let ff be real-valued on [L,L][-L,L]. Its Fourier series is
f(x)a02+n=1(ancos(nπxL)+bnsin(nπxL)),\begin{equation*}f(x) \sim \frac{a_0}{2}+ \sum_{n=1}^{\infty}\left(a_n\cos\left(\frac{n\pi x}{L}\right)+ b_n\sin\left(\frac{n\pi x}{L}\right)\right),\end{equation*}
where
a0=1LLLf(x)dx,an=1LLLf(x)cos(nπxL)dx,bn=1LLLf(x)sin(nπxL)dx.\begin{equation*}a_0=\frac{1}{L}\int_{-L}^L f(x)\,dx, \quad a_n=\frac{1}{L}\int_{-L}^L f(x)\cos\left(\frac{n\pi x}{L}\right)\,dx, \quad b_n=\frac{1}{L}\int_{-L}^L f(x)\sin\left(\frac{n\pi x}{L}\right)\,dx.\end{equation*}
The approximation of the step function f(x)f(x)
Consider the step function on the interval [1,1][-1,1] with L=1L=1:
f(x)={1,x<12,1,12x<1.\begin{equation*}f(x)=\begin{cases}1, & |x| < \frac12,\\-1, & \frac12 \leq |x| < 1.\end{cases}\end{equation*}
The animation displays only the part of the resulting Fourier series on [0,1][0,1].
For this full interval, the constant term is
a0=11f(x)dx=201f(x)dx=2(01/21dx1/211dx)=2(1212)=0.\begin{align*}a_0 &=\int_{-1}^{1} f(x)\,dx =2\int_0^1 f(x)\,dx\\&=2\left(\int_0^{1/2}1\,dx-\int_{1/2}^{1}1\,dx\right) =2\left(\frac12-\frac12\right)=0.\end{align*}
For n1n\geq 1, the cosine coefficients are
an=11f(x)cos(nπx)dx=201f(x)cos(nπx)dx=2(01/2cos(nπx)dx1/21cos(nπx)dx)=2nπ(sin(nπ2)sin(nπ)+sin(nπ2))=4nπsin(nπ2).\begin{align*}a_n&=\int_{-1}^{1} f(x)\cos(n\pi x)\,dx =2\int_0^1 f(x)\cos(n\pi x)\,dx =2\left(\int_0^{1/2}\cos(n\pi x)\,dx-\int_{1/2}^{1}\cos(n\pi x)\,dx\right)\\&=\frac{2}{n\pi}\left(\sin\left(\frac{n\pi}{2}\right)-\sin(n\pi)+\sin\left(\frac{n\pi}{2}\right)\right) =\frac{4}{n\pi}\sin\left(\frac{n\pi}{2}\right).\end{align*}
The sine coefficients are
bn=11f(x)sin(nπx)dx=01f(u)sin(nπu)du+01f(x)sin(nπx)dx=0.\begin{equation*}b_n=\int_{-1}^{1} f(x)\sin(n\pi x)\,dx=-\int_{0}^{1} f(u)\sin(n\pi u)\,du +\int_{0}^{1} f(x)\sin(n\pi x)\,dx=0.\end{equation*}
Then every even coefficient is zero, while for n=2k+1n=2k+1 we get
a2k+1=4π(1)k2k+1.f(x)4πk=0(1)kcos((2k+1)πx)2k+1.\begin{equation*}a_{2k+1}=\frac{4}{\pi}\frac{(-1)^k}{2k+1}. \quad \Longrightarrow \quad f(x) \sim \frac{4}{\pi}\sum_{k=0}^{\infty}\frac{(-1)^k\cos((2k+1)\pi x)}{2k+1}.\end{equation*}
The heat equation for the step function
The step function f(x)f(x) can be interpreted as the initial temperature on a rod of length 11, where the first half has temperature 11 and the second half has temperature 1-1. The temperature is evolved by the heat equation:
{Tt=α2Tx2,0<x<1,t>0,T(x,0)=f(x),0<x<1.\begin{equation*}\begin{cases}\dfrac{\partial T}{\partial t}=\alpha\dfrac{\partial^2 T}{\partial x^2},& 0<x<1,\quad t>0,\\T(x,0)=f(x),& 0<x<1.\end{cases}\end{equation*}
where α>0\alpha>0 is the diffusivity. By representing the step function as the Fourier series
f(x)=4πk=0(1)kcos((2k+1)πx)2k+1.\begin{equation*}f(x) = \frac{4}{\pi}\sum_{k=0}^{\infty}\frac{(-1)^k\cos((2k+1)\pi x)}{2k+1}.\end{equation*}
we can guess the form of the solution T(x,t)T(x,t)
T(x,t)=k=04π(1)k2k+1cos((2k+1)πx)eα(2k+1)2π2tU2k+1(x,t).\begin{equation*}T(x,t)=\sum_{k=0}^{\infty}\underbrace{\frac{4}{\pi}\frac{(-1)^k}{2k+1}\cos((2k+1)\pi x)e^{-\alpha(2k+1)^2\pi^2t}}_{U_{2k+1}(x,t)}.\end{equation*}
Indeed, each summand U2k+1(x,t)U_{2k+1}(x,t) satisfies the heat equation:
U2k+1t=α(2k+1)2π2U2k+1(x,t),2U2k+1x2=(2k+1)2π2U2k+1(x,t).\begin{align*}\frac{\partial U_{2k+1}}{\partial t}&=-\alpha(2k+1)^2\pi^2 U_{2k+1}(x,t),\\\frac{\partial^2 U_{2k+1}}{\partial x^2}&=-(2k+1)^2\pi^2 U_{2k+1}(x,t).\end{align*}
Since the heat equation is linear, the sum of U2k+1(x,t)U_{2k+1}(x,t) also satisfies the equation. Thus the Fourier-mode evolution shown in the animation is
T(x,t)=4πk=0(1)k2k+1cos((2k+1)πx)eα(2k+1)2π2t.\begin{equation*}T(x,t) = \frac{4}{\pi} \sum_{k=0}^{\infty} \frac{(-1)^k}{2k+1} \cos((2k+1)\pi x) e^{-\alpha(2k+1)^2\pi^2t}.\end{equation*}
The formula shown at the top of the animation writes out the first few terms:
T(x,t)=4π(cos(πx)1eαπ2tcos(3πx)3e9απ2t+cos(5πx)5e25απ2t).\begin{equation*}T(x,t)=\frac{4}{\pi}\left(\frac{\cos(\pi x)}{1}e^{-\alpha\pi^2t}-\frac{\cos(3\pi x)}{3}e^{-9\alpha\pi^2t}+\frac{\cos(5\pi x)}{5}e^{-25\alpha\pi^2t}-\cdots\right).\end{equation*}

References

  • [Osgood2019]Osgood, Brad G. Lectures on the Fourier Transform and Its Applications. American Mathematical Society, 2019.