# Math2111: Chapter 1: Fourier series. Recommended reading: Motivation of formulae for Fourier series and a comparison to Taylor series

In this blog entry you can find lecture notes for Math2111, several variable calculus. See also the table of contents for this course. This blog entry printed to pdf is available here.

We motivate the formulae for Fourier series. For simplicity we ignore here all questions concerning convergence, which are dealt with in Section 3 and the additional material.

Fourier series

As pointed out in the post on Section 2 at the beginning, in order to represent a function ${}f$ we need an orthonormal bases with respect to the inner product

$\displaystyle \langle f, g \rangle = \int_{-\pi}^\pi f(x) g(x) \, \mathrm{d} x.$

From Section 2 we know that the functions

$\displaystyle \cos (k x), \quad k = 0, 1, 2, \ldots,$

$\displaystyle \sin (k x), \quad k = 1, 2, \ldots,$

are orthogonal with respect to the inner product

$\displaystyle \langle f, g \rangle = \int_{-\pi}^\pi f(x) g(x) \,\mathrm{d} x.$

But since

$\displaystyle \langle 1, 1 \rangle = 2\pi, \quad \langle \cos (k x), \cos(k x) \rangle = \pi, \quad \langle \sin (l x), \sin (l x) \rangle = \pi$

the set of functions

$\displaystyle \cos (k x), \quad k = 0, 1, 2, \ldots,$

$\displaystyle \sin (k x), \quad k = 1, 2, \ldots,$

is not orthonormal. Hence, by rescaling them, i.e. by considering the functions

$\displaystyle \phi_k(x) = \frac{1}{\sqrt{\pi}} \cos (k x), \quad k = 1, 2, \ldots,$

$\displaystyle \psi_k(x) = \frac{1}{\sqrt{\pi}} \sin (k x), \quad k = 1, 2, \ldots,$

and $\phi_0(x) = \frac{1}{\sqrt{2\pi}}$ we obtain an orthonormal basis. Let

$\displaystyle c_k = \langle f, \phi_k\rangle \quad \mbox{for } k = 0, 1, 2, \ldots \mbox{ and } d_k = \langle f, \psi_k \rangle \quad \mbox{for } k = 1,2, \ldots.$

Then, using the same approach as in the beginning of Section 2 we obtain

$\displaystyle \begin{array}{lcr} f(x) & = & c_0 \phi_0(x) + \sum_{k=1}^\infty \left[ c_k \phi_k(x) + d_k \psi_k(x) \right] \\ && \\ & = & \frac{c_0}{\sqrt{2\pi}} + \sum_{k=1}^\infty \left[\frac{c_k}{\sqrt{\pi}} \cos kx + \frac{d_k}{\sqrt{\pi}} \sin kx \right]. \end{array}.$

Notice that by setting

$\displaystyle a_0 = \sqrt{\frac{2}{\pi}} c_0, \quad a_k = \frac{c_k}{\sqrt{\pi}} \mbox{for } k = 1,2,\ldots, \mbox{ and } b_k = \frac{d_k}{\sqrt{\pi}}, k = 1,2, \ldots$

we obtain exactly the formulae for the Fourier series. For example for $k=1,2,3,\ldots$ we have

$\displaystyle a_k = \frac{c_k}{\sqrt{\pi}} = \frac{1}{\sqrt{\pi}} \langle f, \phi_k \rangle = \frac{1}{\pi} \langle f, \cos kx \rangle = \frac{1}{\pi} \int_{-\pi}^\pi f(x) \cos kx \, \mathrm{d} x.$

The other formulae can be obtained analoguously.

Taylor series

In the following we shall ignore questions concerning convergence.

Assume that $f:[-1,1]\to\mathbb{R}$ is infinitely times differentiable and let $c \in (-1,1)$. Then we can calculate a Taylor series expansion

$\displaystyle f(x) = f(c)+\frac{f^\prime(c)}{1!}(x-c)+\frac{f^{\prime\prime}(c)}{2!}(x-c)^2+\cdots=\sum_{n=0}^\infty\frac{f^{(n)}(c)}{n!}(x-c)^n.$

One can motivate this formula by observing that for a function

$\displaystyle f(x) = a_0 + a_1 (x-c) + a_2 (x-c)^2 + \cdots \qquad\qquad (1)$

we have

$\displaystyle \begin{array}{rcl} f(c) & = & a_0, \\ && \\ f^\prime(x) & = & a_1 + 2 a_2 (x-c) + 3 a_3 (x-c)^2 + \cdots \\ & & \\ f^\prime(c) & = & a_1, \\ && \\ f^{\prime\prime}(x) & = & 2a_2 + 2\cdot 3 a_3 (x-c) + 3 \cdot 4 a_4 (x-c)^2 + \cdots, \\ && \\ f^{\prime\prime}(c) & = & 2 a_2, \end{array}$

and so on. In general we obtain

$\displaystyle f^{(n)}(c) = n! a_n \quad \mbox{for } n = 0, 1, 2, \ldots$

where $f^{(n)}$ denotes the ${}n$th derivative of ${}f$ and $n!=1\cdot 2 \cdots n$ and $0!:=1$. Therefore we obtain the formula

$\displaystyle a_n = \frac{f^{(n)}(c)}{n!}.$

Hence the derivation of the formula for Taylor series is different from that of Fourier series. However, one could use a similar approach as for Fourier series to obtain an expansion in polynomials.

Consider now the inner product

$\displaystyle \langle f, g \rangle=\int_{-1}^1 f(x) g(x)\,\mathrm{d} x.$

Notice that the polynomials $x^0,x^1,x^2,\ldots$ are not orthogonal to each other since

$\displaystyle \langle x^k, x^l \rangle = \int_{-1}^1 x^k x^l \, \mathrm{d} x = \frac{1}{k+l+1} \neq 0 \quad \mbox{for } k \neq l.$

There is, however, a set of orthogonal polynomials defined on $[-1,1]$ (notice that for intervals different from $[-1,1]$ you need different polynomials). These are called Legendre polynomials and are denoted by $P_0,P_1,P_2,\ldots$. The first few Legendre polynomials are

$\displaystyle \begin{array}{rcl} P_0 & = & 1, \\ && \\ P_1(x) & = & x, \\ && \\ P_2(x) & = & \frac{3x^2-1}{2} \end{array}$

and in general

$\displaystyle P_n(x) = \frac{1}{2^n n!} \frac{\mathrm{d}^n}{\mathrm{d} x^n} (x^2-1)^n, \quad \mbox{for } n = 0, 1, 2, \ldots.$

You can find the graph of the first few Legendre polynomials here.

The inner product of the Legendre polynomials is given by

$\displaystyle \langle P_k,P_l\rangle = \int_{-1}^1 P_k(x)P_l(x)\,\mathrm{d}x = \left\{\begin{array}{rl} 0 & \mbox{if } k \neq l, \\ & \\ \frac{2}{2k+1} & \mbox{if } k = l. \end{array} \right.$

Let us define

$\displaystyle \widetilde{P}_k(x) = \sqrt{\frac{2k+1}{2}} P_k(x).$

Then

$\displaystyle \langle \widetilde{P}_k,\widetilde{P}_l\rangle = \int_{-1}^1 \widetilde{P}_k(x)\widetilde{P}_l(x)\,\mathrm{d}x = \left\{\begin{array}{rl} 0 & \mbox{if } k \neq l, \\ & \\ 1 & \mbox{if } k = l. \end{array} \right.$

Assume that ${}f$ is of the form (1). Then let

$\displaystyle b_k = \langle f,\widetilde{P}_k \rangle = \int_{-1}^1 f(x) \widetilde{P}_k(x) \,\mathrm{d}x.$

Then

$\displaystyle f(x) = b_0 \widetilde{P}_0(x) + b_1 \widetilde{P_1}(x) + \cdots.$

Example Let $f(x)=x^2$. Then

$\displaystyle \begin{array}{rcl} \int_{-1}^1 x^2 \widetilde{P}_0 \, \mathrm{d} x & = & \frac{\sqrt{2}}{3}, \\ && \\ \int_{-1}^1 x^2 \widetilde{P}_1(x) \,\mathrm{d} x & = & 0, \\ && \\ \int_{-1}^1 x^2 \widetilde{P}_2(x) \, \mathrm{d} x & = & \sqrt{\frac{5}{2}} \frac{4}{15}. \end{array}$

Then we have

$\displaystyle \frac{\sqrt{2}}{3} \widetilde{P}_0 + \sqrt{\frac{5}{2}} \frac{4}{15} \widetilde{P}_2(x) = \frac{1}{3} + \sqrt{\frac{5}{2}}\sqrt{\frac{5}{2}} \frac{4}{15} \frac{3x^2-1}{2} = x^2.$

Taylor series and inner product

As we have seen above, Taylor series are not based on an expansion of functions which are orthonormal with respect to the $L_2$ inner product since they are based on the functions $1, (x-c), (x-c)^2, (x-c)^3, \ldots.$ However, one can create an inner product by defining these functions as orthonormal. For functions

$\displaystyle \begin{array}{rcl} f(x) &=& a_0+a_1(x-c)+a_2(x-c)^2+\cdots, \\ && \\ g(x) & = & b_0+b_1(x-c)+b_2(x-c)^2+\cdots, \end{array}$

where $a_0,b_0,a_1,b_1,\ldots$ are real numbers, let

$\displaystyle \begin{array}{rcl} \langle f, g \rangle & = & a_0b_0+a_1b_1+\cdots \\ && \\ &=& \frac{f(c)}{0!}\frac{g(c)}{0!}+\frac{f^\prime(c)}{1!}\frac{g^\prime(c)}{1!}+\frac{f^{\prime\prime}(c)}{2!}\frac{g^{\prime\prime}(c)}{2!}+\cdots \\ && \\ &=& \sum_{n=0}^\infty \frac{1}{n!}\frac{\mathrm{d}^nf}{\mathrm{d}x^n}(c) \frac{1}{n!}\frac{\mathrm{d}^ng}{\mathrm{d}x^n}(c).\end{array}$

We define the associated norm norm $\|f\|= \sqrt{\langle f, f\rangle}$. The functions $1,x-c,(x-c)^2,\ldots$ are now orthonormal, since

$\displaystyle \langle (x-c)^k,(x-c)^l\rangle = \sum_{n=0}^\infty \frac{1}{n!}\left(\frac{\mathrm{d}^n(x-c)^k}{\mathrm{d}x^n}\right)_{x=c} \frac{1}{n!}\left(\frac{\mathrm{d}^n(x-c)^l}{\mathrm{d}x^n}\right)_{x=c}$

and

$\displaystyle \frac{1}{n!}\left(\frac{\mathrm{d}^n(x-c)^k}{\mathrm{d}x^n}\right)_{x=c}= \left\{\begin{array}{rl} 0 & \mbox{if } k \neq n, \\ & \\ 1 & \mbox{if } k =n, \end{array} \right.$

which implies that

$\displaystyle \langle (x-c)^k, (x-c)^l\rangle = \left\{\begin{array}{rl} 1 & \mbox{if } k = l, \\ & \\ 0 & \mbox{if } k \neq l. \end{array}\right.$

For a function ${}f$ as defined above we have

$\displaystyle \langle f, (x-c)^k \rangle = \frac{\mathrm{d}^kf}{\mathrm{d}x^k}(c)=a_k$

and hence

$\displaystyle \sum_{k=0}^\infty \langle f, x^k \rangle x^k= \sum_{k=0}^\infty a_k x^k=f(x).$