As motivation for studying Fourier series, suppose we have the problem
(4.2.1)
for some periodic function . We have already solved
(4.2.2)
One way to solve (4.2.1) is to decompose as a sum of cosines (and sines) and then solve many problems of the form (4.2.2). We then use the principle of superposition, to sum up all the solutions we got to get a solution to (4.2.1).
Before we proceed, let us talk a little bit more in detail about periodic functions. A function is said to be periodic with period if for all . For brevity we will say is periodic. Note that a periodic function is also periodic, periodic and so on. For example, and are periodic. So are and for all integers . The constant functions are an extreme example. They are periodic for any period (exercise).
Normally we will start with a function defined on some interval and we will want to extend periodicallyto make it a periodic function. We do this extension by defining a new function such that for in, . For in , we define , for in , , and so on. We assumed that . We could have also started with defined only on the half-open interval and then define .
You should be careful to distinguish between and its extension. A common mistake is to assume that a formula for holds for its extension. It can be confusing when the formula for is periodic, but with perhaps a different period.
Inner Product and Eigenvector Decomposition
Suppose we have a symmetric matrix, that is . We have said before that the eigenvectors of are then orthogonal. Here the word orthogonal means that if and are two distinct (and not multiples of each other) eigenvectors of , then . In this case the inner product is the dot product, which can be computed as .
To decompose a vector in terms of mutually orthogonal vectors and we write
Let us find the formula for and . First let us compute
Therefore,
Similarly
You probably remember this formula from vector calculus.
Trigonometric Series
Instead of decomposing a vector in terms of eigenvectors of a matrix, we will decompose a function in terms of eigenfunctions of a certain eigenvalue problem. The eigenvalue problem we will use for the Fourier series is
We have previously computed that the eigenfunctions are . That is, we will want to find a representation of a periodic function as
This series is called the Fourier seriesto the power 1 or the trigonometric series for . We write the coefficient of the eigenfunction as for convenience. We could also think of , so that we only need to look at and .
As for matrices we want to find a projection of onto the subspace generated by the eigenfunctions. So we will want to define an inner product of functions. For example, to find we want to compute . We define the inner product as
With this definition of the inner product, we have seen in the previous section that the eigenfunctions (including the constant eigenfunction), and are orthogonal in the sense that
By elementary calculus for we have and . For the constant we get
The coefficients are given by
Compare these expressions with the finite-dimensional example. For we get a similar formula
Let us check the formulas using the orthogonality properties. Suppose for a moment that
Then for we have
And hence
We have so far skirted the issue of convergence. For example, if is the square wave function, the equation
is only an equality for such where is continuous. That is, we do not get an equality for and all the other discontinuities of . It is not hard to see that when is an integer multiple of (which includes all the discontinuities), then
We redefine on as
and extend periodically. The series equals this extended everywhere, including the discontinuities. We will generally not worry about changing the function values at several (finitely many) points.
We will say more about convergence in the next section. Let us however mention briefly an effect of the discontinuity. Let us zoom in near the discontinuity in the square wave. Further, let us plot the first 100 harmonics, see Figure . You will notice that while the series is a very good approximation away from the discontinuities, the error (the overshoot) near the discontinuity at does not seem to be getting any smaller. This behavior is known as the Gibbs phenomenon. The region where the error is large does get smaller, however, the more terms in the series we take.
Lebl's Figure 5 freezes this at two settings, 3 harmonics and 20; here you can sweep between them and past them. The dashed trace is the square wave itself; the solid curve is the partial sum of his own series pi/2 + 2 sin t + (2/3) sin 3t + (2/5) sin 5t +.... At the default 3 you are looking at his left-hand panel exactly, and at 20 at his right-hand one. Drag between them and the ripples multiply and crowd in toward the jumps at t = 0 and t = +/- pi, but the tall spike beside each jump refuses to come down: its peak falls only from 3.456 to 3.424 across that whole drag, and never drops below 3.4227 = 1.0895*pi -- a permanent overshoot of 8.95 % of the jump height pi. Even-numbered settings look identical to the odd one below them, because a square wave has no even harmonics at all: this section computes b_n = 0 for every even n.Figure : Gibbs phenomenon in action.
We can think of a periodic function as a “signal” being a superposition of many signals of pure frequency. For example, we could think of the square wave as a tone of certain base frequency. This base frequency is called the fundamental frequency. The square wave will be a superposition of many different pure tones of frequencies that are multiples of the fundamental frequency. In music, the higher frequencies are called the overtones. All the frequencies that appear are called the spectrum of the signal. On the other hand a simple sine wave is only the pure tone (no overtones). The simplest way to make sound using a computer is the square wave, and the sound is very different from a pure tone. If you ever played video games from the 1980s or so, then you heard what square waves sound like.
Adapted from Differential Equations for Engineers by Jiří Lebl (Oklahoma State University), hosted on LibreTexts (math.libretexts.org) and licensed under CC BY-SA 4.0. Changes were made. License: CC-BY-SA-4.0.