John Finn's Comments on Fourier Series
Winter 1998
Comment 1
Dear Class ---
I am about to send you
Some Remarks about Fourier Series,
which, I hope, will help you grasp the Big Picture of what's going on with
Fourier series. I realize that of the two aims
(1) to really understand what Fourier series are about, and
(2) to be able to solve, on the coming exam, problems like those
worked out in the text, number (2) is likely to be your first priority. Please
believe me, though, that (1) does make (2) much easier, and that (1) is not
hard; not if you go about things the right way, which unfortunately our authors
do not. But _I_ do, and this is my field in mathematics -- Fourier Transforms
--. I know for a fact that I have been able to get first-year students, those
who aren't "good at math", and may not even have had a calculus course, to
really understand what Fourier series are about, in my Freshman Seminar
"Mathematical Gems".
Before "Some Remarks about Fourier Series", however, here's a single example
worked out the way I approach such a problem. This is
Example 1 on page 572 of the text,
so you see it worked out the authors' way there.
As I point out in "Some Remarks", the _hardest_ and _most complicated_ that we
can make a fourier series problem is to insist on computing the f dot cos_n's
and f dot sin_n's, i.e. the integrals
integral f(x) cos(nx) dx and integral f(x) sin(nx) dx
(each times a constant), and to work on an interval other than the natural one,
[-pi, pi], which is exactly what our dear authors do. Thus, whereas the _easy_
computation is
f dot e_n = 1/2pi integral f(x) e^{-inx} dx,
our authors do everything in terms of integrals of the form
integral f(x) cos (n pi x/L) dx and integral f(x) sin (n pi x/L) dx,
which is much harder, both because of all the n pi x/L business (instead of
just nx), and because it's much easier to integrate f(x) times an exponential
than f(x) times a sine or cosine.
Notice that there is no loss of generality whatever in assuming our interval
to be the natural one; if it isn't, we can just change our units of
measurement. However, if we have to come up with the sin and cosine
coefficients for an f on some other interval, the method that takes the least
work is to
(1) translate f(x) to g(u) on the natural interval,
(2) get the coefficients g dot e_n, and reduce the resulting Fourier series
for g(u) to a sine or cosine series when appropriate, then
(3) translate things back to the unnatural interval.
Here I give an example of doing this, to solve the problem that is Example 1
on page 572. There the problem is to find the Fourier series for the sawtooth
function, defined as
f(x) = x on [-L, L], and extended periodically.
To do this the easy way, we note that we map
[-Pi, Pi] --> [-L, L]
x --> u
by
u = (pi/L)x; x = (L/pi)u.
Thus we start by getting the Fourier series for g(u) = f(x(u)) = (L/pi)u.
Since this is just the scalar L/pi times the function h(u) = u on [-pi, pi], we
get the series for h(u), which we can then just multiply by the scalar. To get
the coefficients for h(u) we compute
h dot e_n = 1/2pi integral u e^{-inu} du.
To make things more familiar, let's just call the integral
integral x e^{-inx} dx,
and remember not to confuse this dummy variable x with the x in our change of
variables.
We do this integral by an integration by parts, letting
u = x
du = dx
dv = e^{-inx} dx
v = i/n e^{-inx} (since 1/-i = i, so 1/(-in) = i/n.
Here
-integral v du = i/n integral e^{-inx} dx
= i/n integral e_{-1}(x) dx,
and it's easy to see that the integral of any slinky except the 0th is 0. Thus
-integral v du = 0,
so the entire value of our integral is the uv part, which we must remember to
EVALUATE FROM -pi TO pi. If you don't do that you're doomed. To do that, we
bear in mind another important property of the e_n's:
e_n(pi) and e_n(-pi) are EQUAL;
they're both 1 if n is even, and -1 if n is odd.
This follows immediately from the facts that
e_n(x) = e^{inx} = cos(nx) + isin(nx);
sin(n pi) = 0;
cos(n pi) = 1 if n is even, -1 if n is odd.
The uv term is thus
i/n x e_{-n}(x) evaluated from -pi to pi = i/n 2pi (-1)^n.
But we have the factor 1/2pi in front of this integral, so we conclude that
h dot e_n = i/n (-1)^n.
This means that h(u) is the sum, from -infinity to infinity, of the terms
i/n (-1)^n e_n(u).
If we now add the -n and n terms together, the cosine parts drop out, and we
get
i/n (-1)^n 2i sin nu = 2 (-1)^{n+1} 1/n sin nu,
so
h(u) = 2 sum (-1)^{n+1} 1/n sin nu.
and thus
g(u) = 2L/pi sum (-1)^{n+1} 1/n sin nu,
so that
f(x) = g(u(x)) = 2L/pi sum (-1)^{n+1} 1/n sin [(n pi/L) x],
which is exactly the answer the book gives.
To get this the book's way, though, instead of getting the coefficients by
doing
integral u e^{-inu} du,
which takes a single integration by parts, we have to do
2/L integral x sin [(n pi x)/L] on 0 to L,
which they just blithely write down as
2/L (L/npi)^2 {sin [(n pi x)/L] - [(n pi x)/L] cos [(n pi x)/L]}
evaluated from 0 to L.
Hunh? Where did they get this antiderivative? What they're doing, as though
you could do this in your head, is saying that the antiderivative of x sin Mx
is
int (x sin Mx) = 1/M^2 (sin Mx - Mx cos Mx),
(where by M I mean the _mess_ (n pi)/L). Give me a break! Can _you_
antidifferentiate x sin Mx in your head? Did they do this by parts, or what?
They don't give us a clue. OK; I just did it by parts, and got
int(x sin Mx) = -1/M x cos Mx + 1/M int cos Mx
= -1/M x cos Mx + 1/M^2 sin Mx
= 1/M^2(sin Mx - Mx cos Mx),
and that wasn't too hard, since I called the mess M. But if I had tried to do
this with the mess written out, chances are very slim that I would have gotten
it right.
The moral of the story here is that it really is easier to
(1) translate f(x) to g(u) on the natural interval,
(2) get the coefficients g dot e_n, and reduce these to sines and cosines
when appropriate, then
(3) translate things back to the unnatural interval.
Now, the book also just blithely arrives at complicated looking solutions in
all their examples, and leaves it at that. How do you know if your solution is
right? The answer is that the only way to do that is to have a computer
program that will graph for you the partial sums of the Fourier series that
your solution specifies. I am putting such a program in the math 23 folder in
PUBLIC (I can't just email you the program as good ol' True Basic screws that
up). Without using such a program you simply have just about no way of having
the slightest idea whether your answer is right or wrong. And these
computations are devilish, simply because of all the minus sings involved.
Maybe you think that you're way beyond ever making mistakes with minus signs,
but I assure that I'm not beyond it, and I also assure you that my more than 20
years' experience in grading student work where they have to compute Fourier
coefficients shows that most students DO mess up with the minus signs.
Please work this example yourself. without using these notes. Then find the
Fourier series for the function f(x) = x^2 on [-pi, pi]. Notice that as a
periodic function x^2 is continuous (but not differentiable; it has cusps at
the endpoints, whereas the function x is not continuous. This is reflected in
the niceness of their Fourier transforms, i.e., the functions
fhat(n) = f dot e_n
on Z, the integers. For f(x) = x, fhat is
fhat(n) = i times (-1)^n times 1/n.
Notice that the sum of fhat for n = -infinity to infinity converges
conditionally but not absolutely, the terms being of the same order as 1/n.
For g(x) = x^2, however, you'll find that
ghat(n) is of the same order as 1/n^2.
This illustrates the general principle that the smoother f is as a function on
the circle, the faster fhat, a function on the integers, converges to 0.
Comment 2
Note -- the typing here at best crudely approximates math notation. I suggest
that you print this out, and then yourself write the formulas in correct math
notation. That will help you understand.
Some Remarks about Fourier Series
---------------------------------
Fourier series are really all about _perpendicularity_, and are not hard to
understand if we bear that in mind, choose an appropriate interval to work on,
and use the slinkies
e_n(x) := e^(inx) = cos nx + i sin nx
themselves to work with, instead of breaking them into sines and cosines.
You'd hardly know any of this from reading out text. Because they work on an
arbitrary interval [0, L] instead of [0, pi], do work with the sine and cosine
pieces instead of the whole slinkies, and don't emphasize the role of
perpendicularity (also called orthogonality), their account has page after page
of nasty-looking integrals, and makes it hard to discover the Big Picture
underneath all the irrelevant detail.
If we had time to study Fourier series as we ought to, we'd see that we're
really dealing here with a transform, which assigns to every square-summable
function f(x) on the circle it's Fourier transform fhat(n), a square-summable
function on the integers. We'd see that we have the same sort of intertwining
properties that we have with the Laplace transform (and indeed, the Fourier
transform and Laplace transform are really just two aspects of a single
operator), which would greatly reduce the actual number of integrals we ever
have to carry out.
Unfortunately, we're rushing through this topic, one of the most beautiful
---and applicable-- areas in all of mathematics. Given that, it's important to
get the Big Picture, which is what I attempt to do here.
Since, as we'll soon see, Fourier series are all about orthogonality, we
need to recall some facts from an earlier handout I gave you, about the dot
product for complex vectors. If X = (x,y,z) and A = (a,b,c) are complex
vectors then the dot product that comes naturally, the one that tells us the
cosine of the angle between X and A is
X dot A = xa* + yb* + zc*,
where a* denotes the complex conjugate of the complex number a. I'd write this
as a with a line over it, but can't do that with just typing. I could also
write alpha, beta, gamma instead of a, b, c to emphasize that these are complex
numbers, but again that's to hard to do with plain typing.
The thing to notice here is that X dot A and A dot X, which from now on I'm
going to type as X @ A and A @ X are _not_ equal; rather
A @ X = (X @ A)*;
that is, reversing the order of the factors in a dot product gives you the
complex conjugate of the product in the other order. One consequence of this
is that while
(sX) @ A = s (X @ A),
we have
X @ sA = s* (X @ A),
that is, a scalar on the second factor of a dot product pulls through as its
conjugate. You have to be careful about this. For instance, if by cos_n we
mean the function
cos_n(x) := cos nx,
then cos_n = 1/2 [e_n + e_{-n}]. Thus
cos_n @ cos_n = 1/4 [e_n + e_{-n}] @ [e_n + e_{-n}],
but the RHS is _not_ e_n @ e_n + 2 e_n @ e_{-n} + e_{-n} @ e_{-n};
rather, we have
[e_n + e_{-n}] @ [e_n + e_{-n}] =
e_n @ e_n + e_n @ e_{-n} + e_{-n} @ e_n + e_{-n} @ e_{-n}.
(which, as we'll see, comes out to 1 + 0 + 0 + 1, so that cos_n @ cos_n = 1/2.
This is much easier than doing cos_n @ cos_n as an integral. But the point
here is that we have to be careful to remember the conjugate property of dot
products.
Now, functions are vectors, and we take the dot product of two functions
exactly as we do that of two vectors: we multiply together the coordinates,
and add up these products ---oops; that is, we multiply each coordinate of the
first by the _conjugate_ of the coordinate of the second, and add these up.
Thus we have
f @ g := integral f(x) g(x)* dx over x = -pi to pi;
as the natural dot product of f and g. Actually, we put a factor of 1/2pi in
the integral, so that e_n @ e_n will come out to 1, making our e_n's an
ortho_normal_ collection, instead of just orthogonal.
What function on [-pi, pi] are those natural to look at if we're studying
orthogonality? Exactly those
f: [-pi, pi] --> Complex numbers
for which f @ f is finite; i.e., those for which
integral f(x) f(x)* dx = integral |f(x)|^2 dx < infinity
(unless specified otherwise, all integrals here are on [-pi, pi]. These are
the _square-summable_ functions on [-pi, pi], denoted L^2[-pi, pi], and include
the piecewise continuous functions.
L^2[-pi, pi] is a complex vector space; it's trivial that a scalar multiple
of f is in L^2 if f is, and not hard to show that f+g is in L^2 if both f and g
are. In fact, L^2 is a complex _algebra_, since also the product fg is on L^2
whenever f and g are (which turns out to be of crucial importance since the
Fourier transform intertwines multiplication with convolution, i.e., pointwise
multiplication with long multiplication, and the most elegant solutions of the
heat and wave equations are those expressed in terms of convolution; but,
alas, we haven't the time to go into this).
Now, the significance of the slinkies e_n (n = -infinity to infinity) is that
(1) the e_n's are orthonormal:
e_n @ e_m = 0 if n =/= m; 1 if n = m, and
(2) the e_n's are _complete_ in L^2,
which taken together give us the
MAIN THEOREM OF FOURIER SERIES: the e_n's are an orthonormal basis for L^2.
To say that the e_n's are complete means that every f in L^2 is a (possibly
infinite) linear combination of the e_n's. It's easy to see that an orthogonal
set of vectors are independent, which is why (1) and (2) give us the main
result.
We'll see in a minute why the e_n's are orthonormal. Meanwhile, it's
easy to work out that if vectors X, Y, Z are orthogonal , and if V is a combo
of them, then the coefficients of V, called its Fourier coefficients, are easy
to work out:
V = [(V @ X)/(X @ X)] X + [(V @ Y)/(Y @ Y)] Y + [(V @ Z)/(Z @ Z)] Z;
(by the way, don't be silly by trying to "cancel X" in [(V @ X)/(X @ X)], etc.;
it makes no sense to write V/X) and this is simplified even more if X, Y, Z are
orthonormal, meaning each dotted with itself is 1, for then we have
V = (V @ X) X + (V @ Y) Y + (V @ Z) Z.
This works just as well if the vector f is an infinite combo of the orthonormal
set of vectors e_n, and we have
f = sum (f @ e_n) e_n for n = -infinity to infinity.
Thus, getting the Fourier series for f amounts to calculating the fourier
coefficients
f @ e_n = 1/2pi integral f(x) e^{-inx} dx.
(The integral has e^{-inx} because this is the conjugate of e_n(x). Since
e_n(x) = cos nx + i sin nx is a point on the unit circle, and since for a
complex number z on the unit circle 1/z is equal to z conjugate, the conjugate
of e_n(x) is its reciprocal, which is e^{-inx}, or e_{-n}(x).
These are the calculations you have to do in a Fourier series problem. Our
text, of course, is not going to ask you for these coefficients
c_n = f @ e_n,
but rather for
a_n = 2 f @ cos_n, and
b_n = 2 f @ sin_n,
but, as we'll soon see, the a_n's and b_n's are easy to get if you know the
c_n's. To get them directly you have to integrate f against cos_n or sin_n,
whereas for the c_n's you have to integrate f against e_n. And you should know
by now that in an integration by parts nothing is more convenient as one of the
factors than an exponential. If you have a sine or a cosine, you're likely to
have to do _two_ integrations by parts, and may well wind up seen=ming to have
gone in a circle, but not really having done so.
(Do you recall this situation? Sometimes you do two integrations by parts,
and wind up with the same integral you started with. In some cases you really
have gone in a circle, and have gotten nowhere. But in other situations you
can now solve the equations you have for that integral, and hence get the
answer you want. But it's still a pain in the butt. And this is the problem
you get from breaking a slinky e_n(x) = cos nx + i sin nx into its sin and
cosine parts; by dealing with the parts instead of the whole, you have to deal
with sine and cosine, which are (up to a constant) their own second
derivatives, whereas an exponential is (up to a constant) its own first
derivative. This really does make an enormous difference in the amount of
computation you have to do.)
To show that the e_n's are complete, the text says, is beyond the scope of
this course. Actually, if you take the time to develop good notation,
especially for some functions of special interest, like the one all of whose
Fourier coefficients are 1 -- which turns out to be the Dirac delta function--
then you can state in very simple terms just what it means for the e_n's to be
complete, and you can _prove_ it, without much difficulty. If you leave things
in terms of sines and cosines, and work on some interval [-L, L], then the
proof becomes horrible, and so loaded with unessential details (like having
always to use sine and cosine of (pi n/L)x, instead of just cos nx and sin nx)
that there's just abut no chance you're really going to understand it. For a
good proof, see Dym & McKean "Fourier Series and Intervals", and for another
excellent treatment of the subject, see Bracewell's book on the Fourier
transform.
To show that the e_n's are orthonormal, on the other hand, is easy; e_k @
e_m is 1/2pi times the integral of e_k times e_{-m} , i.e., the integral of
e_{k-m} = e_n. Now the integral of e_n is just 2pi if n = 0. If n is not 0,
then the integral is 0. You can see this by taking the antiderivative, which
is just 1/ni times e_n itself. And e_n is the _same_ at pi and -pi; it's 1 at
both if n is even, and -1 if n is odd. So
integral e_n(x) dx = integral e^{inx} dx = 1/in e_n(x) from -pi to pi = 0.
It's better, though, to think of what the integral means, and to think of
approximating it by a sum (and don't call such a sum a "Riemann sum"; these
sums were around long before Riemann). Suppose we approximate the integral of
e_n on [-pi. pi] by cutting the interval up into M little pieces of length
delta x. Then our sum approximating the integral is
sum_k e_n(x_k) delta x = delta x times sum_k e_n(x_k)
(where sum_k means the sum for k = 1 to M). Now consider this sum. Each
e_n(x_k) is a complex number on the unit circle, or a vector from 0 to that
point on the circle. We have the sum of a bunch of these vectors, equally
spaced about the unit circle, and going around n times. But each sum of such
vectors once around the circle is 0. Why? Well, if M is even, each vector is
canceled by its negative. But even if M is odd, if you think of these vectors
as representing forces, and ask yourself: what is the net result of applying
an equal force in directions equally spaced in a circle? You'll see that the
answer is that the net result is 0. You can make this argument rigorous by
noting that, by _symmetry_, the sum must bear the same geometrical relation to
each vector, since they are arranged in circular symmetry. The only point in
the plain which bears the same relation to all of them is the origin; QED.
You should learn to draw good pictures of the graphs of the slinkies e_n. I
call them slinkies because these graphs are helices. The _shadow_ of the graph
of e_n on the floor is cos nx, and its shadow on the wall is sin nx. Notice
that each slinky is entirely homogeneous; if you curt a little piece out of a
slinky there's no way to tell where it came from, since the slinky is
absolutely the same everywhere; i.e. homogeneous. A piece cut from a sine or
cosine graph, however, looks different depending on what part of the graph it
comes from. The homogeneity of the slinky makes clear, for instance, that
translating it is the same as rotating it; a fact you see in action every time
you look at a rotating barber's pole; the red stripes appear to be moving up
or down as the pole revolves. (By the way, a barber's pole represents a
forearm with blood running down it, as the result of a vein having been opened
to bleed the patient (barbers used to be surgeons as well). Bleeding was a
common remedy for illness, the idea being to drain off the bad blood. George
Washington died from being bled like this.)
That translation of a slinky is the same as rotating it, i.e., multiplying
by a complex number on the unit circle, mens that each slinky is an eigenvector
of the translation operator. Since the derivative involves an infinitesimal
translation (you divide f(x+dx) - f(x) by dx), this means that the differential
operator D, expressed as an infinite matrix in terms of the slinkies, is a
diagonal matrix. This is why the Fourier approach to differential equations
works so well).
Now the brass tacks
-------------------
OK; so we have that the main idea of Fourier series is very elegant if
(1) we stay on the natural interval [-pi, pi], and
(2) we express everything in terms of the e_n's.
But the homework problems involve an interval [-L, L], and ask us for cosine
and sine coefficients. How can we reconcile this with the elegant solution?
The answer is that
(1) adjusting for an interval other than [-pi, pi] is a matter of a simple
change of variable -- and _ought_ to be left until the very end; you first
figure things out in terms of the natural interval [-pi, pi], and then at the
end adjust by the change of variable, and
(2) getting the a_n's and b_n's is easy as pie if you have the c_n's. That
is, you can get the cosine and sine coefficients _without_ doing any cosine and
sine integrals. You just do integrals involving the exponentials e_n to get
the slinky coefficients , c_n, and then use the formulas which we'll see in a
minute for getting the a_n's and b_n's from the c_n's.
Comment 3
Note -- this is the second half of
Some Remarks about Fourier Series
-- I couln't send the whole thing at once becuase it's too long. Please put
the two parts together as some sort of text file, and print out the whole
thing. The notation is very limited becusse of typing restrictions, but you
whould, as you read these notes, write out the formulas in the actual notation
by hand.
-John
(What's below the dotted line here is the second half of "Some Remarks about
Fourier Series", and follows the paragraph whose last sentence is "You just do
integrals involving the exponentials e_n to get the slinky coefficients , c_n,
and then use the formulas which we'll see in a minute for getting the a_n's and
b_n's from the c_n's."
---------------------------------------------------------
And what about the theoretical stuff? How, for instance, so we show that the
cos_n's and sin_n's are orthogonal? The book delights in filling a couple of
pages with integrals of cos(mx) -- no, make that cos (m pi/L)x, just to keep it
nice and complicated -- times cos(n pi/L)x, or sin (m pi/L)x, etc., etc. Then
they compute these integrals by using memorized trig identities -- the very
nadir of mathematics, in my opinion. But cos_n @ cos_m and so on we can easily
express in terms of e_n and e_m, and we can use the orthonormality of the e_n's
to get that of the cos_n's and sin_n's.
Let's first consider how the c_n's relate to the a_n's and b_n's. Actually,
we have three ways of expressing a function f as a Fourier series:
(1) we can write
+ c_1 e_1 + c_2 e_2 + c_3 e_3 + etc.
f = c_0
+ c_{-1}1 e_{-1} + c_{-2}1 e_{-2} + c_{-3}1 e_{-3} + etc.
where c_n = f @ e_n.
(2) we can write
+ a_1 cos_1 + a_2 cos_2 + a_3 cos_3 + etc.
f = a_0/2
+ b_1 sin_1 + b_2 sin_2 + b_3 sin_3 + etc.
where a_n = 2 f @ cos_n and b_n = 2 f @ sin_n
(these being (f @ cos_n)/(cos_n @ cos_n) and (f @ sin_n)/(sin_n @ sin_n), since
(cos_n @ cos_n) = (sin_n @ sin_n) = 1/2; this is why we put 1/pi instead of
1/2pi times the integral when working with cosines and sines -- excuse me; why
we put 1/L instead of 1/2L).
(3) we can write
f = d_0 + d_1 cos(x - phi_1) + d_2 cos(2x - phi_2) + d_3 cos(3x - phi_3) +
etc.
where d_n = sqrt(a_n^2 + b_n^2) and phi_n = angle (a_n, b_n) (oh, except that
d_0 is just a_0/2. But d_0 is going to be 0, anyhow, in most cases that use
this form).
Form (3) has the advantage of using a single term for each frequency
component, and best expresses the idea that an musical sound of a given
frequency can be synthesized by sounding tuning forks (assumed to produce pure
waves, those whose picture on an oscilloscope is a simple sine wave; the term
"pure wave" I find much more attractive than the ugly term "sinusoidal" --
yuck!) of that frequency and integer multiples of hit, at prescribed
amplitudes; namely, at amplitude d_n. The phi_n in each term is a phase
shift, so this form uses the fact that the sum of a sine and cosine of a given
frequency is equal to a single shifted cosine of that same frequency. And
since it turns out that the human ear is unaware of these frequency shifts
anyhow, in making a synthesizer like the Synklavier, we can just use the
unshifted cosines -- a fact verified to me by Sydney Alonso, the inventor of
the Synklavier. To see that the sum of a sine and cosine of a given frequency
is equal to a single shifted cosine of that same frequency, we write
a cos y + b sin y = d (a/d cos y + b/d sin y) where d = sqrt(a^2 + b^2)
Now a/d and b/d are cos(phi) and sin(phi), where phi = angle(a,b); i.e., the
angle that the point (a,b) makes with the x-axis. Thus
a/d cos y + b/d sin y = cos phi * cos y + sin phi * sin y = cos(y -
phi).
If in (1) we add c_n e_n and c_{-n} e_{-n} we get
c_n (cos nx + i sin nx)
c_{-n} (cos nx - i sin nx)
---------------------------
(c_n + c_{-n}) cos nx
which shows that a_n = c_n + c_{-n}, and subtracting gives b_n = i(c_n -
c_{-n}):
a_n = c_n + c_{-n};
b_n = i(c_n - c_{-n})
and we can solve these to get the c_n's in terms of the a_n's and b_n's, which
I leave to you. So instead of getting a_n and b_n by integrating f against
cos_n and sin_n, we integrate f against e_n, which is easier, and get both.
We've already seen what the d_n's and phi_n's are in terms of the a_n's and
b_n's; in terms of the c_n's they're
d_n = 2 sqrt(c_n c_{-n}) = 2|c_n|
phi_n = angle(c_{-n})
Now; what are the advantages of forms (1), (2), and (3)? We've already seen
that (3) has the advantage of representing f as a sum of a single term for each
frequency component, which makes it best for expressing the musical
interpretation of Fourier series. And (1) is the simplest and most uniform
expression of f as a sum of orthogonal components. What's, then, the advantage
of (2)? None, except perhaps for those who are frightened by complex numbers.
But (2) has the distinct _dis_advantage of being the most complicated and least
uniform of the 3 forms, and of being in terms of the most complicated
integrals; there are 3 distinct cases of integrals to compute to show the
orthogonality (cos_k @ cos_m, sin_k @ sin_m and cos_k @ sin_m), each of which
requires using either trig identities or 2-fold integration by parts , and 2
different integrals to get the coefficients.
In fact, the only advantage that (2) gives is letting a person who claims
to be explaining Fourier series make sure that he confounds his audience,
especially if, like our author, he insists on carrying out his calculations on
some interval [-L, L]. Making everything seem so complicated makes him seem
smart, and us dumb, and is likely to make us conclude that since we can't
possibly understand any of this, we'd better just start memorizing the
mountains of formulas. Great. He gets ego gratification, and we get confusion
and a task of memorizing.
The moral here is that if you have a Fourier series problem, you should
probably
(1) convert it into one on [-pi, pi],
(2) use the e_n's to figure out the c_n's, then
(3) get the a_n's and b_n's from the c_n's, and finally
(4) convert your answer back to the interval [a,b] that the problem is
stated on.
Let's consider now this conversion of interval question. We map [a,b] linearly
onto [-pi. pi] by
[a,b] --> [-pi, pi]
x --> u
where u = 2pi(x-a)/(b-a) -pi
x = [(b-a)/2pi](u+pi) + a
In the case where [a,b] = [-L, L], this simplifies to
[-L, L] --> [-pi, pi]
x --> u
where u = [pi/L] x
x = [L/pi} u
This is why in the book, where they use [-L. L], we see everything in terms
of
sin[(n pi x)/L] and cos[(n pi x)/L]
instead of sin nx and cos nx.
So, suppose we have a function f(x) in L^2[a,b], and we want to get its
fourier series. We have g(u) in L^2[-pi, pi] where g(u) = f(x(u)) =
f([(b-a)/2pi](u+pi) + a). That looks pretty awful, but
g(u) = sum c_n e_n(u) (for n = -infinity to
infinity)
where
c_n = ghat(n) = g @ e_n = 1/2pi integral g(u) e_{-n}(u).
To translate this back in terms of x, we have
f(x) = g(u(x)) = sum c_n e_n(u(x)).
As a concrete example, suppose we take the sawtooth with basic period [a,b].
That is, f(x) on [a,b] is to be the function with slope 1 that is 0 at the
midpoint, which is
f(x) = x - (a+b)/2.
We put g(u) = f(x(u)), which comes out to
g(u) = [(b-a)/2pi] u.
Thus, on [-pi, pi], g(u) is just u times the constant (b-a)/2pi. So we let
h(u) = u, and figure out h @ e_n. This is
h @ e_n = 1/2pi integral u e^{-inu} du
and we do this by integration by parts. Now, you have to be extremely careful
when doing these integrals, because of all the minus signs. And the worst part
is that, unless you have a computer program to graph for you partial sums of
the answer you get, you have no idea whether it's right or not. I'll provide
you with a program to do this, but the program works just for functions on
[-pi, pi]. Since we're using u as our variable, let's call the parts w and v;
i.e integration by parts says
integral w dv = wv - integral v dw
In this particular integration by parts, the -integral v dw is 0; everything
is in the wv term, which you have to be careful to realize
(1) has a factor of 1/2pi, and
(2) is to be evaluated from -pi to pi.
If you keep that straight, you find that the answer is
hhat(n) = h @ e_n = (-1)^n i/n;
i.e.,
h(u) = sum (-1)^n i/n e_n(u) n = -infinity to infinity
Now since hhat(n) is an odd function, we know that h(u) will have an odd
expansion, i.e., will involve only sine terms. And if we add the n and -n
terms in this expansion for h(u), we get that
h(u) = sum (-1)^{n+1} 2/n sin nu n = 1 to infinity
or h(u) = 2 sum (-1)^{n+1} 1/n sin nu n = 1 to infinity
Thus g(u) is (b-a)/2pi times this sum, and f(x) = g(u(x)) is just the sum for
g(u) with sin n[u(x)] in it:
f(x) = (b-a)/pi sum (-1)^{n+1} 1/n sin n[2pi(x-a)/(b-a) -pi].
Looks pretty awful, hunh? But that's because by using [a,b] we're coercing the
sine function off of its natural interval [-pi, pi], and this is the price we
pay.
Now let's see what this comes out to when [a,b] = [-L, L], which is Example 1
on page 572 of our text. For a = -L and b = L, (b-a)/pi becomes 2L/pi, and
u(x) = (pi/L)x, so we have
f(x) = 2L/pi sum (-1)^{n+1} 1/n sin [(n pi x)/L],
which is exactly what the books gets for the answer. To get this the book's
way, though, instead of getting the coefficients by doing
integral u e^{-inu} du,
which takes a single integration by parts, we have to do
2/L integral x sin [(n pi x)/L] on 0 to L,
which they just blithely write down as
2/L (L/npi)^2 {sin [(n pi x)/L] - [(n pi x)/L] cos [(n pi x)/L]}
evaluated from 0 to L.
Hunh? Where did they get this antiderivative? What they're doing, as though
you could do this in your head, is saying that the antiderivative of x sin Mx
is
int (x sin Mx) = 1/M^2 (sin Mx - Mx cos Mx),
(where by M I mean the _mess_ (n pi)/L). Give me a break! Can _you_
antidifferentiate x sin Mx in your head? Did they do this by parts, or what?
They don't give us a clue. OK; I just did it by parts, and got
int(x sin Mx) = -1/M x cos Mx + 1/M int cos Mx
= -1/M x cos Mx + 1/M^2 sin Mx
= 1/M^2(sin Mx - Mx cos Mx),
and that wasn't too hard, since I called the mess M. But if I had tried to do
this with the mess written out, chances are very slim that I would have gotten
it right.
Let's see; what's left? Showing that the sines and cosines are orthogonal.
The first thing to note here is that in their integrals they have 1/pi as a
factor, rather than 1/2i. Why is this? Well,
a_n = c_n + c_{-n} = f @ e_n + f @ e_{-n}
= f @ (e_n + e_{-n}) = f @ 2 cos_n
= 2 f @ cos_n.
Since we take f @ g to be 1/2pi times the integral of f(x)g(x)*, 2 f @ cos_n
is 1/pi times the integral of f(x) cos(nx). Similarly,
b_n = i(c_n -c_{-n}) = i [f @ e_n - f @ e_{-n} ]
= i f @ (e_n - e_{-n}) = i f @ 2isin_n.
Here's where you have to remember that X @ aY is not a X @ Y but a* X @ Y. So
f @ 2isin_n = (2i)* f @ sin_n = -2i f @ sin_n,
and i times this is 2 f @ sin_n. Thus
b_n = 2 f @ sin_n,
which shows why the integral for b_n has 1/pi in front, instead of 1/2pi.
Of course, the factor in front of the integral doesn't really matter in
showing orthogonality; we just want to show that
cos_n @ cos_m = 0 and sin_n @ sin_m = 0 when n =/= m,
and that
sin_n @ cos_m = 0 for all m and n.
To do this, we write cos_n = 1/2 (e_n + e_{-n}) and sin_n = 1/2i (e_n -
e_{-n}). Then
cos_n @ cos_m = 1/4 (e_n + e_{-n}) @ (e_m + e_{-m})
= 1/4 (e_n @ e_m + e_n @ e_{-m} + e_{-n} @ e_m + e_{-n} @ e_{-m}).
Now, if m =/= n, each of these 4 dot products is 0 (we don't have to worry
about m being equal to -n, since cos_n and cos_m have positive subscripts). If
m = n, the first and 4th are 1, and the 2nd and 3rd are 0, so
cos_n @ cos_n = 1/4 (2) = 1/2,
another reason for the 1/pi they have in front of their integrals; if we
define the dot product to be the integral with 1/pi in front, then the cosines
and sines are ortho_normal_.
We likewise show that
sin_m @ sin_m = 0 if m =/= n
1/2 if m = n.
For cos_n @ sin_m we have
cos_n @ sin_m = 1/2 (e_n + e_{-n}) @ 1/2i (e_m - e_{-m})
= i/4 (e_n + e_{-n}) @ (e_m - e_{-m})
= i/4 [e_n@e_m - e_n@e_{-m} + e_{-n}@e_m
-e_{-n}@e_{-m}]
Here, since n and m are both positive, the dot products involving a positive
and a negative subscript are 0 in any case. And if m =/= n, the other two are
0 as well. If m = n, then we're left with i/4 [e_n@e_n -e_{-n}@e_{-n}] =
1/4[1-1] = 0.
A summary
---------
Fourier series are about perpendicularity, or orthogonality, of functions on
the unit circle, T, or, equivalently, of periodic functions with basic period
[-pi, pi]. For functions f, g : T --> Complex numbers, we have
f @ g = f dot g = 1/2pi integral f(x) g(x)* dx,
where z* means the complex conjugate of z.
Of the functions on T, Fourier series involve those in L^2(T), the
square-summable functions; those for which the Pythagorean length, sqrt(f@f),
and hence f@f itself, is finite:
f is in L^2(T) <==> f@f = 1/2pi integral f(x) f(x)* dx
= 1/2pi integral |f(x)|^2 dx < infinity.
L^2(T) is a complex vector space, in fact a complex algebra --in two different
ways; with pointwise multiplication and also with long multiplication, or
convolution, of functions. Understanding how the Fourier transform intertwines
these two multiplications is really crucial in appreciating it, but we don't
have time to go into that.
The slinkies e_n, defined by
e_n(x) = e^{inx} = cos nx + i sin nx; n = -infinity to
infinity
form an orthonormal basis for L^2(T). That they are orthonormal is easy to
show, and that orthogonal ==> independent also easy to show, but in this course
we don't show that the e_n's are complete, meaning that every f in L^2(T) is
an infinite linear combination of the e_n's. However, if we assume that a
given f is such a combo, then it is easy to compute the Fourier coefficients of
f, the coefficient of e_n being f @ e_n.
Instead of taking the e_n's as the basis for L^2(T), we can equivalently take
the functions cos_n and sin_n, defined by
cos_n(x) = cos(nx); sin_n(x) = sin(nx) for n = 0 to
infinity.
The coefficients of f in terms of these are
f@cos_n/cos_n@cos_n = 2f@cos_n and f@sin_n/sin_n@sin_n = 2f@sin_n.
But both to compute these sine and cosine intervals, and to show their
theoretical properties (such as that the cos_n's and sin_n's are orthogonal),
it's much easier to do everything in terms of the e_n's.
In solving a problem in Fourier series, which usually amounts to finding the
series for a given f, the computation involved is getting the f@e_n's, or else
the f@cos_n's and f@sin_n's. Of these, the f@e_n's are much easier. In fact,
the _hardest_ and _most complicated_ that we can make this problem is to insist
on computing the f@cos_n's and f@sin_n's, and to work on an interval other than
the natural one, which is exactly what our dear authors do.
Notice that there is no loss of generality whatever in assuming our interval
to be the natural one; if it isn't, we can just change our units of
measurement. However, if we have to come up with the sin and cosine
coefficients for an f on some other interval, the method that takes the least
work is to
(1) translate f(x) to g(u) on the natural interval,
(2) get the coefficients g @ e_n, and reduce these to sines and cosines when
appropriate, then
(3) translate things back to the unnatural interval.
-John