Physics and Electronics
PHYC20014 Physical Systems
Wave Theory and Fourier Analysis: Tutorial 1
Tutorial problems
1. Basic Fourier series. We start with some “get to know you” exercises. Sketch the periodic extension of these functions and calculate their Fourier series.
(a) The square wave ⇧ : (�⇡, ⇡] ! R:
⇧(✓) =
8 ><
>:
+1 ✓ > 0
0 ✓ = 0
�1 ✓ < 0.
(b) The triangle wave � : (�⇡, ⇡] ! R:
�(✓) = ⇡ � |✓|.
2. Derivatives. Check that (where di↵erentiable) �0 = �⇧. Di↵erentiating term-by-term, verify this relation also holds for the associated Fourier series.
3. Sine, cosine and half-range. An odd function has the property that f(�✓) = �f(✓), while an even function satisfies f(�✓) = f(✓).
(a) Show that for odd (even) functions, the Fourier coe�cients a n
(b
n
) vanish. Since the
cosine terms vanish, an odd function has a sine series, and similarly, an even function
has a cosine series.
(b) Prove that you can uniquely split an arbitrary function f into odd and even parts:
f(✓) = f+(✓) + f�(✓), f±(�✓) = ±f±(✓).
Thus, the Fourier series for f splits into a cosine series for f+ and a sine series for f�.
(c) Recall from lectures that the half-range expansion of a function is a Fourier series valid
over [0, L]. We can use either a cosine series (a
n
terms) or sine series (b
n
terms). Find
both half-range expansions for f(✓) = e
✓ � 1 on [0, ⇡], and comment on the di↵erence.
4. Dirac comb. The Dirac delta function �(t) models an infinitely strong point impulse, and is defined by the “sifting” property
Z 1
�1 �(t)f(t) dx = f(0).
The Dirac comb X T
is a periodically repeating version with period T :
X T
(✓) ⌘ 1X
k=�1 �(✓ � kT).
(a) For X T
, derive the Fourier series representation
X T
(✓) =
1
T
1X
n=�1 e
i!n✓
, ! ⌘ 2⇡
T
.
(b) *Check that the series representation of X T
(✓) blows up at multiples of T . Show that,
at other points, we get infinitely fast oscillations.
1
5. Numerical series. Evaluating a Fourier series at a well-chosen point sometimes yields nontrivial mathematical results. Earlier, you should have found that ⇧(✓) has the Fourier series
⇧(✓) = 1X
n=0
4
(2n + 1)⇡
sin[(2n + 1)✓].
By wisely choosing a point to evaluate both sides, prove Leibniz’s formula for ⇡:
⇡
4
=
1X
n=0
(�1)n
2n + 1
= 1 � 1
3
+
1
5
� 1
7
+ . . .
Extra problems
6. Exponential Fourier series. For a function with period T , we usually write
f(✓) =
a0
2
+
1X
n=1
a
n
cos (!n✓) + b
n
sin (!n✓)
� , ! =
2⇡
T
.
Recall from lectures that we can write the same series using complex exponentials:
f(✓) =
1X
n=�1 c
n
e
in!✓
.
Determine the relationship between c
n
and the a
n
, b
n
for a real function.
7. Chebyshev polynomials. You may recall de Moivre’s theorem from high school:
(cos ✓ + i sin ✓)
n
= cos(n✓) + i sin(n✓).
Expand the LHS and take the real part of both sides. You will get some linear combination
of products of powers of cos ✓ and even powers of sin ✓; converting the latter to cosines using
sin
2 ✓ = 1 � cos2 ✓, the end result is an expression for cos(n✓) which is a polynomial in cos ✓:
cos(n✓) ⌘ T n
(cos ✓), n = 0, 1, 2, . . .
The polynomials T
n
are called Chebyshev polynomials. Since T
n
(cos ✓) = cos(n✓), Chebyshev
polynomials are related to cosine series (Problem 4). Making the change of variable x = cos ✓,
use results about Fourier series to show that
Z 1
�1
T
m
(x)T
n
(x)
p 1 � x2
dx =
8 ><
>:
⇡
2 m = n and m, n � 1, ⇡ m = n = 0,
0 else.
1 These infinite oscillations vanish in the sense of generalised functions. Understanding what this means rigorously
is beyond the scope of the course.
8. The Gibbs phenomenon. Note: This problem requires a computer. Any finite sum of trigonometric functions is continuous. Thus, any partial sum in the Fourier series for a
discontinuous function is fundamentally di↵erent from the function that it represents. This leads to some rather strange behaviour in the convergence of Fourier series, as we’ll now see.
(a) Recall that the Fourier series for ⇧(✓) is
⇧(✓) = 1X
n=1
4
(2n � 1)⇡ sin[(2n � 1)✓].
Define the partial Fourier series
⇧ N
(✓) ⌘ NX
n=1
(�1)n
2n � 1 sin[(2n � 1)✓].
Using a computer, plot ⇧ N
for N = 5, 10, 50, 100.
(b) You should observe an “overshoot” in ⇧ N
at the discontinuities of ⇧. This is called the Gibbs phenomenon. Does the size of the overshoot appear to change with N? Estimate
how large it is compared to the underlying discontinuity. (You should find that the jump
is ⇠ 8.95% the size of the discontinuity.) (c) We can try to eliminate the Gibbs phenomenon as follows. Define the �-approximated
series for a function f as
f
k
N
(✓) ⌘ a0
2
+
NX
n=1
sinc
⇣ n
N
⌘ k
a
n
cos (!n✓) + b
n
sin (!n✓)
� ,
where ! ⌘ 2⇡/T as usual, and
sinc(x) ⌘ sin(⇡x)
⇡x
.
Play around with di↵erent values of N and k (using your own code or gibbs.nb) and see what happens. What is the tradeo↵ for suppressing the overshoot?
9. The Basel problem. The triangle wave �(✓) from 1(b) has Fourier series
�(✓) = ⇡
2
+
1X
n=1
4
(2n � 1)2⇡ cos [(2n � 1)✓] .
(a) By a judicious selection of ✓, show that
1X
n=1
1
(2n � 1)2 =
⇡
2
8
.
(b) Let B denote the sum of reciprocal squares,
B ⌘ 1X
n=0
1
n
2 .
Determining B is called the Basel problem, and was first posed by in 1644. It took
almost 100 years and the genius of Leonard Euler (1707–1783) to solve it. Show that
B =
1
4
B +
1X
n=0
1
(2n + 1)
2 ,
and use your result from (a) to conclude that
1X
n=1
1
n
2 =
⇡
2
6
.
10. Harmonic symmetry.* We can generalise the decomposition into odd and even parts (Prob- lem 3) as follows. Consider a complex map f : C ! C, and fix a natural number n. Let ! ⌘ e2⇡i/n be an n-th root of unity, so that !n = 1. Define
f
j
(z) ⌘ 1
n
n�1X
k=0
f(!
k
z)!
�jk .
(a) Show that f
j
(!
m
z) = !
jm
f
j
(z), and that
f(z) =
n�1X
j=0
f
j
(z).
Hint. Recall the formula for geometric sums,
n�1X
j=0
!
�jk =
1 � !�kn
1 � !�k , k 6= 0.
(b) Check that setting n = 2 reproduces the results in Problem 3(b).
PHYC20014 Physical Systems
Wave Theory and Fourier Analysis: Tutorial 1
Solutions
1. Basic Fourier series. We use the usual formulas:
a
n
=
1
L
Z L
�L cos
✓ ⇡n✓
L
◆ f(✓) d✓, b
n
=
1
L
Z L
�L sin
✓ ⇡n✓
L
◆ f(✓) d✓,
setting L = ⇡. We also exploit the results of Problem 4.
(a) First, let’s graph the periodic extension:
-3 π -2 π -π π 2 π 3 π
-1
1
For the square wave, the a
n
vanish by symmetry (see Problem 4). The remaining sine
terms are given by
b
n
=
1
⇡
Z ⇡
�⇡ sin (n✓) ⇧(✓) d✓
=
2
⇡
Z ⇡
0 sin (n✓) d✓
= � 2
n⇡
cos(n✓)
� ⇡
0
=
4
n⇡
[1 � (�1)n] = ( 4/n⇡ n odd
0 n even.
Hence, the Fourier series for the periodic extension of ⇧ is
⇧(✓) = 1X
n=1
b
n
sin (n✓) =
1X
n=0
4
(2n + 1)⇡
sin[(2n + 1)✓].
(b) We begin with a graph:
-3 π -2 π -π π 2 π 3 π
π
For the triangle wave, the b
n
vanish by symmetry (see Problem 4). From geometry, the
area under the curve a0 = ⇡. This leaves
a
n
=
1
⇡
Z ⇡
�⇡ cos (n✓) �(✓) d✓
=
2
⇡
Z ⇡
0 cos (n✓) (⇡ � ✓) d✓
=
2
n⇡
sin(n✓)(⇡ � ✓)
� ⇡
0
+
2
n⇡
Z ⇡
0 sin (n✓) d✓
= � 2
n
2 ⇡
cos(n✓)
� ⇡
0
=
( 4/n
2 ⇡ n odd
0 n even.
Hence, the Fourier series for the periodic extension of � is
�(✓) = a0
2
+
1X
n=1
a
n
cos (n✓) =
⇡
2
+
1X
n=1
4
(2n � 1)2⇡ cos[(2n � 1)✓].
2. Derivatives. On (�⇡, ⇡], �(✓) = ⇡ � |✓|, and hence
�0(✓) =
( +1 �⇡ < ✓ < 0 �1 0 < ✓ < ⇡.
Hence, �0 = �⇧ on (�⇡, 0)[(0, ⇡). This also clearly holds for the periodic extensions, except at multiples of ⇡ where � is not di↵erentiable. Now we di↵erentiate the Fourier series for �:
d
d✓
" ⇡
2
+
1X
n=1
4
(2n � 1)2⇡ cos[(2n � 1)✓]
# = �
1X
n=1
4
(2n � 1)⇡ sin[(2n � 1)✓],
which is indeed the Fourier series for �⇧.
3. Sine, cosine and half-range.
(a) For an odd function, we split the integral in two and make a change of variable ✓ ! �✓ in the second part:
a
n
=
1
L
Z L
�L cos
✓ ⇡n✓
L
◆ f(✓) d✓
=
1
L
Z L
0 cos
✓ ⇡n✓
L
◆ f(✓) d✓ +
1
L
Z 0
�L cos
✓ ⇡n✓
L
◆ f(✓) d✓
=
1
L
Z L
0 cos
✓ ⇡n✓
L
◆ f(✓) d✓ �
1
L
Z L
0 cos
✓ ⇡n✓
L
◆ f(✓) d✓ = 0.
Note that, in the last line, we have two sign changes which cancel — one from the fact
that f is odd, and the other from flipping the integration limits. This derivation works
for all n � 0. The proof that b n
vanishes for even f is analogous.
(b) One approach is to work backwards. Suppose we can decompose f = f+ + f� into odd and even parts. Then
f(�✓) = f+(�✓) + f�(�✓) = f+(✓) � f�(✓).
We combine this with the expression for f(✓) to get
f+(✓) = 1
2
[f(✓) + f(�✓)], f�(✓) = 1
2
[f(✓) � f(�✓)].
It is an easy exercise to check that these expressions are, in fact, even and odd.
(c) We can use a neat trick from first-year calculus to calculate sine and cosine coe�cients at the same time. First, do the exponential integral
C
n
⌘ 2
⇡
Z ⇡
0 f(✓)e
in✓
d✓
=
2
⇡
Z ⇡
0 (e
✓ � 1)ein✓ d✓
=
2
⇡
" e
(in+1)✓
1 + in
� e
in✓
in
# ⇡
0
=
2
⇡
(�1)ne⇡ � 1
1 + in
+ i
(�1)n � 1 n
� =
2
⇡
(�1)ne⇡ � 1
1 + n
2 � i(�1)n
e
⇡ � 1 n
� .
Since e
in✓
= cos(n✓) + i sin(n✓), we immediately have C
n
= a
n
+ ib
n
, or
a
n
=
2[(�1)ne⇡ � 1] ⇡(1 + n
2 )
, b
n
=
2(�1)n+1(e⇡ � 1) ⇡n
.
These look very di↵erent! The cosine series has coe�cients / 1/n2, and the sine series has coe�cients / 1/n. Ultimately, this is due to the fact that the even extension of f is continuous, while the odd extension has a discontinuity.
4. Dirac comb.
(a) We can regard X T
as a periodic extension of �(x) with period T ⌘ 2L. Thus, we can represent it as a Fourier series on the domain (�L, L]. Using the sifting property, the coe�cients of the exponential Fourier series are
c
n
=
1
T
Z L
�L �(✓)e
�i!n✓ d✓ =
1
T
.
Thus,
X T
(x) =
1X
n=�1 c
n
e
i!nx
=
1
T
1X
n=�1 e
i!nx
.
(b) We can split the exponential Fourier series as follows:
X T
(x) =
1
T
1X
n=0
e
i!nx
+
1
T
1X
n=1
e
�i!nx .
If x = Tk for some integer k, then
e
i!nx
= e
i!nkT
= e
i2⇡nk = 1 = e
�i!nx .
Thus, each term in the series above equals 1 and it diverges to +1. For other values of x, we can try to evaluate use a geometric series and see what happens:
X T
(x) =
1
T
1X
n=0
e
i!nx
+
1
T
1X
n=1
e
�i!nx
=
1
T
lim
N!1
" N�1X
n=1
e
i!nx
+
1
T
N�1X
n=1
e
�i!nx
#
=
1
T
lim
N!1
1 � ei!Nx
1 � ei!x +
e
�i!x (1 � e�i!Nx) 1 � e�i!x
�
=
1
T
lim
N!1
1 � ei!Nx
1 � ei!x �
1 � e�i!Nx
1 � ei!x
�
=
2i
T(e
i!x � 1) lim
N!1 sin(!Nx).
This is not well-defined! The sine term just oscillates faster and faster as N ! 1. However, there is a sense in which these infinitely oscillating functions vanish, connected
to generalised functions like the Dirac delta. It is beyond the scope of the course, but
look up the Riemann-Lebesgue lemma if you’re interested.
5. Numerical series. The general idea is to pick somewhere the sine terms are easy to evaluate but nonzero. So, let’s try ✓ = ⇡/2. Then ⇧(✓/2) = 1, and the Fourier series is
1X
n=0
4
(2n + 1)⇡
sin[(2n + 1)⇡/2] =
4
⇡
1X
n=0
(�1)n
2n + 1
.
Equating the two gives
1 =
4
⇡
1X
n=0
(�1)n
2n + 1
,
which is equivalent to Leibniz’s formula.
6. Exponential Fourier series. Expanding the exponential series using Euler’s formula,
f(✓) =
1X
n=�1 c
n
e
in!✓
=
1X
n=�1 c
n
cos (n!✓) + i sin (n!✓)
�
= c0 +
1X
n=1
(c
n
+ c�n) cos (n!✓) + i(cn � c�n) sin (n!✓) � .
Equating coe�cients, we see that
a0 = 2c0, an = cn + c�n, bn = i(cn � c�n).
Equivalently, c±n = (an ⌥ ibn)/2. It is no accident that cn = c⇤�n; this is called the reality condition, and is equivalent to the Fourier series being real.
7. Chebyshev polynomials. We follow the instructions:
Z 1
�1
T
m
(x)T
n
(x)
p 1 � x2
dx = � Z 0
⇡
T
m
(cos ✓)T
n
(cos ✓)
sin ✓
(� sin ✓ d✓)
=
Z ⇡
0 cos(n✓) cos(m✓) d✓.
At this point, we remember that we have already done these integrals for Fourier series! In
fact, the standard orthogonality results give
Z ⇡
0 cos(n✓) cos(m✓) d✓ =
8 ><
>:
⇡
2 m = n and m, n � 1, ⇡ m = n = 0,
0 else.
8. The Gibbs phenomenon. See gibbs.nb.
9. The Basel problem.
(a) We pick ✓ = 0, since both sides will be nonzero and easy to evaluate:
�(0) = ⇡
2
+
1X
n=0
4
(2n + 1)
2 ⇡
.
Since �(0) = ⇡, we can rearrange to find
1X
n=0
1
(2n + 1)
2 =
⇡
2
8
.
(b) We separate the series B into even and odd terms:
B =
1X
n=1
1
n
2 =
1X
n=1
1
(2n)
2 +
1X
n=0
1
(2n + 1)
2
=
1X
n=1
1
(2n)
2 +
1X
n=0
1
(2n + 1)
2 =
1
4
B +
1X
n=0
1
(2n + 1)
2 .
Hence,
3
4
B =
1X
n=0
1
(2n + 1)
2 =) B =
4
3
1X
n=0
1
(2n + 1)
2 =
⇡
2
6
.
10. Harmonic symmetry.*
(a) We simply compute:
f
j
(!
m
z) =
1
n
n�1X
k=0
f(!
k+m z)!
�jk
=
1
n
n�1X
k=0
f(!
k
z)!
�j(k�m)
= !
jm
1
n
n�1X
k=0
f(!
k
z)!
�jk = !
jm
f
j
(z).
On the second line, we relabelled the dummy index k ! k+m, using the n-fold symmetry of the sum over roots of unity. Similarly, we can swap the order of the finite sums over
j and k, and use the formula for geometric sums, to get
n�1X
j=0
f
j
(z) =
n�1X
j=0
1
n
n�1X
k=0
f(!
k
z)!
�jk
=
1
n
n�1X
k=0
f(!
k
z)
n�1X
j=0
!
�jk
=
1
n
· nf(z) + 1
n
n�1X
k=1
f(!
k
z)
1 � !�kn
1 � !�k = f(z).
In the last step, we used the fact that !
�kn = (!
n
)
�k = 1. Hence,
f(z) =
n�1X
j=0
f
j
(z).
(b) Setting n = 2, we note that the second roots of unity are just ±1. The results in (a) become
f±(z) = 1
2
(f(z) ± f(�z)), f(z) = f+(z) + f�(z).
This is exactly what we found (albeit for real functions) in Problem 3(b).