Fourier Series

We found in the tutorial that the Fourier series of \begin{equation} f(x) = \begin{cases} 0, -\pi < x < 0 \\ 1, 0 < x < \pi \end{cases} \end{equation} was given by $$ f(x) = \frac{1}{2} + \frac{2}{\pi} \sum_{n=0}^\infty \frac{\sin n x}{n} $$ for odd $n$. Let's plot this out and see what it looks like.

We can see that as we include more terms, the approximation gets better however there is a "ringing" at the sharp edges of the step. This is the Gibb's phenomena and occurs because we're trying to represent a discontinuous function with continuous functions, sine and cosine waves.

In the tutorial, we also found that $$ \frac{\pi^2}{6} = \sum_{n=1}^\infty \frac{1}{n^2} . $$ Let's see how well this approximation converges.

We can see that this summation converges to the correct value as $1/n$.