# Using Inner Product Spaces to Derive Fourier Series

I'm going through a chapter on Fourier series, and I've encountered some confusion.

The textbook states the following:

In the context of linear spaces, we can immediately write $$f(x) = (a_0, a_1, b_1, \dots, a_n, b_n, \dots)$$ is a vector expressed in terms of the orthonormal basis $$e = (e_0, e_{\alpha_1}, e_{\beta_1}, \dots, e_{\alpha_n}, e_{\beta_n}, \dots)$$, where

$$e_0 = \dfrac{1}{\sqrt{2}},$$ $$e_{\alpha_n} = \cos(nx),$$ $$e_{\beta_n} = \sin(nx)$$

The series $$f = \sum_{k = 0}^\infty \langle f,e_k\rangle e_k$$, where $$e_k, k = 0, \dots$$ is a renumbering of the basis vectors. This is the standard expansion of $$f$$ in terms of the orthonormal basis and is the Fourier series for $$f$$. Invoking the linear space theory therefore helps us understand how it is possible to express any function piecewise continuous in $$[-\pi, \pi]$$ as the series expansion

$$f(x) \sim \dfrac{a_0}{\sqrt{2}} + \sum_{n = 1}^\infty (a_n \cos(nx) + b_n \sin(nx)), \ -\pi < x < \pi,$$ where $$a_n = \dfrac{1}{\pi} \int_{-\pi}^\pi f(x)\cos(nx) \ dx,$$ and $$b_n = \dfrac{1}{\pi} \int_{-\pi}^\pi f(x)\sin(nx) \ dx, \ n = 0, 1, 2, \dots$$

The orthonormal basis is $$\{ 1/\sqrt{2}, \sin(x), \cos(x), \sin(2x), \cos(2x), \dots \}$$.

I am also told the following:

The sequence of functions $$\{ 1/\sqrt{2}, \sin(x), \cos(x), \sin(2x), \cos(2x), \dots \}$$ form an infinite orthonormal sequence in the space of all piecewise continuous functions on the interval $$[-\pi, \pi]$$, where the inner product $$\langle f, g\rangle$$ is defined by $$\langle f, g\rangle = \dfrac{1}{\pi} \int^\pi_{-\pi} f \ \bar{g} \ dx$$, where the overbar denotes the complex conjugate.

However, I am struggling to expand $$f = \sum_{k = 0}^\infty \langle f,e_k\rangle e_k$$ to get $$f(x) \sim \dfrac{a_0}{\sqrt{2}} + \sum_{n = 1}^\infty (a_n \cos(nx) + b_n \sin(nx)), -\pi < x < \pi$$. I would greatly appreciate it if people could please take the time to demonstrate this step-by-step.

• Can you say more about what you're confused about? Some of the $e_k$ are equal to $\cos nx$ for some $n$, and that's where the cosine terms come from. Some of the $e_k$ are equal to $\sin nx$ for some $n$, and that's where the sine terms come from. And one of them is equal to $\frac{1}{\sqrt{2}}$, and that's where the $\frac{a_0}{\sqrt{2}}$ term comes from. Sep 26, 2017 at 22:41
• @QiaochuYuan Thanks for the response. I'm primarily concerned with how we expand $f = \sum_{k = 0}^\infty \langle f,e_k\rangle e_k$ to get, as the textbook says, $f(x) \sim \dfrac{a_0}{\sqrt{2}} + \sum_{n = 1}^\infty (a_n \cos(nx) + b_n \sin(nx)), -\pi < x < \pi$. Sep 26, 2017 at 22:47
• Yes, I know, but what are you confused about when you try to do that? Sep 26, 2017 at 22:48
• @QiaochuYuan The term $f = \sum_{k = 0}^\infty \langle f,e_k\rangle e_k$. I've never dealt with abstract inner product spaces, so I think this is where the confusion lies. Sep 26, 2017 at 22:48
• There are various steps involved in converting that expression into a Fourier series, and you're stuck on at least one of them; which one is it? Can you write down the integral $\langle f, e_k \rangle$, using the definition of the inner product provided? Sep 26, 2017 at 22:50

It boils down to calculate the product

$$\langle f, e_k\rangle = \frac{1}{\pi}\int_{-\pi}^{\pi}{\rm dx}~f(x)e_k(x)$$

Note that

$k = 0$

$$\langle f, e_0\rangle = \frac{1}{\pi}\int_{-\pi}^{\pi}{\rm dx}~f(x)e_0(x) = \frac{1}{\sqrt{2}} \left[\frac{1}{\pi}\int_{-\pi}^{\pi}{\rm dx}~f(x)\right] = \frac{a_0}{\sqrt{2}}$$

$k = \alpha_n$

$$\langle f, e_{\alpha_n}\rangle = \frac{1}{\pi}\int_{-\pi}^{\pi}{\rm dx}~f(x)e_{\alpha_n}(x) = \frac{1}{\pi}\int_{-\pi}^{\pi}{\rm dx}~f(x)\cos(nx) = a_n$$

$k = \beta_n$

$$\langle f, e_{\beta_n}\rangle = \frac{1}{\pi}\int_{-\pi}^{\pi}{\rm dx}~f(x)e_{\beta_n}(x) = \frac{1}{\pi}\int_{-\pi}^{\pi}{\rm dx}~f(x)\sin(nx) = b_n$$

Putting everything together you get

$$f(x) = \sum_{k=0}^{+\infty}\langle f, e_k\rangle e_k(x) = \frac{a_0}{\sqrt{2}} + \sum_{k=1}^{+\infty}a_n\cos(nx) + b_n\sin(nx)$$

• Thanks for the comprehensive response! I understand now. :) Sep 26, 2017 at 22:54