Fourier Series These summary notes should be used in conjunction with, and should not be a replacement for, your lecture notes. You should be familiar with the following definitions. • A function f is periodic with period 2L if f (x) = f (x + 2L) for all x. For example sin and cos are both periodic with period 2π. • If f is any function defined in the interval (−L, L] or [−L, L) then the 2L-periodic extension of f , denoted F , is defined by { f (x) if x ∈ (−L, L] or x ∈ [−L, L) F (x) = F (x + 2L) otherwise • f is an odd function if f (−x) = −f (x) for all x. • f is an even function if f (−x) = f (x) for all x. • 0∫ f (x) dx = 2 −n ∫ if f is odd n n f (x) dx if f is even 0 1. Full-range Fourier Series The Full-range Fourier series representation of f on (−L, L) is ∞ [ ( nπx ) ( nπx )] ∑ f (x) ∼ a0 + an cos + bn sin , L L n=1 where ∫ L 1 a0 = f (x) dx, 2L∫ −L ( nπx ) 1 L an = f (x) cos dx (n = 1, 2, 3, . . .), L ∫ −L L ( nπx ) 1 L dx (n = 1, 2, 3, . . .). bn = f (x) sin L −L L If f is 2L-periodic then the above series is a representation of f . If f is only defined on (−L, L) then the series is actually a representation of F , the 2L-periodic extension of f . Calculation of a Fourier series boils down to computing the coefficients a0 , an and bn , and a firm grasp of integration by parts is required to complete these calculations successfully. 1 Example 1 For the function defined by f (x) = x2 on the interval −2 < x < 2 sketch the 4-period extension of f and determine the Fourier coefficients. Sketch f on the interval (−2, 2) and then repeatedly shift this to the right and to the left to obtain the graph of the 4-period extension F . Figure 1: The 4-period extension of f Let’s now compute the Fourier coefficients. Note that L = 2 in this case. [ ]2 ∫ 1 2 2 1 1 3 1 4 a0 = x dx = x = (8 − (−8)) = . 4 −2 4 3 12 3 −2 an 1 = 2 1 = 2 = = = 2 x2 cos ( nπx ) −2 ([ 2 2 x sin nπ dx 2 ( nπx )]2 2 4 − nπ −2 ∫ 2 x sin −2 ( nπx ) 2 ) dx )) ([ ∫ 2 ( nπx )]2 ( nπx ) 8 8 4 2 2 sin(nπ) − sin(−nπ) − − x cos + cos dx nπ nπ nπ nπ 2 nπ −2 2 −2 )) ( ( 1 4 4 [ ( nπx ) ]2 4 4 cos(nπ) − cos(−nπ) + 2 2 sin dx 0−0− − 2 nπ nπ nπ nπ 2 −2 )) ( ( 1 4 4 4 4 (−1)n + 2 2 (sin(nπ) − sin(−nπ)) − − (−1)n − 2 nπ nπ nπ nπ ) ( 2 4 8 − − (−1)n + 2 2 (0 − 0) nπ nπ nπ 16 (−1)n . 2 2 nπ 1 = 2 = ∫ ( Note that sin(nπ) = 0 for all n ∈ Z and cos(nπ) = (−1)n for all n ∈ Z. 2 bn 1 = 2 ∫ 2 x2 sin −2 ( nπx ) 2 dx ( ) Before we dive into the integration observe that x2 defines an even function while sin nπx 2 defines an odd function. Since the product of an even and an odd function is odd, it follows that bn = 0 for all n. This simple observation saves us from having to perform a rather laborious integration. The Fourier series is given by ( nπx ) 4 16 ∑ (−1)n ( nπx ) 4 ∑ 16 n f (x) ∼ + (−1) cos = + cos . 3 n=1 n2 π 2 2 3 π 2 n=1 n2 2 ∞ ∞ Here are the graphs of the (truncated) series for N = 2, N = 11 and N = 101 terms. Notice that as N increases the series converges to the extended function. Figure 2: N = 2 Figure 3: N = 11 3 Figure 4: N = 101 Example 2 For the function defined by { x − 2 −2 < x < 0 f (x) = x+2 0<x<2 sketch the 4-period extension of f and determine the Fourier coefficients. Figure 5: The extended function a0 ∫ 1 2 f (x) dx = 4 −2 (∫ 0 ) ∫ 2 1 = (x − 2) dx + (x + 2) dx 4 −2 0 ([ ]0 [ 2 ]2 ) 1 x x2 = − 2x + + 2x 4 2 2 −2 0 1 ([0 − 6] + [6 − 0]) 4 = 0 = 4 an = = = = ∫ ( nπx ) 1 2 f (x) cos dx 2 −2 2 (∫ 0 ∫ 2 ( nπx ) ( nπx ) ) 1 dx + dx (x − 2) cos (x + 2) cos 2 2 2 −2 0 (∫ 0 ∫ 0 ∫ 2 ∫ 2 ( nπx ) ( nπx ) ( nπx ) ( nπx ) ) 1 x cos dx − 2 cos dx + x cos dx + 2 cos dx 2 2 2 2 2 −2 −2 0 0 (∫ ) [ [ ( nπx ) ( nπx )]0 ( nπx )]2 2 1 2 2 x cos +2 dx − 2 sin sin 2 2 nπ 2 nπ 2 −2 −2 0 1 (0 − 2 × 0 + 2 × 0) 2 = 0 = Note that x cos ( nπx ) 2 defines an odd function so the value of the integral between −2 and 2 is zero. bn = = = = = = = = = = ∫ ( nπx ) 1 2 f (x) sin dx 2 −2 2 (∫ 0 ∫ 2 ( nπx ) ( nπx ) ) 1 dx + dx (x − 2) sin (x + 2) sin 2 2 2 −2 0 (∫ 0 ∫ 0 ∫ 2 ∫ 2 ( nπx ) ( nπx ) ( nπx ) ( nπx ) ) 1 dx − 2 dx + dx + 2 dx x sin sin x sin sin 2 2 2 2 2 −2 −2 0 0 (∫ ) [ [ ( nπx )]0 ( nπx )]2 ( nπx ) 2 1 2 2 dx − 2 − cos +2 − cos x sin 2 2 nπ 2 nπ 2 −2 −2 0 ( ( ∫ 2 ) ( )) ) ( 2 1 nπx 2 2 2 n n dx − 2 − 2 x sin + (−1) + 2 − (−1) + 2 2 nπ nπ nπ nπ 0 ( ([ ) ) ]2 ∫ 2 ) ( ) ( nπx 4 1 2 nπx 2 4 4 4 n n cos dx + 2 − x cos + − (−1) − (−1) + 2 nπ 2 nπ 0 2 nπ nπ nπ nπ 0 ) ) ( ( [ ] ( nπx ) 2 1 4 2 2 8 8 n 2 − (−1) + sin + − (−1)n 2 nπ nπ nπ 2 nπ nπ 0 ) ( 1 8 8 8 − (−1)n − (−1)n + 2 nπ nπ nπ 4 8 − (−1)n nπ nπ 4 (1 − 2(−1)n ) nπ Note that x sin defines an even function so ∫ 2 x sin −2 ( nπx ) 2 ( nπx ) 2 ∫ 2 dx = 2 x sin 0 5 ( nπx ) 2 dx. The Fourier series is given by ∞ ( nπx ) ∑ 4 n (1 − 2(−1) ) sin . f (x) ∼ nπ 2 n=1 Here are the graphs of the series for 5, 50 and 100 terms. Figure 6: 5 terms Figure 7: 50 terms Figure 8: 100 terms 6 2. Half-range Fourier Series If a function f is defined on the interval (0, L) then the 2L-periodic extension of f can be defined to be an odd function or an even function. This then gives rise to the Half-range Fourier sine series for f and the Half-range Fourier cosine series for f , respectively. Sine Series: In this case the extended function F is defined to be an odd 2L-periodic extension of f , i.e. 0<x<L f (x) −F (−x) F (x) = F (x + 2L) The coefficients are then a0 = an = 0 for all n = 1, 2, 3, . . . and ∫ ( nπx ) 2 L bn = f (x) sin dx. L 0 L Thus f (x) ∼ ∞ ∑ bn sin ( nπx ) n=1 L . Cosine Series: In this case the extended function F is defined to be an even 2L-periodic extension of f , i.e. 0<x<L f (x) F (−x) F (x) = F (x + 2L) The coefficients are then bn = 0 for all n = 1, 2, 3, . . . and ∫ 1 L a0 = f (x) dx L 0 ∫ ( nπx ) 2 L an = f (x) cos dx. L 0 L Thus f (x) ∼ a0 + ∞ ∑ n=1 an cos ( nπx ) L . Example 3 For the function defined by f (x) = x2 on the interval (0, 2) determine the Fourier sine and cosine series. Sine series: bn = = = = ∫ ( nπx ) 2 2 2 x sin dx 2 0 2 [ ∫ 2 ( nπx )]2 ( nπx ) 4 2 2 + − x cos x cos dx nπ 2 nπ 0 2 0 ) ([ ∫ 2 ( nπx )]2 ( nπx ) 2 8 4 2 − − cos(nπ) + x sin sin dx nπ nπ nπ 2 nπ 0 2 0 ) ( 8 4 4 [ ( nπx )]2 n − (−1) + cos nπ nπ n2 π 2 2 0 7 8 16 (−1)n + 3 3 (cos(nπ) − cos(0)) nπ nπ 8 16 16 n = − (−1) + 3 3 (−1)n − 3 3 nπ nπ nπ 16 8 n n = ((−1) − 1) − (−1) . n3 π 3 nπ = − Therefore ) ∞ ( ( nπx ) ∑ 16 8 n n ((−1) − 1) − (−1) sin . F (x) = 3π3 n nπ 2 n=1 Cosine series: a0 an Hence 1 = 2 ∫ 2 [ ]2 4 1 1 3 x dx = x = . 2 3 3 0 2 0 ∫ ( nπx ) 2 2 2 = x cos dx 2 0 2 [ ∫ 2 ( nπx )]2 ( nπx ) 2 2 4 = x sin dx − x sin nπ 2 nπ 0 2 0 ) ([ ∫ 2 ( nπx )]2 ( nπx ) 4 2 2 dx = − − x cos + cos nπ nπ 2 nπ 0 2 0 ( ) 4 4 4 [ ( nπx )]2 = − − cos(nπ) − 2 2 sin nπ nπ nπ 2 0 16 = (−1)n . n2 π 2 ( nπx ) 4 16 ∑ (−1)n . F (x) = + 2 cos 3 π n=1 n2 2 ∞ 8