## Thursday, March 31, 2011

### Joey's Kids - Fourier Series - From Sines to Sawteeth

Joe Fourier gave us Fourier Analysis, and I can prove it because it's named after him not after Euler or Gauss or anyone else. You see? Not every proof is hard. The following is still my favorite though:

Did you know that all numbers are interesting? What’s that? You don’t believe me? Well I have a proof. Suppose not every number is interesting. Then let n be the smallest uninteresting number. That’s a rather interesting property isn’t it?
... Ron Graham

OK, that's enough silliness for one day, let's take out our notebooks, computer or "old school" spiral (for the young - that means a spiral notebook made with paper and cardboard. Back in my day we used a writing instrument known as a pencil or pen to make marks on the pages. You've probably seen them in a museum or your grandparent's attic), and get down to brass tacks.

Fourier Analysis. What is it? Fortunately, Mathematicians write things down, and from the book Mathematics 1001: Absolutely Everything That Matters About Mathematics in 1001 Bite-Sized Explanations we see that Fourier Analysis is part of the global Mathematical field known as "Analysis" (which includes Calculus), and in that book anyway is the most advanced topic, at least for Introductory purposes. Fourier Analysis can be broken down as follows:

1) Sine waves
2) Building waveforms
3) Fourier series
4) Fourier's theorem
5) Fourier's formulas
6) Complex Fourier series
7) The Fourier transform

Eventually we will get to #7, but not today. Today we will give a very short example of #3 above. Everything in stages. But you should know why we study this stuff, so we will get to #7 and here's why from the book:

The Fourier transform is a powerful weapon in the mathematician's arsenal, and has wide applications, from representation theory to quantum mechanics.

So yesterday we talked about "The Math Grenade" and today we talk about a powerful weapon. Why mathematicians don't organize like a modern military is beyond me. But whatever, here goes (and from Wiki) ...

HOW CAN WE TURN A SINE WAVE INTO A SAWTOOTH WAVE ?
 Animated plot of the first five successive partial Fourier series.

 Plot of a periodic identity function—a sawtooth wave.

f(x) denotes a function of the real variable x. This function is usually taken to be periodic, of period 2π, which is to say that ƒ(x + 2π) = ƒ(x), for all real numbers x. We will attempt to write such a function as an infinite sum, or series of simpler 2π–periodic functions. We will start by using an infinite sum of sine and cosine functions on the interval [−ππ], as Fourier did, and we will then discuss different formulations and generalizations.

### Fourier's formula for 2π-periodic functions using sines and cosines

For a periodic function ƒ(x) that is integrable on [−ππ], the numbers
$a_n = \frac{1}{\pi}\int_{-\pi}^\pi f(x) \cos(nx)\, dx, \quad n \ge 0$
and
$b_n = \frac{1}{\pi}\int_{-\pi}^\pi f(x) \sin(nx)\, dx, \quad n \ge 1$
are called the Fourier coefficients of ƒ. One introduces the partial sums of the Fourier series for ƒ, often denoted by
$(S_N f)(x) = \frac{a_0}{2} + \sum_{n=1}^N \, [a_n \cos(nx) + b_n \sin(nx)], \quad N \ge 0.$
The partial sums for ƒ are trigonometric polynomials. One expects that the functions SN ƒ approximate the function ƒ, and that the approximation improves as N tends to infinity. The infinite sum
$\frac{a_0}{2} + \sum_{n=1}^\infty \, [a_n \cos(nx) + b_n \sin(nx)]$
is called the Fourier series of ƒ.

We can now use the formula  above to give a Fourier series expansion of a very simple function. Consider a sawtooth wave
$f(x) = x, \quad \mathrm{for } -\pi < x < \pi,$
$f(x + 2\pi) = f(x), \quad \mathrm{for } -\infty < x < \infty.$
In this case, the Fourier coefficients are given by
\begin{align} a_0 &{} = \frac{1}{\pi}\int_{-\pi}^{\pi}x\,dx = 0. \\ a_n &{} = \frac{1}{\pi}\int_{-\pi}^{\pi}x \cos(nx)\,dx = 0, \quad n \ge 0. \\ b_n &{}= \frac{1}{\pi}\int_{-\pi}^{\pi} x \sin(nx)\, dx = -\frac{2}{n}\cos(n\pi) + \frac{2}{\pi n^2}\sin(n\pi) = 2 \, \frac{(-1)^{n+1}}{n}, \quad n \ge 1.\end{align}
It can be proved that the Fourier series converges to ƒ(x) at every point x where ƒ is differentiable, and therefore:
\begin{align} f(x) &= \frac{a_0}{2} + \sum_{n=1}^{\infty}\left[a_n\cos\left(nx\right)+b_n\sin\left(nx\right)\right] \\ &=2\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n} \sin(nx), \quad \mathrm{for} \quad x - \pi \notin 2 \pi \mathbf{Z}. \end{align}
When x = π, the Fourier series converges to 0, which is the half-sum of the left- and right-limit of ƒ at x = π. This is a particular instance of the Dirichlet theorem for Fourier series.

And there you have it folks, a real honest-to-God application of Calculus. That's right, there's more than one reason to learn Math other than as one sage put it: "So you can tell when your parents are lying."
:-)