Copyright 2001
Department of Mathematics
University of Georgia
Athens, Georgia
John Gosselin
Fourier Series
The trigonometric functions {sin(nx), cos(nx)}, n = 0,1,2,..., are useful in creating approximations to functions. Since these functions are all periodic with period
, it is convenient to work on the interval [
,
]. The basic idea is to start with a function
f
(
x
) on [
,
] and attempt to express
f
(
x
) in the form
where
and
are constants for
n
= 0,1,2,... These numbers are referred to as the Fourier coefficients of the function
f
(
x
).
Orthogonality of cos(nx) and sin(nx)
The calculation of the numbers
and
is based on special properties of integrals involving
and
. We list these properties below. Let
n
and
m
be two
distinct
positive integers. Then
The last equality is valid even when m = n . These equations are referred to as the orthogonality relations for sines and cosines.
Project - Part 1
Choose several values for m and n between 1 and 20 and verify the orthogonality relations for sines and cosines.
Square integrals of cos(nx) and sin(nx)
Two other special properties of the functions
and
are given below. Assume
n
is an integer greater than or equal to 1.
The special case when n = 0 is different. In this case we have
= 0
=
Project Part 2
Choose several values of n between 1 and 20 and verify the results above.
A Simple Example
We begin with a simple example. Let
.
| > | f:=x->4+3*sin(2*x)-5*cos(3*x); |
| > | plot(f(x),x=-Pi..Pi); |
We see what happens when we integrate
f
(
x
) times
or times
.
| > | for n from 1 to 5 do int(f(x)*sin(n*x),x=-Pi..Pi) od; |
| > | for n from 1 to 5 do int(f(x)*cos(n*x),x=-Pi..Pi) od; |
Recall that
. Notice that when
n
= 2 we have
=
and when
n
= 3 we have
=
. Finally, we integrate
f
(
x
) times the constant function 1 (which we think of as cos(0
x
)).
| > | int(f(x)*1,x=-Pi..Pi); |
Project - Part 3
Define the function
. Calculate the integrals
,
and
for
n
= 1..5. Discuss your results. How are these integrals related to the coefficients of the various sines and cosines in the formula for
f
(
x
)?
Fourier Coefficients
The previous examples suggest that for a (continuous) function
f
(
x
) defined on [
,
], we define the following Fourier coefficients
and
:
,
n =
1,2,...
,
n
= 1,2,...
These numbers are called the Fourier coefficients of f ( x ). Having calculated these coefficients we form the function
+
+
Theoretically, these sums may involve an infinite number of terms and a question about limits of finite sums arises. For our putposes, we will only consider a finite number of terms in these sums. In most cases 10 terms will be sufficient.
Project - Part 4
Define the function
on the interval [
,
]. Compute the Fourier coefficients of
f
(
x
) for
n
= 0,1,2,...10. It is probably easiest to define
separately and then define the remaining coefficients as functions of the variable
n
. Also the integrals should be evaluated numerically. For example, one might define the function
a
as follows:
| > | a:=n->evalf((1/(Pi))*int(f(x)*cos(n*x),x=-Pi..Pi)); |
| > |
If you define
a
and
b
as functions, then you will need to use functional notation
a
(
n
) in place of subscripts
. Also, you can use the above formula for
a
(0) except that you must multiply the result by 0.5 since
a
(0) has
in the denominator rather than
. After you have defined the Fourier coefficients of
f
(x), define the partial sum function
Plot the graphs of the original function
f
(
x
) and
together over the interval [
,
]. How do the graphs compare? What happens if you plot the two graphs on the larger interval [
,
]?
Define a function
of two variables as
This is accomplished with a command of the form
| > | S:=(x,k)->.5*a(0)+sum(a(n)*cos(n*x),n = 1 .. k)+sum(b(n)*sin(n*x),n = 1 .. k); |
By changing
k
, you can create different partial sum functions. Find
and
and plot these over the interval [
,
] along with the original function
f
(
x
). Do the partial sums appear to approximate
f
(
x
) better as
k
increases?
Project - Part 5
We assumed
f
(
x
) was continuous to guarantee that all the integrals we wrote down existed. These integrals will all exist even if
f
(
x
) is piecewise continuous over the interval [
,
].
| > | restart: |
Consider the function
f
(
x
) defined by -3 over the interval [
,-2), -
x
over the interval [-2,1), and 1 over the interval [1,
]. Such a piecewise defined function can be defined in Maple with the command
| > | f:=x->piecewise(x>=-Pi and x<-2,-3,x>=-2 and x<1,-x,x>=1 and x<=Pi,1); |
If we evaluate f ( x ) in Maple, we obtain somewhat more familiar output although the inequalities are not exactly in the form we might prefer.
| > | f(x); |
This function is discontinuous at x = -2 and at x = 1.We can plot the graph of this function. Since the function is discontinuous, it is wise to include the option "discont = true" within our plot command.
| > | plot(f(x),x=-Pi..Pi,discont=true); |
We can work with this function just like any other function. In particular we can compute Fourier coefficients and the partial sum functions just as before. Use the formulas you already have for
,
and
. You will need to copy and execute these formulas if you ran the "restart" command. Calculate
and
and plot these partial sum functions together with
f
(
x
) over the interval [
,
].
The Most Common Maple Commands
Academic Honesty Statement:
Place the following statement (by copying and pasting) at the end of your report and sign it in ink. Your instructor will not grade your report unless this signed statement appears at the end of your report.
I understand that I may work with others if I give them credit in this statement. I also understand that I am required to write my report--that to copy all or part of someone else's report or to allow someone else to copy all or part of my report constitutes plagiarism, which is a serious violation of academic honesty.
I worked with (replace this parenthetical remark with first and last names of those with whom you worked) on this project. I wrote my own report. I did not copy any of this report from anyone else and I did not allow anyone else to copy any of this report.
Signed: