Fourier Series MATH 211, Calculus II J. Robert Buchanan Department of Mathematics Spring 2018
Introduction Not all functions can be represented by Taylor series. f (k) (c) A Taylor series f (x) = (x c) k is exact at x = c k! k=0 but as x moves away from c the error in the Taylor n f (k) (c) polynomial P n (x) = (x c) k grows quickly. k! k=0 Many natural phenomena are periodic and thus we may use periodic functions such as sine and cosine in infinite series.
Periodic Functions Definition A function f (x) is periodic with period T if f (x + T ) = f (x) for all x.
Periodic Functions Definition A function f (x) is periodic with period T if f (x + T ) = f (x) for all x. Example sin(k x) is periodic of period 2π k since ( [ sin k x + 2π ]) = sin (kx + 2π) = sin(k x). k Likewise cos(k x) is periodic of period 2π k.
Fourier Series Definition A Fourier Series with period 2π is an infinite series of the form a 0 2 + (a k cos(k x) + b k sin(k x)) where a k for k = 0, 1,... and b k for k = 1, 2,... are constants.
Fourier Series Definition A Fourier Series with period 2π is an infinite series of the form a 0 2 + (a k cos(k x) + b k sin(k x)) where a k for k = 0, 1,... and b k for k = 1, 2,... are constants. Questions: Which functions can be represented by Fourier series? How do we calculate the coefficients (a k and b k ) of the series? Does the Fourier series converge? If the series converges, to what function?
Answers Suppose the Fourier series converges for x π then f (x) = a 0 2 + (a k cos(kx) + b k sin(kx)) and f (x) must be 2π-periodic for all x. 10 y 8 6 4 2-3 π -2 π -π π 2 π 3 π x
Calculating the Coefficients (1 of 6) Suppose f (x) = a 0 2 + (a k cos(k x) + b k sin(k x)) Since a 0 appears outside of the infinite series, we will find it first.
Calculating the Coefficients (1 of 6) Suppose f (x) = a 0 2 + (a k cos(k x) + b k sin(k x)) Since a 0 appears outside of the infinite series, we will find it first. Integrate both sides of the equation on [, π]. f (x) dx = a 0 2 dx + (a k cos(k x) dx + b k ) sin(k x) dx
Calculating the Coefficients (2 of 6) Note: a 0 2 dx = a 0π cos(k x) dx = 0 sin(k x) dx = 0
Calculating the Coefficients (2 of 6) Note: a 0 2 dx = a 0π cos(k x) dx = 0 sin(k x) dx = 0 Thus f (x) dx = a 0 π a 0 = 1 π f (x) dx
Calculating the Coefficients (3 of 6) To calculate a n for n = 1, 2,..., multiply both sides of the Fourier series by cos(n x) and integrate over [, π]. = f (x) cos(n x) dx a 0 cos(n x) dx 2 + (a k cos(k x) cos(n x) dx + b k ) sin(k x) cos(n x) dx
Calculating the Coefficients (3 of 6) To calculate a n for n = 1, 2,..., multiply both sides of the Fourier series by cos(n x) and integrate over [, π]. = f (x) cos(n x) dx a 0 cos(n x) dx 2 + (a k cos(k x) cos(n x) dx + b k ) sin(k x) cos(n x) dx Two new types of definite integral appear on the right hand side of the equation. cos(k x) cos(n x) dx and sin(k x) cos(n x) dx We should evaluate them first.
Product-to-Sum Formulas We will need the trigonometric identities: cos(k x) cos(n x) = 1 (cos(n + k)x + cos(n k)x) 2 sin(k x) cos(n x) = 1 (sin(n + k)x sin(n k)x) 2 Proof. cos(n + k)x + cos(n k)x = cos(n x) cos(k x) sin(n x) sin(k x) + cos(n x) cos(k x) + sin(n x) sin(k x) = 2 cos(n x) cos(k x) sin(n + k)x sin(n k)x = sin(n x) cos(k x) + cos(n x) sin(k x) sin(n x) cos(k x) + cos(n x) sin(k x) = 2 cos(n x) sin(k x)
cos(k x) cos(n x) dx cos(k x) cos(n x) dx = 1 cos(n k)x + cos(n + k)x dx 2 = 1 [ ] sin(n k)x sin(n + k)x x=π + 2 n k n + k x= = 0 if n k. cos(n x) cos(n x) dx = cos(k x) cos(n x) dx = = 1 2 = 1 2 = π cos 2 (n x) dx (1 + cos(2n x)) dx [ x + 1 sin(2n x) 2n { 0 if n k, π if n = k. ] x=π x=
sin(kx) cos(nx) dx sin(k x) cos(n x) dx = 1 sin(n + k)x sin(n k)x dx 2 = 1 [ ] cos(n + k)x cos(n k)x x=π + 2 n + k n k x= = 0 if n k sin(n x) cos(n x) dx = 1 sin(2n x) dx 2 [ cos(2n x) ] x=π = 1 2 = 0 2n x=
Calculating the Coefficients (4 of 6) Now if = f (x) cos(n x) dx a 0 cos(n x) dx 2 + (a k cos(k x) cos(n x) dx + b k ) sin(k x) cos(n x) dx then f (x) cos(n x) dx = a n cos 2 (n x) dx = a n π a n = 1 π f (x) cos(n x) dx.
Calculating the Coefficients (5 of 6) To calculate b n for n = 1, 2,... multiply both sides of the Fourier series by sin(nx) and integrate over [, π]. = f (x) sin(n x) dx a 0 sin(n x) dx 2 + (a k cos(k x) sin(n x) dx + b k ) sin(k x) sin(n x) dx
Calculating the Coefficients (5 of 6) To calculate b n for n = 1, 2,... multiply both sides of the Fourier series by sin(nx) and integrate over [, π]. = f (x) sin(n x) dx a 0 sin(n x) dx 2 + (a k cos(k x) sin(n x) dx + b k ) sin(k x) sin(n x) dx One new type of definite integral appears on the right hand side of the equation. We should evaluate it first. sin(k x) sin(n x) dx
Product-to-Sum Formulas We will need the trigonometric identity: sin(k x) sin(n x) = 1 (cos(n k)x cos(n + k)x) 2 Proof. cos(n k)x cos(n + k)x = cos(n x) cos(k x) + sin(n x) sin(k x) cos(n x) cos(k x) + sin(n x) sin(k x) = 2 sin(n x) sin(k x)
sin(kx) sin(nx) dx sin(k x) sin(n x) dx = 1 cos(n k)x cos(n + k)x dx 2 = 1 [ ] sin(n k)x sin(n + k)x x=π 2 n k n + k x= = 0 if n k sin(n x) sin(n x) dx = sin(k x) sin(n x) dx = = 1 2 = 1 2 = π sin 2 (n x) dx (1 cos(2n x)) dx [ x + 1 sin(2n x) 2n { 0 if n k, π if n = k. ] x=π x=
Calculating the Coefficients (6 of 6) Now if = f (x) sin(n x) dx a 0 sin(n x) dx 2 + (a k cos(k x) sin(n x) dx + b k ) sin(k x) sin(n x) dx then f (x) sin(n x) dx = b n sin 2 (n x) dx = b n π b n = 1 π f (x) sin(n x) dx.
Euler-Fourier Formulas To summarize, the coefficients of the Fourier series for a 2π-periodic function f (x) are: a 0 = 1 π a k = 1 π b k = 1 π f (x) dx f (x) cos(k x) dx (k = 1, 2,...) f (x) sin(k x) dx (k = 1, 2,...)
Example Find the Fourier series representation of the 2π-periodic extension of the function { 0 if < x < 0 f (x) = 1 if 0 < x < π. 1.0 y 0.8 0.6 0.4 0.2-2 π -π π 2 π x
Solution a 0 = 1 π a k = 1 π f (x) dx = 1 π f (x) cos(k x) dx = 1 π 0 (1) dx = 1 0 (1) cos(k x) dx = 0 b k = 1 f (x) sin(k x) dx = 1 (1) sin(k x) dx π π 0 = 1 [ ] cos(k x) x=π = 1 π k k π (1 cos(kπ)) = (1 ( 1)k ) k π x=0
Partial Sums f (x) = 1 2 + y (1 ( 1) k ) πk sin(k x) y 1.0 1.0 0.8 0.8 0.6 0.6 0.4 0.4 0.2 0.2-2 π -π π 2 π x -2 π -π π 2 π x n = 5 n = 10 y y 1.0 1.0 0.8 0.8 0.6 0.6 0.4 0.4 0.2 0.2-2 π -π π 2 π x -2 π -π π 2 π x n = 50 n = 100
Example Find the Fourier series representation of the 2π-periodic extension of the function { 0 if < x < 0 f (x) = π x if 0 < x < π. y 3.0 2.5 2.0 1.5 1.0 0.5-3 π -2 π -π π 2 π 3 π x
Solution [πx x 2 ] x=π a 0 = 1 π a k = 1 π = 1 kπ 0 f (x) dx = 1 π f (x) cos(k x) dx = 1 π 0 sin(k x) dx = 1 k 2 π (π x) dx = 1 π 0 2 (π x) cos(k x) dx x=0 = π 2 [ cos(k x)]x=π x=0 = (1 ( 1)k ) k 2 π b k = 1 f (x) sin(k x) dx = 1 (π x) sin(k x) dx π π 0 = 1 ([ ] (π x) cos(k x) x=π + 1 ) cos(k x) dx = 1 π k x=0 k 0 k
Solution f (x) = π 4 + y ( (1 ( 1) k ) πk 2 cos(k x) + 1 ) sin(k x) k y 3.0 3.0 2.5 2.5 2.0 2.0 1.5 1.5 1.0 1.0 0.5-3 π -2 π -π π 2 π 3 π x 0.5-3 π -2 π -π π 2 π 3 π x n = 5 n = 10 y y 3 3 2 2 1 1-3 π -2 π -π π 2 π 3 π x -3 π -2 π -π π 2 π 3 π x n = 50 n = 100
Functions of Period T 2π If f is a function of period T = 2L > 0 then the Fourier series for f is a 0 2 + [ ( ) ( )] kπx kπx a k cos + b k sin L L where a 0 = 1 L a k = 1 L b k = 1 L L L L L L L f (x) dx ( ) kπx f (x) cos dx (k = 1, 2,...) L ( ) kπx f (x) sin dx (k = 1, 2,...) L
Convergence of Fourier Series Theorem If f is 2L-periodic and f and f are continuous on [ L, L] except for at most a finite number of jump discontinuities, then f has a convergent Fourier series expansion. f (x) = a 0 2 + [ a k cos ( kπx L ) ( kπx + b k sin L The series converges to f (c) if f is continuous at x = c. If f has a jump discontinuity at x = c then the series converges to ( ) 1 lim f (x) + lim 2 f (x). x c x c + )]
Example Find the Fourier series representation of the 2-periodic extension of the function f (x) = x. 1.0 y 0.8 0.6 0.4 0.2-3 -2-1 1 2 3 x
Solution a 0 = a k = b k = 1 1 1 = 2 k π f (x) dx = 2 1 1 1 1 1 f (x) cos(kπx) dx = 2 0 0 [ x 2 x dx = 2 2 1 0 ] x=1 x=0 = 1 x cos(k πx) dx sin(kπx) dx = 2 k 2 π 2 [cos(kπx)]x=1 x=0 = 2(( 1)k 1) k 2 π 2 f (x) sin(kπx) dx = 0
Solution f (x) = x = 1 2 + y 2(( 1) k 1) π 2 k 2 cos(kπx) y 1.0 1.0 0.8 0.8 0.6 0.6 0.4 0.4 0.2 0.2 x -3-2 -1 1 2 3-3 -2-1 1 2 3 n = 5 n = 10 y y x 1.0 1.0 0.8 0.8 0.6 0.6 0.4 0.4 0.2 0.2 x -3-2 -1 1 2 3-3 -2-1 1 2 3 n = 50 n = 100 x
Example Find the Fourier series representation of the 2-periodic extension of the function f (x) = x 2. Use the series and the Fourier Convergence Theorem to find the sums: 1 k 2 and 1.0 y ( 1) k k 2. 0.8 0.6 0.4 0.2-3 -2-1 1 2 3 x
Solution (1 of 3) a 0 = a k = 1 1 1 = 4 kπ = 4 kπ = b k = x 2 dx = 2 1 1 1 x 2 cos(kπx) dx = 2 0 ( [ x 0 x sin(k πx) dx kπ cos(kπx) [ x x 2 3 dx = 2 3 ] x=1 x=0 4 4( 1)k k 2 cos(kπ) = π2 k 2 π 2 1 1 x 2 sin(kπx) dx = 0 1 0 ] x=1 x=0 = 2 3 x 2 cos(kπx) dx ) 1 1 + cos(kπx) dx 0 kπ
Solution (2 of 3) x 2 = 1 3 + 4( 1) k k 2 π 2 cos(kπx) = 1 3 + 4 π 2 ( 1) k cos(kπx) k 2
Solution (2 of 3) x 2 = 1 3 + 4( 1) k k 2 π 2 cos(kπx) = 1 3 + 4 π 2 ( 1) k k 2 cos(kπx) Let x = 0, then (0) 2 = 1 3 + 4 ( 1) k π 2 2 12 k 2 0 = 1 3 + 4 ( 1) k π 2 = ( 1) k k 2. k 2 cos(kπ(0))
Solution (3 of 3) x 2 = 1 3 + 4 π 2 Let x = 1, then ( 1) k k 2 cos(kπx) (1) 2 = 1 3 + 4 ( 1) k π 2 cos(kπ(1)) k 2 1 = 1 3 + 4 ( 1) k π 2 ( 1) k π 2 6 = 1 k 2. k 2
Other Sums (1 of 2) x = 1 2 + 2 π 2 0 = 1 2 + 2 π 2 π 2 8 0 = 1 2 + 2 π 2 0 = 1 2 + 2 π 2 = 1 (2k 1) 2 (( 1) k 1) k 2 (( 1) k 1) k 2 (( 1) k 1) k 2 2 (2k 1) 2 cos(kπx) cos(kπ(0))
Other Sums (2 of 2) f (x) = { 0 if < x < 0 1 if 0 < x < π. = 1 2 + (1 ( 1) k ) sin(k x) kπ = 1 2 + 2 1 sin((2k 1)x) π 2k 1 f (π/2) = 1 2 + 2 ( ) 1 (2k 1)π π 2k 1 sin 2 1 = 1 2 + 2 ( 1) k+1 π 2k 1 π 4 = ( 1) k+1 2k 1