Lecture VI Abstract Before learning to solve partial differential equations, it is necessary to know how to approximate arbitrary functions by infinite series, using special families of functions. This process is called Fourier1 approximation and the families of functions we use are called orthogonal families. Review of even and odd functions Definition 1 A function f (x) is called an even function if f (−x) = f (x) for all x in the domain of definition of f (x). It is called an odd function if f (−x) = −f (x) for all x in the domain of definition of f (x). Even and odd functions have the following nice properties 1. if f (x) and g(x) are both even or odd functions, then the product f (x)g(x) is an even function. 2. If f (x) is an even function and g(x) is an odd function, then the product f (x)g(x) is an odd function. 3. Even functions are symmetric about the y-axis. 4. For any even function f (x) Z Z L dx f (x) = 2 −L L dx f (x). 0 5. Odd functions are symmetric about the origin. 6. For any odd function g Z L dx g(x) = 0. −L 1 Jean Baptiste Joseph Fourier (1768-1830) was a French mathematician and physicist. 1 Examples of even function functions are even degree polynomials like x2 , x4 + 2 3x8 and functions like ex , cos (ωt) and etc., whereas odd degree polynomials like x, 2x3 − 5x11 , etc. and sin (ωt) are odd functions. At this point we should add to the list two more functions you may not have seen before: the hyperbolic sine sinh x and the hyperbolic cosine cosh x. They are defined as follows ex + e−x ex − e−x , cosh x = . 2 2 It is straightforward to check that they satisfy the following differentiation formulas d d sinh x = cosh x, cosh x = sinh x. dx dx Two properties of these functions that will be needed later are sinh x = • cosh x 6= 0 for all real x, • sinh x = 0 for x = 0. Example 1 Show that sinh x is an odd function and cosh x is even. We only need to apply the definition of even and odd functions and find that e−x − ex ex − e−x e−x − e−(−x) = =− = − sinh x, 2 2 2 e−x + e−(−x) e−x + ex ex + e−x cosh (−x) = = = = cosh x. 2 2 2 sinh (−x) = Orthogonal families of functions Definition 2 An infinite collection of functions S = {Φ0 (x), Φ1 (x), Φ2 (x), · · · } = {Φn (x)}∞ n=0 is said to be an orthogonal set on the interval [α, β] ⊂ R if Z β dx Φm (x)Φn (x) = 0 if m = 6 n (1) α where m and n are natural numbers. A Fourier approximation of a function f (x) is simply a representation of the function f (x) by means of a series involving the elements of a given orthogonal set S, that is ∞ X an Φn (x) = a0 Φ0 (x) + a1 Φ1 (x) + · · · + an Φn (x) + · · · n=0 2 (2) Let us assume for a moment that the above series converges to f (x) on the interval [α, β]. Then, the orthogonality property (1) is fundamental in order to compute the coefficients an of the expansion (2). Indeed, we have ! Z β Z β ∞ X dx f (x)Φm (x) = dx an Φn (x) Φm (x) = α α ∞ X Z β Z β dx Φn (x)Φm (x) = am an n=0 n=0 dx Φ2m (x). α α Therefore, a general formula for the n-th coefficient in the expansion (2) is Rβ dx f (x)Φm (x) an = α R β , m ≥ 0. (3) 2 (x) dx Φ m α We are going to need to find Fourier approximations for arbitrary functions f (x) in terms of different sets of orthogonal functions such the sine-cosine Fourier family, Legendre polynomials, and so on. In computing the coefficients by integration, life is sometimes simplified if we know that the function f (x) satisfies certain properties as it is the case, when f (x) is an odd or even function. Trigonometric Fourier series We are now ready to study the approximation of functions in terms of the orthogonal set πx πx 2πx 2πx ∞ S = {Φn (x)}n=0 = {1, cos , sin , cos , sin ,··· L L L L nπx nπx , sin , · · · }. · · · , cos L L Notice that each function in the set S has period 2L since Φn (x + 2L) = Φn (x) for all x ∈ [−L, L]. The trigonometric Fourier series for f (x) on the interval [−L, L] is f (x) = ∞ X n=0 an cos nπx L + ∞ X n=1 bn sin nπx L . (4) Notice that since each function in S has period 2L, if the function f (x) is represented by a trigonometric series, it must also have period 2L. To verify that S is an orthogonal set we have to check that 3 1. RL nπx dx 1 · cos = 0. L −L To compute the above integral notice that 1 · cos nπx is even since L product of even functions. Thus, Z L Z L nπx 2L nπx L nπx dx 1 · cos =2 = sin dx 1 · cos = L L nπ L 0 0 −L 2L [sin (nπ) − sin 0] = 0. nπ RL nπx dx 1 · sin = 0. L −L We only need to observe that the product of an even function with an odd function gives an odd function and apply property 6. in the review of odd and even functions. RL mπx 3. −L dx sin nπx cos = 0 if m 6= n. L L Clear, since the product of an odd function with an even function gives an odd function and the integral of an odd function over the interval [−L, L] is always zero according to 6. in the review about even and odd functions. RL RL sin mπx = 0 = −L dx cos nπx cos mπx if m 6= n. 4. −L dx sin nπx L L L L To show the validity of the above result we need to use some trigonometric substitutions and this problem is left to the the exercises in the problem section. 2. In order to compute the Fourier series of a given function we need to know how to determine the coefficients a0 , an and bn . This is done as follows mπx 1. Multiply (4) by cos and integrate over the interval [−L, L]. L Then Z L ∞ nπx mπx Z L mπx X dx an cos dx f (x) cos = cos + L L L −L −L n=0 Z L dx −L ∞ X bn sin n=1 nπx L cos mπx L . If the series under the integral sign converge, then we can take the summation sign outside the integral and obtain Z L Z L ∞ mπx X nπx mπx dx f (x) cos = an dx cos cos + L L L −L −L n=0 4 ∞ X Z L dx sin bn nπx L −L n=1 cos mπx L . Observe that the last integral vanishes according to 3. at page 4. Thus we have Z L Z L ∞ mπx mπx X nπx = an cos = dx f (x) cos dx cos L L L −L −L n=0 Z L dx cos a0 mπx −L L + ∞ X Z L an n=1 dx cos −L nπx L cos mπx L . Take m = 0 in the above expression and notice that the last integral is zero since n ≥ 1 will ensure that m 6= n. Hence, we get Z L Z L dx f (x) = a0 dx = 2La0 . −L −L Finally, we get Z L 1 a0 = dx f (x). 2L −L The formula above is very important and you have to keep it in mind for the final exam! mπx 2. Start with (4) and multiply it by cos . Integrate over the interL val [−L, L] and take the summation signs outside the integrals as we did when we determined a0 . Then, we find Z L Z L ∞ nπx mπx mπx X an dx cos = cos + dx f (x) cos L L L −L −L n=0 ∞ X n=1 Z L bn dx sin −L nπx L cos mπx L . The last integral vanishes for the same reason mentioned in the previous point. Hence, we have Z L Z L ∞ mπx X nπx mπx dx f (x) cos = an dx cos cos L L L −L −L n=0 The integral on the left hand side will not be zero only if n = m. Therefore, we obtain Z L Z L nπx 2 nπx dx f (x) cos = an dx cos . L L −L −L 5 Since (problem for the next homework) Z L dx cos2 −L nπx L = L, we can conclude that 1 an = L Z L dx f (x) cos −L nπx L . Again, this formula is very important and you should keep it in mind for the final exam. mπx 3. To find the coefficients bn we multiply (4) by sin and proceed L as we did in the previous part. The only difference is that we will need the following integral Z L 2 nπx dx sin = L. L −L The coefficients bn are given by Z nπx 1 L dx f (x) sin . bn = L −L L This is again an important formula that you have to keep it in your wallet! We conclude this lecture with an example of a Fourier series of a piecewise continuous function, i.e. a function f (x) made up of a finite number of continuous pieces. This means that such a function can exhibit a finite number of jumps or discontinuities. Moreover, if x1 , x2 , · · · , xn denote the position of the discontinuities we require that the limits f (x− i ) = lim− f (x), f (x+ i ) = lim+ f (x) x→xi x→xi both exist at each of the point x1 . Example 2 Find a trigonometric Fourier series for the piecewise continuous function −1 if − L ≤ x < 0, f (x) = +1 if 0 ≤ x ≤ L. 6 Notice that f (x) is an odd function and therefore all of the coefficients an in the Fourier series of f (x) will vanish. Thus, we have ∞ nπx X f (x) = bn sin . L n=1 The coefficients bn can be computed by means of the formula Z nπx 1 L bn = dx f (x) sin , n ≥ 1. L −L L Notice that the product of two odd functions is an even function. Hence, we have Z Z nπx nπx 2 L 2 L bn = dx f (x) sin = dx sin = L 0 L L 0 L nπx L 2 L 2 0 if n is even, − · cos [cos (nπ) − 1] = =− 4 if n is odd L nπ L nπ 0 nπ Finally, the Fourier series of f (x) is ∞ nπx 4X1 sin f (x) = π n=1 n L Practice problems 1. Determine whether each function below is even, odd or neither (a) (b) (c) (d) (e) 1 + x2 sin (2x) + 6x ex 1 + 2 cosh x 1 + x3 2. Show that if f (x) is an even function and g(x) is odd, then the product f (x)g(x) is an odd function. 3. Use the trigonometry identity 1 cos α cos β = [cos (α − β) + cos (α + β)] 2 to show that if m 6= n, then Z L nπx mπx dx cos cos = 0. L L −L Hint: the integrand is an even function. 7 4. Use the trigonometry identity sin α sin β = 1 [cos (α − β) − cos (α + β)] 2 to show that if m 6= n, then Z L nπx mπx dx sin sin = 0. L L −L 5. Show that Z L 2 dx cos −L nπx L Z L dx sin = 2 nπx L −L =L for any integer n > 0. Hint: use the trigonometric formulas cos2 x = 1 + cos (2x) , 2 sin2 x = 1 − cos (2x) . 2 6. Let f (x) = x2 for x ∈ [−L, L] and assume that f (x) is periodic with period 2L. (a) Draw a graph of this function on the interval [−3L, 3L]. (b) Derive the Fourier series of the function f (x). (c) Using all terms out to n = 3, sketch a graph of the Fourier series approximation to f (x) on the interval [−3L, 3L] with L = 1. 7. Approximating a function f (x) by a Taylor series at x = 0, that is f (x) = ∞ X f (n) (0) n=0 n! xn , is equivalent to use the set of functions S = {1, x, x2 , · · · }. Is this set of functions orthogonal on the interval [−1, 1]? Either prove that it is or find two integers m 6= n such that Z 1 dx xm · xn 6= 0. −1 8 8. You already know that the Legendre polynomials Pn (x) satisfy an orthogonality relation. Hence, the set S = {P0 (x), P1 (x), P2 (x), · · · } forms an orthogonal set on the interval [−1, 1]. Thus, we could use them to approximate functions on the interval [−1, 1]. Look up Legendre polynomials on the web or in a text book and find a recursion formula that allows you to use Pn−2 (x) and Pn−1 (x) to determine Pn (x). Are you able to derive a formula for the coefficients an of an expansion of the form ∞ X f (x) = an Pn (x)? n=0 9