November 29, 2010 22-1 22. Periodic Functions and Fourier Series 1 Periodic Functions A real-valued function f (x) of a real variable is called periodic of period T > 0 if f (x + T ) = f (x) for all x ∈ R. For instance the functions sin(x), cos(x) are periodic of period 2π. It is also periodic of period 2nπ, for any positive integer n. So, there may be infinitely many periods. If needed we may specify the least period as the number T > 0 such that f (x + T ) = f (x) for all x, but f (x + s) 6= f (x) for 0 < s < T . For later convenience, let us consider piecewise C 1 functions f (x) which are periodic of period 2L > 0 where L is a positive real number. Denote this class of functions by P erL(R). nπx Note that for each integer n, the functions cos( nπx L ), sin( L ) are in examples of such functions. Also, note that if f (x), g(x) ∈ P erL(R), and α, β are constants, then αf + βg is also in P erL(R). In particular, any finite sum k a0 mπx mπx ! X + am cos( ) + bm sin( ) 2 m=1 L L is in P erL(R). Here the numbers a0, am, bm are constants. November 29, 2010 2 22-2 Fourier Series The next result shows that in many cases the infinite sum ∞ a0 mπx mπx ! X f (x) = + am cos( ) + bm sin( ) (1) 2 m=1 L L determines a well-defined function f (x) which again is in P erL(R). An infinite sum as in formula (1) is called a Fourier series (after the French engineer Fourier who first considered properties of these series). Fourier Convergence Theorem. Let f (x) be a piecewise C 1 function in P erL(R). Then, there are constants a0, am, bm (uniquely defined by f ) such that at each point of continuity of f (x) the expression on the right side of (1) converges to f (x). At the points y of discontinuity of f (x), the series converges to 1 (f (y−) + f (y+)). 2 The values f (y−), f (y+) denote the left and right limits of f as x → y, respectively. That is, f (y−) = limx→y,x<y f (x), f (y+) = limx→y,x>y f (x). November 29, 2010 22-3 It turns out that the constants a0, am, bm above are determined by the formulas 1 ZL a0 = f (x)dx (2) L −L mπx 1 ZL f (x) cos( am = )dx, and (3) L −L L 1 ZL mπx bm = )dx. (4) f (x) sin( L −L L We will justify this a bit later, but for now, let us use these formulas to compute some Fourier series. The constants a−, am, bm are called the Fourier coefficients of f . Example 1. Let f (x) be defined by −x, −2 ≤ x < 0 f (x) = x, 0≤x<2 f (x + 4) = f (x) for all x. Determine the Fourier coefficients of f . Note that the graph of this function f (x) looks like a “triangular wave.” Here L = 2, and we compute 1Z2 1Z0 a0 = (−x)dx + 0 xdx 2 −2 2 = 1 + 1 = 2, November 29, 2010 22-4 and, for m > 0, 1Z0 mπx mπx 1Z2 am = (−x) cos( x cos( )dx + )dx 2 −2 2 2 0 2 mπx mπx 1Z2 1Z0 (−x) sin( x sin( )dx + )dx. bm = 2 −2 2 2 0 2 To compute these integrals, we note that, integration by parts gives the formulas Z sin(ax) x sin(ax) − dx a a x cos(ax) = sin(ax) + a a2 Z sin(ax) x x sin(ax)dx = − cos(ax) + a a2 Let us compute am. First note that the integrand mπx ) h(x) = f (x)cos( 2 Z x cos(ax)dx = (5) satisfies h(−x) = h(x). Hence, the two integrals are equal and Z 2 Z 2 mπx mπx am = 2(1/2) 0 x cos( )dx = 0 x cos( )dx 2 2 Using the formula for (5) above, we get November 29, 2010 22-5 mπx )dx 0 2 2 2 mπx mπx 2 2 x sin( cos( )+ ) = mπ 2 mπ 2 0 4 = 0 + 2 2 (cos(mπ) − 1) mπ 8 − , m odd (mπ)2 = 0, m even am = Z 2 x cos( A similar calculation shows that bm = 0 for all m. We will see later that this last fact follows from the fact that f (−x) = f (x) for all x. Example 2. Let f (x) be defined by 0, f (x) = 1, 0, −3 < x < −1, −1 < x < 1, 1<x<3 f (x + 6) = f (x) for all x. Find the Fourier series for f . Here L = 3, and we compute 1Z3 f (x)dx 3 −3 1Z1 = f (x)dx 3 −1 a0 = November 29, 2010 22-6 = 2 3 For m > 0, we have an bn = = = = 3 1Z1 nπx = cos( )dx −1 3 3 1 nπx 1 ) = sin( nπ 3 −1 nπ 2 sin( ) = nπ 3 1Z1 nπx sin( )dx 3 −1 3 1 1 nπx − cos( ) nπ 3 −1 1 nπ −nπ − cos( ) − cos( ) nπ 3 3 0 Justification of the Fourier coefficient formulas We need the following basic facts about the integrals of certain products of sines and cosines. November 29, 2010 22-7 0, mπx nπx cos( )cos( )dx = L, −L L L L, L Z Z L cos( −L nπx mπx ) sin( )dx = 0 for all m, n; L L 0, mπx nπx sin( ) sin( )dx = L, −L L L 0, Z L m 6= n, m = n 6= 0, m=n=0 m 6= n, m = n 6= 0, m=n=0 (6) (7) (8) We justify formula (8), leaving the other similar calculations to the reader. First recall some formulas related to the sine and cosine functions. The sum and difference formulas are: cos(α + β) = cos(α)(cos(β) − sin(α) sin(β) cos(α − β) = cos(α)(cos(β) + sin(α) sin(β). Applying the first formula with α = β gives cos(2α) = cos(α)2 − sin(α)2 (9) (10) November 29, 2010 22-8 This implies that 1 + cos(2α) = cos(α)2 + sin(α)2 + cos(α)2 − sin(α)2 = 2 cos(α)2 or the so-called cosine half-angle formula 1 cos(α)2 = (1 + cos(2α)). 2 Similarly, the sine half-angle formula is 1 sin(α)2 = (1 − cos(2α)). 2 Formulas (9) and (10) imply that cos(α − β) − cos(α + β) = 2 sin(α) sin(β). Using α = nx, β = mx then gives cos((n − m)x) − cos((n + m)x) = 2 sin(nx) sin(mx). (11) This implies, for m 6= n and both positive, mπx nπx 1ZL (m − n)πx ) sin( )dx = cos( )dx sin( −L L L 2 −L L 1ZL (m + n)πx − −L cos( )dx 2 L Z L November 29, 2010 22-9 (m−n)πx ) sin( L L 2π = 0. = m−n − (m+n)πx L sin( L ) m+n If m = n = 0, then Z L Z L mπx mπx sin( ) sin( )dx = −L 0 dx = 0, −L L L while if m = n 6= 0, we have mπx !2 sin( ) dx −L L 1ZL 2mπx = 1 − cos( ) dx 2 −L L 2mπx L 1 sin( ) = x − 2mπL 2 L −L = L. mπx mπx ) sin( )dx = sin( −L L L Z L Z L Now, suppose that a0 mπx mπx X + am cos( ) + bm sin( ). (12) 2 m≥1 L L Since the integrals of cosine and sine functions over intervals of lengths equal to their periods vanish, we have f (x) = Z L f (x)dx = −L Z L ( −L a0 mπx mπx X + am cos( ) + bm sin( ))dx 2 m≥1 L L −L November 29, 2010 22-10 a0 mπx X Z L = a cos( (2L) + )dx m 2 L m≥1 −L mπx X Z L b sin( )dx + m −L L m≥1 = a0 L Analogously, using the orthogonality relations above, we have that, for n ≥ 1, nπx a0 mπx X )( + am cos( ))dx L 2 m≥1 L Z L nπx X mπx + −L cos( )( bm sin( ))dx L m≥1 L = am L nπx )dx = f (x) cos( −L L Z L Z L cos( −L which gives (3). Formula (4) is justified in a similar way. 4 Even and Odd functions A function f (x) is called even if f (−x) = f (x) for all x. Analogously, a function f (x) is called odd if f (−x) = −f (x) for all x. For example, cos(x) is even, and sin(x) is odd. Also, one sees easily that linear combinations of even (odd) functions are again even (odd). The following facts are useful. November 29, 2010 22-11 1. The product of two odd functions is even. 2. The product of two even functions is even. 3. The product of and even function and an odd function is odd. The following comments are useful. 4. The Fourier series of a periodic odd function only involves sine terms: i.e.; am = 0 for all m ≥ 1. This is because mπx 1 ZL f (x) cos( )dx am = L −L L and the function f (x) cos( mπx L ) is odd. 5. Similarly, the Fourier series of a periodic even function only involves cosine terms: i.e.; bm = 0 for all m ≥ 1. 6. Any function f (x) defined on [0, L] (with L > 0 has an even extension feven(x) to [−L, L] and also has an odd extension fodd(x) to [−L, L]. The definitions are f (x) f (−x) 0≤x≤L −L ≤ x ≤ 0 f (x) −f (−x) 0≤x≤L −L ≤ x ≤ 0 feven(x) = fodd(x) = November 29, 2010 22-12 Hence, any piecewise continuous function f (x) on [0, L] can be represented both as Fourier cosine series and a Fourier sine series.