4(Fourier Series) - Lecture notes 4 PDF

Title 4(Fourier Series) - Lecture notes 4
Course Differential Equations
Institution University of Dundee
Pages 15
File Size 567.1 KB
File Type PDF
Total Downloads 76
Total Views 152

Summary

FourierSeries...


Description

Part 2: Partial Differential Equations 4

Fourier Series

4.1

Orthogonality of sine and cosine functions

Recall that two functions u(x) and v(x) are orthogonal on the interval a  x  b if Z

b

u(x)v(x) dx = 0

a

i.e. if their standard inner product is zero. ⇣ mπ x ⌘ , m = 1, 2, . . ., form a mutually orthogonal set of functions L L on the interval L  x  L. We have The functions sin

⇣ mπ x ⌘

and cos

(1)

Z

L

Z

L

cos

⇣ nπx ⌘

sin

⇣ nπx ⌘

L

−L

(2)

−L

(3)

Z

L

L

sin −L

cos

⇣ mπ x ⌘

sin

⇣ mπ x ⌘

⇣ nπx ⌘ L

L

L

cos

dx =

(

0, m 6= n L, m = n

dx =

(

0, m 6= n

⇣ mπ x ⌘ L

L, m = n

dx = 0,

8 m, n.

We show this property for the first case. The case (2)&(3) are left as an exercise (see Problem 1 in Problem Set 5). Firstly, if m = n then the integral is

Z

L 2

cos

−L

⇣ mπ x ⌘ L

✓ ◆◆L ✓ 2mπ x 1 L sin dx = dx = x+ 2mπ L 2 −L −L ✓ ✓ ◆ ◆ L L 1 1 L+ L  sin(2mπ)  sin(2mπ) = 2 2 2mπ 2mπ 1 1 (L + 0)  (L + 0) = L = 2 2 1 2

Z

L

1 + cos



2mπ x L



If m 6= n then the integral becomes

Z

L

−L

cos

⇣ nπx ⌘ L

cos

⇣ mπ x ⌘ L

dx = =

1 2

Z

L

⇣ ⇣ πx ⌘ πx ⌘ + cos (m + n) dx cos (m  n) L L −L ◆L ✓ ⇣ ⇣ 1 L L πx ⌘ πx ⌘ + =0 sin (m + n) sin (m  n) (m + n)π L L 2 (m  n)π −L

where again we have used that sin(aπ) = 0 for all a 2 Z.

38

4.2

Fourier Series of a Function

Introduction Joseph Fourier (1768-1830) postulated that a function f (x) on an interval −L < x < L could be written in the form of an infinite trigonometric series: ∞

f (x) ∼

⇣ nπx ⌘ ⇣ nπx ⌘ a0 X + bn sin an cos + L L 2 n=1

(30)

where (an ) = (a0 , a 1 , a 2 , . . . , a n , . . .) and (bn ) = (b1 , b2 , . . . , bn , . . .) are infinite sequences of constant coefficients and are related to the function f (x). In equation (30) the symbol ∼ means ‘has the Fourier Series representation’. It does not convey equality. The main questions are: 1. Given f (x) and L, how do we f ind the terms (an ) and (bn )? 2. In what sense is f (x) equal to this infinite sum? This is a question of convergence. Note: The Fourier series will not be valid for all functions f (x). Computing the Fourier coefficients Step 1: We multiply both sides of (30) by cos over −L ≤ x ≤ L.

Z

L

f (x) cos

−L

⇣ mπ x ⌘ L

Z

=

L

L

where m is a fixed positive integer and integrate

⇣ mπ x ⌘ a0 dx = cos dx + L −L 2 | {z }

Z

L

−L

= 0 since sin(mπ)=0

+

∞ X

⇣ mπ x⌘

an

n=1

= am L

Z

L

cos

| −L

Z

⇣ nπx ⌘

L

−L

cos L {z

∞ X

bn sin

n=1

⇣ mπ x ⌘ L

only non-zero for the n=m term

⇒ am

1 = L

Z

f (x) cos

an cos

n=1

⇣ nπx ⌘ L

∞ X

dx + } n=1

L −L

∞ X

bn

L

| −L

⇣ mπ x ⌘ L

Z

cos

⇣ nπx ⌘ L

cos

! ⇣ mπ x ⌘

sin

L ⇣ nπx ⌘

! ⇣ mπ x ⌘ L

dx

dx

cos L {z

(31) ⇣ mπ x ⌘ L

zero for each n in the sum

dx }

(32)

dx

Points to note: – Here we have assumed the integration may be carried out term by term in the sum, allowing us to RL R L P∞ P change the order −L n=1 → ∞ n=1 −L between lines (31) and (32). This is an assumption which turns out to be valid for Fourier series. Not all convergent series can be integrated in this way. – In line (32) we have applied the orthogonality conditions given in the previous section.

39

Step 2: Integrate (30) directly over −L ≤ x ≤ L.

Z

L

f (x) dx =

−L

Z



L

X a0 dx + an −L 2 n=1

Z

L

cos

| −L

Z

∞ X

⇣ nπx ⌘ L dx + dx bn sin L } n=1 | −L {z }

⇣ nπx ⌘ L

{z

=0 since sine is odd

=0 since sin(nπ)=0

=

⇣a

0

2

x

⌘L

= a0 L

−L

⇒ a0 =

Step 3: We multiply both sides of (30) by sin over −L ≤ x ≤ L to get bm =

1 L

Z

1 L

Z

L

f (x) dx −L

⇣ mπ x⌘ L

where m is a fixed positive integer and integrate

L

f (x) sin

−L

⇣ mπ x ⌘

dx

L

We conclude that given a function f (x) and an interval −L ≤ x ≤ L, we can compute the Fourier coefficients using these expressions and write down the Fourier series. ∞

f (x) ∼

an =

1 L

Z

L

f (x) cos

−L

⇣ nπx ⌘ L

⇣ nπx ⌘ ⇣ nπx ⌘ a0 X an cos + + bn sin 2 L L n=1 bn =

dx, n = 0, 1, 2, . . .

1 L

Z

L

f (x) sin −L

⇣ nπx ⌘ L

dx, n = 1, 2, 3 . . .

The terms ai (i = 0, 1, . . .) and bi (i = 1, 2, . . .) are called the Fourier Coefficients of f (x). The term involving a0 has been incorporated into the general expression for an since when n = 0 that integral is 1 a0 = L

Z

L

1 f (x) cos(0) dx = L −L

Z

L

f (x) dx

−L

as required. Example. Find the Fourier series representation for the function f (x) = x defined on −π ≤ x ≤ π . Solution. We use the above results to find the coefficients: a0 =

an =

1 π

Z

π

1 π

Z

π

x dx = 0

−π

x cos

−π

⇣ nπx ⌘ π

dx = 0 (since x cos(nx) is odd). ✓

◆π Z π 1 −x + cos(nx) cos(nx) dx n nπ −π π −π −π ⌘ 1⇣ π π 2(−1)n+1 1 1 2 = − cos(nπ) − cos(nπ) + 0 = − (−1)n − (−1)n = − (−1)n = n n n π n n n

1 bn = π

Z

π

x sin

⇣ nπx ⌘

1 dx = π

40

The Fourier series is therefore f (x) = x ∼ 2

∞ X (−1)n+1 n=1

n

sin(nx), x ∈ R

To consider what this Fourier series means would like to know whether the series converges and, if it does converge, what it converges to. First notice that, substituting x = π into the Fourier series we have 2

∞ X (−1)n+1 n=1

n

sin(nπ) = 2

∞ X

0=0

n=1

and so clearly the function doesn’t converge to f (x) = x. To examine how it behaves in a little more detail we show in Figure 1 some plots of a number of partial sums of the Fourier series. (Recall that Pk P the k th partial sum of the infinite series ∞ n=1 Sn is just n=1 Sn .) The figures suggest that the Fourier series in question is getting closer and closer to x on the interval −π < x < π. Additionally, each of the functions shown (i.e. each of the partial sums of the Fourier series) is periodic (repeated over the length 2π) which suggests that the Fourier series itself may also be periodic (note that the Fourier series can be defined for every x ∈ R and not just for x ∈ [−π, π]).

41

Figure 1: The 5th (upper panel) 15th (middle panel) and 50th (lower panel) partial sums of the Fourier series representation for the function f (x) = x for −π ≤ x ≤ π . The Fourier series is P (−1)n+1 sin(nx), x ∈ R. 2 ∞ n=1 n

42

Some Terminology To guarantee that the Fourier series of a function f (x) on the interval −L ≤ x ≤ L converges we must impose some conditions on the types of function allowed. Definition 4.1 (Piecewise continuity.) A function f is piecewise continuous on the interval [a, b] if there exists a finite partition of [a, b], a = x0 < x1 < x2 < · · · < x n−1 < x n = b, such that (i) f is continuous on each open subinterval (xn−1 , x n ); and (ii) At the endpoint xi of each subinterval the one-sided limits lim f (x) = f (x−i ) and lim+ f (x) = f (x+ i ) x→xi

x→xi−

both exist and are finite. A function f is piecewise continuous for all x if it is piecewise continuous for every bounded interval.

Figure 2: This function has a finite jump discontinuity at x = x0 . It is piecewise smooth. Examples: Piecewise continuity. 1. The function f (x) =

(

−1, −2 < x < 0 1, 0 : −f (−x),

if 0 < x < L, if x = 0 or x = L or x = −L, if − L < x < 0.

We define the odd periodic extension of f (x) to be the periodic extension of FO (x). Given a function f (x) on the interval 0 < x < L we define the even extension of f (x) to be (

FE (x) =

f (x), f (−x),

if 0 ≤ x ≤ L, if − L ≤ x ≤ 0,

We define the even periodic extension of f (x) to be the periodic extension of FE (x).

4.3.3

Fourier Sine Series

Suppose that the function f (x) is odd. Then computing the Fourier coefficients we obtain 1 L

Z

L

1 an = L

Z

L

1 bn = L

Z

a0 =

f (x) dx = 0 (since f (x) is odd).

L

f (x) cos

⇣ nπx ⌘

f (x) sin

⇣ nπx ⌘

L L

L

L

L

dx = 0 (since f (x) cos 2 dx = L

Z

L

f (x) sin 0

 nπx  L

⇣ nπx ⌘

is odd).

dx (since f (x) sin

L

 nπx  L

is even).

We find that the Fourier series of an odd function is an infinite series of odd functions (sines). Such a series is called a Fourier sine series: f (x) ∼

1 X

bn sin

n=1

⇣ nπx ⌘ L

where bn =

2 L

Z

L

f (x) sin 0

⇣ nπx ⌘ L

dx.

Notice that here we only need to know f (x) over half the range (0 < x < L). This observation motivates the definition of the following particular type of Fourier series. 4.3.4

Half-range Fourier Sine Series

Given any function f (x) on the interval 0 < x < L then we can define its odd extension, FO (x) and may calculate the Fourier sine series of that odd extension: FO (x) ∼

1 X

bn sin

n=1

⇣ nπx ⌘ L

where bn =

2 L

Z

L

f (x) sin

0

⇣ nπx ⌘ L

dx.

We define the half-range Fourier sine series of any function f (x) on the interval 0 < x < L to be f (x) ∼

1 X

n=1

bn sin

⇣ nπx ⌘ L

where bn =

2 L

Z

L

f (x) sin 0

⇣ nπx ⌘ L

dx.

i.e. the half-range Fourier sine series of f (x) is the Fourier sine series of the odd extension of f (x). 45

Example. Find the half-range Fourier sine series of f (x) = 100 on 0 < x < L. Solution. First, we define the odd extension, FO (x) of f (x) = 100 : 8 > < 100, FO (x) = 0, > : −100,

if 0 < x < L, if x = 0 or x = L or x = −L, if − L < x < 0.

Figure 4: Odd extension of f (x) = 100. The series (which is the Fourier series of FO (x)) in the interval −L ≤ x ≤ L) may be determined as 100 ∼

1 X

bn sin

n=1

⇣ nπx ⌘ L

where

2 bn = L

Z

L

100 sin

0

⇣ nπx ⌘ L

200 dx = L



( ⇣ nπx ⌘◆L 200 0 n even −L = cos (1 − cos(nπ)) = 400 nπ L L n odd 0 nπ

which gives 100 ∼

⇣ nπx ⌘ X 400 sin L nπ

n odd

4.3.5

Fourier Cosine Series

We have similar ideas for even functions. Suppose that the function f (x) is even. Then computing the Fourier coefficients we obtain 1 L

Z

L

1 an = L

Z

L

a0 =

f (x) dx =

L

f (x) cos L

2 L

Z

L

f (x) dx (since f (x) is even). 0

⇣ nπx ⌘ L

2 dx = L

Z

0

L

f (x) cos

⇣ nπx ⌘ L

46

dx (since f (x) cos

 nπx  L

is even).

1 Z

L

⇣ nπx ⌘

dx = 0 (since f (x) sin

 nπx 

is odd). L L L We find that the Fourier series of an even function is an infinite series of even functions (cosines).

bn =

f (x) sin

L

Such a series is called a Fourier cosine series: f (x) ∼

1 ⇣ nπx ⌘ a0 X + an cos L 2 n=1

where

an =

2 L

L

Z

f (x) cos

0

⇣ nπx ⌘ L

dx

Again notice that we only need to know f (x) on the half-range 0 ≤ x ≤ L. We may therefore also define half-range Fourier cosine series as follows. 4.3.6

Half-range Fourier Cosine Series

Given any function f (x) on the interval 0 ≤ x ≤ L then we can define its even extension, FE (x), and may calculate the Fourier cosine series of that even extension: 1

FE (x) ∼

⇣ nπx ⌘ a0 X + an cos 2 L

where

an =

n=1

2 L

L

Z

f (x) cos

0

⇣ nπx ⌘ L

dx

We define the half-range Fourier cosine series of any function f (x) on the interval 0 ≤ x ≤ L to be 1

f (x) ∼

⇣ nπx ⌘ a0 X + an cos 2 L

where

n=1

an =

2 L

Z

L

f (x) cos

0

⇣ nπx ⌘ L

dx

i.e. the half-range Fourier cosine series for f (x) is the Fourier cosine series of its even extension. Example. Find the half-range Fourier cosine series of f (x) = x on the interval 0 ≤ x ≤ L. Solution. First we define the even extension, FE (x), of f (x) = x : FE (x) =

(

x, −x,

if 0 ≤ x ≤ L, if − L ≤ x ≤ 0.

Figure 5: Even extension of f (x) = x.

47

The series (which is the Fourier series of FE (x) in the interval −L ≤ x ≤ L) may be determined as x∼

1 ⇣ nπx ⌘ a0 X + an cos 2 L n=1

where a0 =

2 L

Z

L

x dx = 0

2 L



x2 2

◆L

=L

0

and

2 an = L

Z

L

x cos 0

⇣ nπx ⌘ L

2 dx = L

✓ ✓ ⇣ nπx ⌘◆L ⇣ nπx ⌘ ⇣ nπx ⌘◆L 2 Z L L 2L L dx = cos x sin − sin L n2 π 2 nπ L L 0 0 L 0 nπ

2L 2L = 2 2 (cos(nπ) − cos(0)) = 2 2 ((−1)n − 1) = n π n π

(

0,

n even

− n4L 2 π2 ,

n odd

which gives x∼

⇣ nπx ⌘ X 4L L − cos L 2 n2 π 2 n,odd

4.4

Approximation by Finite Sums and the Gibbs Phenomenon

A practical applications of Fourier series that we consider here (in the next chapter) is in the solution of partial differential equations. It turns out that Fourier series have much wider applications and there is a large mathematical area, Fourier analysis, dedicated to their study. A particular area of application is in decomposing functions into their Fourier coefficients and the reverse process, obtaining functions from their coefficients. Just some of the applications of Fourier analysis are: acoustic signal processing; image processing; analysis of turbulence; cryptography; file compression; oceanography etc. In practice to calculate Fourier series we must approximate the series by a certain finite sum. The partial sum to N terms of a Fourier series is: N

SN (x) =

⇣ nπx ⌘ ⇣ nπx ⌘ a0 X + bn sin + an cos L 2 L n=1

The first machines to calculate a finite number of Fourier coefficients were built towards the end of the 19th century by the physicist Michelson (see Figure 10). He noticed that the calculated Fourier series behaved as expected except in cases where the function contains piecewise discontinuities. This is the behaviour seen in Figure 1 at the discontinuites, x = ±π, ±2π, . . .. Although Michelson thought that these errors arose from inaccuracies in the computing machine Gibbs pointed out (Gibbs, Nature, (1899) vol. LIX p. 606) that the overshoot is a mathematical phenomenon. (It turns out that the Gibbs’ phenomenon was first noticed and also fully explained by the English mathematician Wilbraham and published in his articla ‘On a Certain Periodic Function’, Cambridge and Dublin Mathematical Journal, (1848) vol. 3 p. 198).

48

To see what the Gibbs phenomenon is we consider the approximation of two apparently similar Fourier series by finite sums. Firstly, the Fourier series of f (x) = x,

−π ≤ x ≤ π

which we have previously found as 2

1 X (−1)n+1

sin(nx), x ∈ R

n

n=1

with partial sums TN (x) = 2

N X (−1)n+1

n

n=1

sin(nx)

Secondly the Fourier series of f (x) =

(

−x −π ≤ x ≤ 0 x 0≤x≤π

we know from our half-range Fourier cosine series example is just X 4 π cos (nx) − n2 π 2 n,odd

with partial sums RN (x) =

N X 4 π − cos (nx) 2 n2 π n,odd

The 5th, 50th, 500th and 5000th partial sums of the series TN and RN are shown in the figures on the following pages. The figures suggest that the partial sums RN converge somewhat rapidly to the expected function. On the other hand the partial sums TN converge more slowly and, in particular, do not appear to converge at the points of discontinuity, even for the large partial sum T5000 . At these points the partial sums ‘overshoot’ the function they are trying to approximate. It is this behaviour that is known as the Gibbs phenomenon.

49

Figure 6: The 5th partial sums, T5 (x) and R5 (x), are shown in red. The blue line gives the periodic extensions of the original functions. Note that the sharp blue vertical line at x = ±π in the upper f...


Similar Free PDFs