MATH 461: Fourier Series and Boundary Value Problems Chapter III: Fourier Series Greg Fasshauer Department of Applied Mathematics Illinois Institute of Technology Fall 2015 fasshauer@iit.edu MATH 461 Chapter 3 1
Outline 1 Piecewise Smooth Functions and Periodic Extensions 2 Convergence of Fourier Series 3 Fourier Sine and Cosine Series 4 Term-by-Term Differentiation of Fourier Series 5 Integration of Fourier Series 6 Complex Form of Fourier Series fasshauer@iit.edu MATH 461 Chapter 3 2
Piecewise Smooth Functions and Periodic Extensions Definition A function f, defined on [a, b], is piecewise continuous if it is continuous on [a, b] except at finitely many points. If both f and f are piecewise continuous, then f is called piecewise smooth. Remark This means that the graphs of f and f may have only finitely many finite jumps. fasshauer@iit.edu MATH 461 Chapter 3 4
Piecewise Smooth Functions and Periodic Extensions Example The function f (x) = x defined on π < x < π is piecewise smooth since f is continuous throughout the interval, and f is discontinuous only at x = 0. Example The function { x 2, π < x < 0 f (x) = x 2 + 1, 0 x < π is piecewise smooth since both f and f are continuous except at x = 0. fasshauer@iit.edu MATH 461 Chapter 3 5
Piecewise Smooth Functions and Periodic Extensions Example The function { ln(1 x), 0 x < 1 f (x) = 1, 1 x < 2 is not piecewise continuous (and therefore also not piecewise smooth) since lim x 1 x 1 f (x) = lim ln(1 x) =, i.e., f has an infinite jump at x = 1. fasshauer@iit.edu MATH 461 Chapter 3 6
Piecewise Smooth Functions and Periodic Extensions Periodic Extension If f is defined on [, ], then its periodic extension, defined for all x, is given by. f (x + 2), 3 < x <, f (x), < x <, f (x) = f (x 2), < x < 3, f (x 4), 3 < x < 5,. fasshauer@iit.edu MATH 461 Chapter 3 7
Piecewise Smooth Functions and Periodic Extensions Example Figure: Plot of f for f (x) = 1 x. fasshauer@iit.edu MATH 461 Chapter 3 8
Piecewise Smooth Functions and Periodic Extensions Example Figure: Plot of f for f (x) = { (x + ) 2, x 0 x 2 + 1, 0 < x <. fasshauer@iit.edu MATH 461 Chapter 3 9
Convergence of Fourier Series Even though we have used Fourier series to represent a given function f within our separation of variables approach, we have never made sure that these series actually converge. Moreover, even if we can assure convergence, how do we know that they converge to the function f? Remark This should not come as a total surprise, since for power series we also had to determine the interval (or radius) of convergence. fasshauer@iit.edu MATH 461 Chapter 3 11
Convergence of Fourier Series Using a more precise notation, all we can say is f (x) a 0 + [ a n cos nπx + b n sin nπx ], i.e., we can associate with f this Fourier series, but not f is equal to this Fourier series. The Fourier coefficients of f, on the other hand, are never in doubt. They are given by a 0 = 1 2 a n = 1 b n = 1 f (x) dx f (x) cos nπx f (x) sin nπx dx, n = 1, 2,... dx, n = 1, 2,... fasshauer@iit.edu MATH 461 Chapter 3 12
What we need is Convergence of Fourier Series Theorem (Fourier Convergence Theorem) If f is piecewise smooth on [, ], then the Fourier series of f converges. Moreover, 1 at those points x where the periodic extension f of f is continuous, the Fourier series of f converges to f (x) and 2 at jump discontinuities of the periodic extension, the Fourier series converges to 1 [ ] f (x ) + f (x+), 2 i.e., the average of the left and right limits at the jump. Remark Note that (2) actually includes (1) since 1 [ ] f (x ) + f (x+) 2 = 1 2 [ ] f (x) + f (x) = f (x) fasshauer@iit.edu MATH 461 Chapter 3 13
Convergence of Fourier Series Proof. The proof of this theorem is not contained in [Haberman] and goes beyond the scope of this course. It can be found in [Pinsky, Section 1.2] or [Brown & Churchill, Section 19]. The proof requires the Dirichlet kernel D N (x) = 1 2 + N cos nx = sin ( N + 1 ) 2 x 2 sin x 2 as well as a careful analysis of one-sided derivatives. The calculations for Gibbs phenomenon below gives a flavor of this. fasshauer@iit.edu MATH 461 Chapter 3 14
Convergence of Fourier Series Remark The theorem above is about pointwise convergence of Fourier series. In classical harmonic analysis there are also theorems about other kinds of convergence of Fourier series, such as uniform convergence or convergence in the mean. For these see, e.g., [Brown & Churchill, Pinsky]. We will talk about convergence in the mean in Chapter 5, and the Gibbs phenomenon below is evidence that uniform convergence is not guaranteed for general functions f. fasshauer@iit.edu MATH 461 Chapter 3 15
Convergence of Fourier Series Example { 1, x < 0 Consider the function f (x) = 2, 0 < x [ The Fourier series of f, a 0 + a n cos nπx represented by the following graph: + b n sin nπx ], is fasshauer@iit.edu MATH 461 Chapter 3 16
Convergence of Fourier Series Example (cont.) Remark Even if we know that the series converges, we have f (x) = its Fourier series only for x (, ) (and provided f is continuous at x). At all other values of x the Fourier series equals the periodic extension of f, except at jump discontinuities, where it equals the average jump. What are the Fourier coefficients for this example? fasshauer@iit.edu MATH 461 Chapter 3 17
Convergence of Fourier Series Example (cont.) a 0 = 1 2 [ 0 = 1 2 f (x) dx 1 dx + = 1 2 [ + 2] = 3 2 0 2 dx ] fasshauer@iit.edu MATH 461 Chapter 3 18
Convergence of Fourier Series Example (cont.) a n = 1 f (x) cos nπx dx [ = 1 0 cos nπx dx + 2 [ = 1 cos nπx dx + }{{} = =0 [ sin nπx nπ ] 0 = 0 0 0 cos nπx cos nπx dx dx ] ] fasshauer@iit.edu MATH 461 Chapter 3 19
Convergence of Fourier Series Example ((cont.)) b n = 1 f (x) sin nπx dx [ = 1 0 sin nπx dx + 2 [ = 1 sin nπx dx + }{{} =0 = [ cos nπx nπ cos nπ = + cos 0 nπ nπ = 1 ( 1)n nπ = ] 0 0 0 { 0, n even 2 nπ, n odd sin nπx sin nπx fasshauer@iit.edu MATH 461 Chapter 3 20 dx dx ] ]
Convergence of Fourier Series Example (cont.) Summarizing, we have found that the function { 1, x < 0 f (x) = 2, 0 < x has Fourier series f (x) 3 2 + 1 ( 1) n nπ = 3 2 + k=1 sin nπx 2 (2k 1)πx sin (2k 1)π fasshauer@iit.edu MATH 461 Chapter 3 21
Convergence of Fourier Series Example (cont.) Figure: Plot of 10-term Fourier series approximation 10 f (x) = 3 2 + 2 (2k 1)πx sin (red) together with graph of f (blue). (2k 1)π k=1 fasshauer@iit.edu MATH 461 Chapter 3 22
Convergence of Fourier Series The Gibbs Phenomenon In order to understand the oscillations of the previous plots, and in particular the overshoot, we consider an almost identical function: { 1, π x < 0 f (x) = 1, 0 < x π with truncated Fourier series N 2 (1 ( 1) n ) f 2N (x) = f 2N 1 (x) = sin nx = nπ Remark N k=1 4 sin(2k 1)x π 2k 1 Compared to the previous example, the sines are simpler since = π, and we have a vertical shift by a 0 = 0 and a vertical stretching so that { b n = 2 1 ( 1)n 0, n even = nπ 4 nπ, n odd. fasshauer@iit.edu MATH 461 Chapter 3 23
Convergence of Fourier Series Gibbs Phenomenon (cont.) To find the overshoot at the jump discontinuity we look at the zeros of the derivative of the truncated Fourier series (to locate its maxima), i.e., f 2N 1 (x) = 4 π N cos(2k 1)x = 4 [cos x + cos 3x +... + cos(2n 1)x] π k=1 To find the zeros of this function we multiply both sides by sin x, i.e., sin xf 2N 1 (x) = 4 [sin x cos x + sin x cos 3x +... + sin x cos(2n 1)x] π Using the trigonometric identity sin x cos kx = sin(k+1)x sin(k 1)x 2 we get sin xf 2N 1 (x) = 2 [(sin 2x sin 0) + (sin 4x sin 2x) +... + (sin 2Nx sin(2n 2)x)] π = 2 sin 2Nx. π fasshauer@iit.edu MATH 461 Chapter 3 24
Convergence of Fourier Series Gibbs Phenomenon (cont.) Now, sin 2Nx = 0 if 2Nx = ±π, ±2π,..., ±2Nπ. The maximum overshoot occurs at x = π 2N and its value is ( π ) f 2N 1 2N = 4 π = 2 π = 2 π N k=1 2N π N k=1 sin (2k 1)π 2N 2k 1 π N N k=1 sin (2k 1)π 2N (2k 1)π 2N sin (2k 1)π 2N 2k 1 π N. fasshauer@iit.edu MATH 461 Chapter 3 25
Convergence of Fourier Series Gibbs Phenomenon (cont.) If we interpret N k=1 sin (2k 1)π 2N (2k 1)π 2N as a partial Riemann sum with x = π N and midpoints x = π 2N, 3π 2N,..., (2N 1)π 2N for the partition 0, π N, 2π N,..., (N 1)π N, π of [0, π] then ( π ) f 2N 1 2 π sin x dx for N. 2N π x This integral can be evaluated numerically to get ( π ) f 2N 1 1.178979744472167.... 2N 0 π N fasshauer@iit.edu MATH 461 Chapter 3 26
Convergence of Fourier Series Gibbs Phenomenon (cont.) Since the actual size of the jump discontinuity is 2, we have an approximately 9% overshoot. This is true in general [Pinsky, p. 60]: Theorem If f is piecewise smooth on ( π, π) then the overshoot of the truncated Fourier series of f at a discontinuity x 0 (the Gibbs phenomenon) is approximately 9% of the jump, i.e., Remark 0.09 [f (x 0 +) f (x 0 )]. The Gibbs phenomenon was actually discovered by Henry Wilbraham in 1848. Gibbs was just more famous, published in a better journal (50 years later), and built in some mistakes perhaps drawing more attention to his work (for further discussion see [Trefethen, Chapter 9]). fasshauer@iit.edu MATH 461 Chapter 3 27
Fourier Sine and Cosine Series We begin by reviewing the concepts of odd and even functions: Definition f is an odd function if f ( x) = f (x) for all x in the domain of f. Remark The graph of an odd function is symmetric about the origin. For an odd function we have f (x) dx = 0. f (x) dx = 0 = = 0 0 f (x) }{{} u = x du = dx f ( u) }{{} = f (u) dx + du + f (u) du + 0 0 0 f (x) dx f (x) dx f (x) dx = 0 fasshauer@iit.edu MATH 461 Chapter 3 29
Fourier Sine and Cosine Series Definition f is an even function if f ( x) = f (x) for all x in the domain of f. Remark The graph of an even function is symmetric about the y-axis. For an even function we have f (x) dx = 2 0 f (x) dx, which can be shown similarly to the analogous property for odd functions. fasshauer@iit.edu MATH 461 Chapter 3 30
Fourier Sine and Cosine Series et s consider the Fourier series of an odd function with Therefore, a 0 = 1 2 b n = 1 f (x) a 0 + f (x) dx = 0, }{{} odd f (x) }{{} odd sin nπx } {{ } odd } {{ } even f (x) [ a n cos nπx dx = 2 a n = 1 0 + b n sin nπx ] B n sin nπx, f (x) }{{} odd cos nπx } {{ } even } {{ } odd f (x) sin nπx dx(= B n) i.e., the Fourier series is automatically a Fourier sine series. dx = 0 fasshauer@iit.edu MATH 461 Chapter 3 31
Fourier Sine and Cosine Series What does the Fourier sine series of f converge to? Theorem If f is piecewise smooth on [0, ], then the Fourier sine series of f converges. Moreover, 1 at those points x where the odd periodic extension of f is continuous, the Fourier sine series converges to the odd periodic extension and 2 at jump discontinuities of the odd periodic extension, the Fourier sine series converges to the average of the left and right limits at the jump. fasshauer@iit.edu MATH 461 Chapter 3 32
Fourier Sine and Cosine Series Example Figure: Plot of odd periodic extension of f (x) = 1 x. fasshauer@iit.edu MATH 461 Chapter 3 33
Fourier Sine and Cosine Series Remark Even if f is not an odd function, it may still be necessary to represent it by a Fourier sine series. Example The heat equation problem u t (x, t) = k 2 u (x, t), x 2 0 < x <, t > 0 u(0, t) = u(, t) = 0 u(x, 0) = cos πx has sines as eigenfunctions, so we need to find the Fourier sine series expansion of f (x) = cos πx. fasshauer@iit.edu MATH 461 Chapter 3 34
Fourier Sine and Cosine Series Example (cont.) We know u(x, t) = ϕ(x)g(t), with eigenvalues λ n = ( ) nπ 2, n = 1, 2, 3,... and eigenfunctions as well as G n (t) = e λnkt. Therefore and u(x, t) = u(x, 0) = ϕ n (x) = sin nπx B n sin nπx nπ e k( ) 2 t B n sin nπx! = cos πx fasshauer@iit.edu MATH 461 Chapter 3 35
Fourier Sine and Cosine Series Example (cont.) In HW 3.3.2a you should show a B n = 2 0 cos πx { nπx 0, n odd sin dx = n even 4n π(n 2 1), Therefore, letting n = 2k (even), we have cos πx = 8k 2kπx π(4k 2 sin 1) k=1 and the equality is true for 0 < x < (since the cosine equals its odd periodic extension there). For x = 0 and x = the series is zero (which is equal to the average jump of the cosine function there). a Remember that we established the orthogonality of sine and cosine only on [, ], not on [0, ] fasshauer@iit.edu MATH 461 Chapter 3 36
Fourier Sine and Cosine Series Consider the Fourier series of an even function [ f (x) a 0 + a n cos nπx + b n sin nπx ] with Therefore, a 0 = 1 2 a n = 1 b n = 1 f (x) dx = 1 }{{} even f (x) cos nπx }{{ } even f (x) sin nπx }{{ } odd f (x) A 0 + 0 dx = 2 dx = 0 f (x) dx(= A 0 ) 0 A n cos nπx, f (x) cos nπx dx(= A n) i.e., the Fourier series is automatically a Fourier cosine series. fasshauer@iit.edu MATH 461 Chapter 3 37
Fourier Sine and Cosine Series Theorem If f is piecewise smooth on [0, ], then the Fourier cosine series of f converges. Moreover, 1 at those points x where the even periodic extension of f is continuous, the Fourier cosine series converges to the even periodic extension and 2 at jump discontinuities of the even periodic extension, the Fourier cosine series converges to the average of the left and right limits at the jump. Remark Note that jump discontinuities are possible only for 0 < x <, i.e., if f itself had jump discontinuities. The even periodic extension cannot have any jumps at x = 0 or x = ±. fasshauer@iit.edu MATH 461 Chapter 3 38
Fourier Sine and Cosine Series Example Figure: Plot of even periodic extension of f (x) = x 2 + 1. fasshauer@iit.edu MATH 461 Chapter 3 39
Fourier Sine and Cosine Series Example Find the Fourier cosine series expansion of the function { 1, 0 x < f (x) = 2 0, 2 x and sketch its graph. nπx fasshauer@iit.edu MATH 461 Chapter 3 40
Fourier Sine and Cosine Series Example (cont.) et s compute the Fourier cosine coefficients: A 0 = 1 f (x) dx 0 [ = 1 /2 ] 1 dx + 0 dx 0 /2 = 1 2 = 1 2 fasshauer@iit.edu MATH 461 Chapter 3 41
Fourier Sine and Cosine Series Example (cont.) Therefore A n = 2 f (x) cos nπx 0 dx [ = 2 /2 cos nπx ] 0 dx + 0 cos nπx /2 dx = 2 [ sin nπx ] /2 nπ 0 { = 2 nπ sin nπ 0, n = 2k even 2 = 2 (2k 1)π ( 1)k+1, n = 2k 1 odd f (x) 1 2 + k=1 2( 1) k+1 (2k 1)πx cos (2k 1)π Note that equals = for all x [0, ] except x = 2. fasshauer@iit.edu MATH 461 Chapter 3 42
Fourier Sine and Cosine Series Even and odd parts of functions Theorem Any function f can be written as the sum of an even and an odd function: Proof. Indeed, f e is even f (x) = 1 [f (x) + f ( x)] + 1 [f (x) f ( x)] } 2 {{}} 2 {{} :=f e(x) :=f o(x) and f o is odd f e ( x) = 1 2 [f ( x) + f (x)] = f e(x), f o ( x) = 1 2 [f ( x) f (x)] = 1 2 [f (x) f ( x)] = f o(x). fasshauer@iit.edu MATH 461 Chapter 3 43
Fourier Sine and Cosine Series Now, the Fourier series for an arbitrary function f is given by f (x) a 0 + a n cos nπx + b n sin nπx with Fourier coefficients a 0 = 1 2 f (x)dx, a n = 1 On the other hand, } {{ } even } {{ } odd f (x) cos nπx dx, b n = 1 f (x) sin nπx dx. b n sin nπx is a Fourier sine series. However, it is the Fourier sine series of f o, not of f! Note that the Fourier sine series of f has coefficients B n = 2 0 f (x) sin nπx fasshauer@iit.edu MATH 461 Chapter 3 44 dx.
Fourier Sine and Cosine Series We can make a similar observation for cosine. Therefore, [ a 0 + a n cos nπx + b n sin nπx ] }{{} Fourier series of f = a 0 + a n cos nπx }{{} cosine series of f e + b n sin nπx }{{} sine series of f o fasshauer@iit.edu MATH 461 Chapter 3 45
Fourier Sine and Cosine Series Summary: Convergence of Fourier series et f be piecewise smooth. Then The Fourier series of f is continuous for all x f is continuous on [, ] (i.e., no jumps inside) and f ( ) = f () (i.e., no jumps at end). fasshauer@iit.edu MATH 461 Chapter 3 46
Fourier Sine and Cosine Series The Fourier cosine series of f is continuous for all x f is continuous on [0, ]. fasshauer@iit.edu MATH 461 Chapter 3 47
Fourier Sine and Cosine Series The Fourier sine series of f is continuous for all x f is continuous on [0, ] (i.e., no jumps inside) and f (0) = f () = 0 (i.e., no jumps at end). fasshauer@iit.edu MATH 461 Chapter 3 48
Term-by-Term Differentiation of Fourier Series Recall that in HW 2.5.5c we had to deal with the boundary condition where u(r, θ) = u (1, θ) = f (θ), r B n r 2n sin 2nθ. In order to determine the coefficients b n we needed to differentiate the infinite series, i.e., find u r (r, θ) = 2nB n r 2n 1 sin 2nθ. Was this justified? Does this new series converge? If so, does it converge to u r (r, θ)? fasshauer@iit.edu MATH 461 Chapter 3 50
Term-by-Term Differentiation of Fourier Series Example Consider the function f (x) = x, and find its Fourier sine series. Then, compare the termwise derivative of the series with the correct derivative f (x) = 1. We know x B n sin nπx with B n = 2 0 x sin nπx dx. fasshauer@iit.edu MATH 461 Chapter 3 51
Term-by-Term Differentiation of Fourier Series Example (cont.) Using integration by parts we have B n = 2 [ = 2 = 2 = 2 0 x sin nπx x nπ [ 2 dx cos nπx cos nπ + 2 nπ ] [ 2 cos nπ nπ 0 (nπ) + cos nπx nπ 0 nπx ] sin 2 0 = 2 nπ ( 1)n dx ] Therefore, x 2 π ( 1) n+1 n sin nπx for which we know that equals = for 0 x <. fasshauer@iit.edu MATH 461 Chapter 3 52 (1)
Term-by-Term Differentiation of Fourier Series Example (cont.) Now we consider the termwise derivative of the Fourier sine series i.e., x 2 π 2 π ( 1) n+1 n ( 1) n+1 = 2 n nπ sin nπx, cos nπx ( 1) n+1 cos nπx. Remark Note that this is a divergent series since the terms in the sequence do not approach zero for n, and therefore the series diverges by the standard test for divergence from calculus. fasshauer@iit.edu MATH 461 Chapter 3 53
Term-by-Term Differentiation of Fourier Series Example (cont.) Obviously, we must conclude that 1 2 ( 1) n+1 cos nπx. In fact, the Fourier cosine series of f (x) = 1 is given by f (x) = 1 1, i.e., a 0 = 1, a n = 0 for n 1. Obviously, we could replace by =. fasshauer@iit.edu MATH 461 Chapter 3 54
Term-by-Term Differentiation of Fourier Series Example (cont.) Why did this not work? What caused the trouble? Figure: Plot of f (x) = x for 0 < x <. fasshauer@iit.edu MATH 461 Chapter 3 55
Term-by-Term Differentiation of Fourier Series Example (cont.) Figure: Plot of odd extension of f (x) = x. fasshauer@iit.edu MATH 461 Chapter 3 56
Term-by-Term Differentiation of Fourier Series Example (cont.) Figure: Plot of odd periodic extension (actually, Fourier sine series) of f (x) = x. The jumps in the Fourier sine series at odd multiples of prevent the series from being differentiable. fasshauer@iit.edu MATH 461 Chapter 3 57
Term-by-Term Differentiation of Fourier Series Theorem (Differentiation of Fourier Series) A continuous Fourier series can be differentiated term-by-term provided f is piecewise smooth. Remark In other words, the Fourier series of a continuous function f which satisfies f ( ) = f () can be differentiated term-by-term provided f is piecewise smooth. Piecewise smoothness of f ensures that its Fourier series converges. fasshauer@iit.edu MATH 461 Chapter 3 58
Proof Term-by-Term Differentiation of Fourier Series The Fourier series of f is with a 0 = 1 2 f (x) a 0 + f (x)dx, a n = 1 [ a n cos nπx + b n sin nπx ] (2) f (x) cos nπx dx, b n = 1 f (x) sin nπx dx. Since f is piecewise smooth, it has a convergent Fourier series of the form [ f (x) A 0 + A n cos nπx + B n sin nπx ] (3) with A 0 = 1 2 f (x)dx, A n = 1 f (x) cos nπx dx, B n = 1 f (x) sin nπx dx. fasshauer@iit.edu MATH 461 Chapter 3 59
Term-by-Term Differentiation of Fourier Series If allowed, term-by-term differentiation of the Fourier series (2), i.e., would yield f (x) a 0 + f (x) [ a n cos nπx [ nπ a n sin nπx + b n sin nπx ] + nπ b n cos nπx ]. Therefore, comparing with (3), we need to show that A 0 = 0, A n = nπ b n, B n = nπ a n. fasshauer@iit.edu MATH 461 Chapter 3 60
Term-by-Term Differentiation of Fourier Series et s actually compute the Fourier coefficients of f based on the information we have: A 0 = 1 f (x) dx 2 = 1 2 [f (x)] = 1 [f () f ( )] 2 Since we assumed that the Fourier series of f is continuous, i.e., in particular, that f () = f ( ), we have A 0 = 0. fasshauer@iit.edu MATH 461 Chapter 3 61
Term-by-Term Differentiation of Fourier Series A n = 1 [ = 1 [ parts u = cos nπx dx = f (x) cos nπx f (x) cos nπx + f (x) nπ = 1 [ f () cos nπ f ( ) cos( nπ) }{{}, du = nπ dv = f (x)dx, v = f (x) ] nπx sin dx }{{} nπb n ] +nπb n =cos nπ = 1 [( ) ] f () f ( ) cos nπ + nπb }{{} n =0, since F.S. of f cont. = nπ b n. nπx sin dx ] B n is treated similarly. fasshauer@iit.edu MATH 461 Chapter 3 62
Term-by-Term Differentiation of Fourier Series If the Fourier series of f is not continuous, i.e., if f ( ) f (), then the proof above shows us that A 0 = 1 [f () f ( )], 2 A n = 1 ( 1)n [f () f ( )] + nπ b n, B n = nπ a n. Therefore, even if the Fourier series of f itself is not continuous, the Fourier series of the derivative of a continuous function f is given by f (x) 1 2 [f () f ( )] + ( ( 1) n nπ a n sin nπx. [f () f ( )] + nπ b n ) cos nπx fasshauer@iit.edu MATH 461 Chapter 3 63
Term-by-Term Differentiation of Fourier Series Theorem (Differentiation of Fourier Cosine Series) A continuous Fourier cosine series can be differentiated term-by-term provided f is piecewise smooth. Remark In other words, the Fourier cosine series of a continuous function f can be differentiated term-by-term provided f is piecewise smooth. No additional end conditions are required for f since f ( ) = f () is automatically satisfied due to even extension. Proof. HW 3.4.4b fasshauer@iit.edu MATH 461 Chapter 3 64
Term-by-Term Differentiation of Fourier Series Example Consider again the function f (x) = x, but now find its Fourier cosine series. Can we apply term-by-term differentiation? If so, what is the derivative? We know x A 0 + A n cos nπx with A 0 = 1 A n = 2 0 0 x dx = 1 2 2 = 2, x cos nπx dx. fasshauer@iit.edu MATH 461 Chapter 3 65
Term-by-Term Differentiation of Fourier Series Example (cont.) A n = 2 [ parts = 2 = = 0 x cos nπx x nπ 2 nπ nπ dx nπx sin nπx cos 0 2 (nπ) 2 [( 1)n 1] = 0 nπ 0 sin nπx dx ] { 0, for n even 4 (nπ) 2, for n odd Therefore, with n = 2k 1, x 2 4 1 (2k 1)πx π 2 cos (2k 1) 2 k=1 (4) fasshauer@iit.edu MATH 461 Chapter 3 66
Term-by-Term Differentiation of Fourier Series Example (cont.) Figure: Plot of odd periodic extension (i.e., Fourier cosine series) of f (x) = x. From the plots it is clear that equals = in (4) for 0 x. fasshauer@iit.edu MATH 461 Chapter 3 67
Term-by-Term Differentiation of Fourier Series Example (cont.) Since f and its Fourier cosine series are continuous we can now perform the term-by-term derivative of the Fourier cosine series from (4) i.e., Remark x 2 4 π 2 1 4 π 2 = 4 π k=1 k=1 k=1 1 (2k 1)πx cos (2k 1) 2 π (2k 1)πx sin (2k 1) 1 (2k 1) (2k 1)πx sin. (5) Note that this is the Fourier sine series of f (x) = 1, for 0 < x <., fasshauer@iit.edu MATH 461 Chapter 3 68
Term-by-Term Differentiation of Fourier Series Example (cont.) Figure: Plot of Fourier sine series of f (x) = 1. Note that due to the jumps in the graph of the Fourier sine series equals = in (5) only for 0 < x <. fasshauer@iit.edu MATH 461 Chapter 3 69
Term-by-Term Differentiation of Fourier Series Theorem (Differentiation of Fourier Sine Series) A continuous Fourier sine series can be differentiated term-by-term provided f is piecewise smooth. Remark In other words, the Fourier sine series of a continuous function f which satisfies f (0) = f () = 0 can be differentiated term-by-term provided f is piecewise smooth. Proof. See the textbook on pages 120-121. fasshauer@iit.edu MATH 461 Chapter 3 70
Term-by-Term Differentiation of Fourier Series From the proof of the theorem we get that if f is continuous, but does not satisfy f (0) = f () = 0, with Fourier sine series f (x) B n sin nπx then, provided f is piecewise smooth, we get the Fourier cosine series f (x) 1 [f () f (0)] + ( nπ B n + 2 ) [( 1)n f () f (0)] cos nπx. (6) fasshauer@iit.edu MATH 461 Chapter 3 71
Term-by-Term Differentiation of Fourier Series Example We saw earlier that for the function f (x) = x we have x = 2 π ( 1) n+1 n sin nπx, 0 < x <. Since f (0) = 0 f () = we can t expect term-by-term differentiation to yield f (x) (and we observed this in the earlier example). However, (6) does provide the expected (and correct) answer f (x) 1 [f () f (0)] + = 1 [ 0] + = 1 + [ ( nπ ( nπ B n + 2 [( 1)n f () f (0)] 2( 1) n+1 nπ 2( 1) n+1 + 2( 1) n }{{} =0 ) cos nπx + 2 ) [( 1)n 0] cos nπx ] cos nπx = 1 fasshauer@iit.edu MATH 461 Chapter 3 72
Term-by-Term Differentiation of Fourier Series Another ook at Separation of Variables: The Eigenfunction Perspective By starting our discussion of the solution of the heat equation with an eigenfunction expansion we are able to obtain a justification for why the separation of variables approach works. Remark The main advantage of taking this different point of view is that it can be applied to nonhomogeneous problems as well (see HW 3.4.9 and 3.4.12). fasshauer@iit.edu MATH 461 Chapter 3 73
Term-by-Term Differentiation of Fourier Series Example et s once more solve the 1D heat equation u t = k 2 u x 2, 0 < x <, t > 0 u(0, t) = u(, t) = 0 u(x, 0) = f (x). We know that the eigenfunctions for this problem are { sin πx } 2πx 3πx, sin, sin,... and therefore we make the Ansatz u(x, t) = B n (t) sin nπx. Note the time-dependence of the Fourier sine coefficients. fasshauer@iit.edu MATH 461 Chapter 3 74
Term-by-Term Differentiation of Fourier Series Example (cont.) The first thing to do is to enforce the initial condition u(x, 0) = f (x), i.e., f (x) B n (0) sin nπx with B n (0) = 2 0 f (x) sin nπx dx, n = 1, 2, 3,... Remark Note that now we are approaching the problem from a different angle, and so we don t know yet whether u satisfies the heat equation. fasshauer@iit.edu MATH 461 Chapter 3 75
Term-by-Term Differentiation of Fourier Series Example (cont.) To check whether u satisfies the heat equation we compute all the required partial derivatives using term-by-term differentiation: u(x, t) = u x (x, t) B n (t) sin nπx = 2 u x 2 (x, t) ( nπ and nπ B n(t) cos nπx u t (x, t) B n(t) sin nπx ) 2 Bn (t) sin nπx (7) (8) (9) fasshauer@iit.edu MATH 461 Chapter 3 76
Term-by-Term Differentiation of Fourier Series Example (cont.) Were all of these differentiations justified? (7) was OK since we differentiated the sine series of a continuous function (for fixed t) which satisfies u(0, t) = u(, t) = 0. (8) was OK since we differentiated the cosine series of a continuous function (for fixed t). (9) was questionable. So far we have no theorem covering this case see below. fasshauer@iit.edu MATH 461 Chapter 3 77
Term-by-Term Differentiation of Fourier Series Example (cont.) Using (8) and (9), u satisfies the heat equation if B n(t) sin nπx = k [ ( nπ ) 2 Bn (t) sin nπx ]. Comparing coefficients of sines of like frequencies we get an ODE for the coefficients B n : ( nπ ) 2 B n(t) = k Bn (t), n = 1, 2, 3,... This ODE is easily solved and yields B n (t) = B n (0)e k( nπ ) 2 t which is the same answer we had earlier using separation of variables. fasshauer@iit.edu MATH 461 Chapter 3 78
Term-by-Term Differentiation of Fourier Series We close the section with the theorem that justifies the derivation of (9) above. Theorem If u = u(x, t) is a continuous function of t with time-dependent Fourier series u(x, t) = a 0 (t) + [ a n (t) cos nπx + b n(t) sin nπx ] then u t (x, t) = a 0 (t) + [ a n(t) cos nπx provided u t is piecewise smooth. + b n(t) sin nπ ] fasshauer@iit.edu MATH 461 Chapter 3 79
Integration of Fourier Series Theorem The Fourier series of a piecewise smooth function f can always be integrated term-by-term. Moreover, the result is a continuous infinite series (but not necessarily a Fourier series) which converges to the integral of f on the interval [, ], i.e., if f has the Fourier series f (x) a 0 + [ a n cos nπx then, for all x [, ], we have + b n sin nπx ], x x [ an f (t)dt = a 0 (x +)+ nπ sin nπx + b n nπ ( cos nπ cos nπx ) ]. (10) fasshauer@iit.edu MATH 461 Chapter 3 81
Integration of Fourier Series Remark The integrals in the theorem need not be from to x. They can also be from a to b, a, b [, ], since we can always write b a... = a b a b... +... =... +..., and the latter two integrals are covered by the formula in the theorem. fasshauer@iit.edu MATH 461 Chapter 3 82
Integration of Fourier Series Before we prove the theorem we note the following facts: x x x a 0 dt = a 0 t x = a 0(x + ) cos nπt dt = nπt x sin nπ = nπx sin nπ sin nπt dt = nπt x cos nπ = ( cos nπ cos nπx ) nπ This shows that the coefficients in formula (10) indeed are likely candidates for term-by-term integration of the Fourier series. fasshauer@iit.edu MATH 461 Chapter 3 83
Proof. Integration of Fourier Series We begin by defining the function F as F(x) = x f (t) dt. Since we assumed f to be piecewise smooth, F is continuous. Its Fourier series is continuous if and only if F( ) = F(). However, F( ) = F() = f (t) dt = 0 f (t) dt = 2a 0, where a 0 is one of the Fourier coefficients of f. These are in general not the same. Therefore, the Fourier series of F is not continuous in general, and we cannot assume that F (x) equals its Fourier series for x. fasshauer@iit.edu MATH 461 Chapter 3 84
Proof (cont.) In addition to F(x) = x now also define and Integration of Fourier Series H(x) = a 0 (x + ) G(x) = F(x) H(x). f (t) dt we Clearly, H denotes the line passing through (, 0) and (, 2a 0 ). As a consequence we have G( ) = G() = 0 (since F( ) = 0 and F() = 2a 0 ), G is continuous (since F and H are) so that G(x) equals its Fourier series on [, ]. fasshauer@iit.edu MATH 461 Chapter 3 85
Proof (cont.) Integration of Fourier Series et s write the Fourier series of G in the form G(x) = A 0 + [ A n cos nπx + B n sin nπx ] with (remember that G(x) = F(x) H(x) = F(x) a 0 (x + )) A 0 = 1 2 A n = 1 B n = 1 and let s compute A 0, A n and B n. [F(x) a 0 (x + )] dx [F(x) a 0 (x + )] cos nπx [F(x) a 0 (x + )] sin nπx dx dx fasshauer@iit.edu MATH 461 Chapter 3 86
Proof (cont.) Integration of Fourier Series A n = 1 = 1 = 1 [ = nπ b n [F(x) a 0 (x + )] cos nπx [F(x) a 0 ] }{{} =u, du=f (x)dx (F(x) a 0 ) nπ cos nπx }{{ } =dv, v= nπx sin nπ sin nπx } {{ } 0 dx dx 1 a 0 x cos nπx dx }{{} nπ B n = nπ a n is computed similarly (see HW 3.5.5) =0, odd ] f (x) sin nπx dx }{{} =b n fasshauer@iit.edu MATH 461 Chapter 3 87
Proof (cont.) Integration of Fourier Series To compute A 0 we note that Therefore 0 = G() = A 0 + A 0 = [ A n cos nπ A n cos nπ = Putting everything together we get ] + B n sin nπ }{{ } =0 nπ b n cos nπ. F(x) = H(x) + G(x) = a 0 (x + ) + A 0 + A n cos nπx + B n sin nπx which matches the claim of the theorem if we use the representations of A 0, A n and B n. fasshauer@iit.edu MATH 461 Chapter 3 88
Integration of Fourier Series Example Integrate the following Fourier cosine series (see (4)) from 0 to x: x = 2 4 π 2 k=1 1 (2k 1)πx cos (2k 1) 2 Solution We immediately have and x 0 x 0 t dt = x 2 2 2 dt = x 2 fasshauer@iit.edu MATH 461 Chapter 3 89
Integration of Fourier Series Solution (cont.) The remaining part becomes 4 π 2 k=1 1 (2k 1) 2 x 0 cos (2k 1)πt dt = 42 π 3 = 42 π 3 Putting all three parts together we have x 2 = x 82 π 3 k=1 k=1 1 (2k 1)πt sin (2k 1) 3 k=1 1 (2k 1)πx sin (2k 1) 3 1 (2k 1)πx sin (2k 1) 3 Note that this is in agreement with the statement of the theorem. Due to the presence of the linear term x this is not a Fourier (sine) series.. x 0 fasshauer@iit.edu MATH 461 Chapter 3 90
Integration of Fourier Series Solution (cont.) We can interpret x 2 = x 82 π 3 k=1 1 (2k 1)πx sin (2k 1) 3 differently. Namely, we do have the following two sine series: x x 2 = 82 π 3 k=1 1 (2k 1)πx sin (2k 1) 3 and, using the Fourier sine series of f (x) = x (see (1)), x 2 = 2 π ( 1) n+1 k sin nπx 82 π 3 k=1 1 (2k 1)πx sin (2k 1) 3 fasshauer@iit.edu MATH 461 Chapter 3 91
Integration of Fourier Series Example Use the fact established earlier (see (5)) that to show that 1 = 4 π k=1 k=1 1 2k 1 (2k 1)πx sin, 0 < x < 1 (2k 1) 2 = 1 + 1 3 2 + 1 5 2 +... = π2 8. fasshauer@iit.edu MATH 461 Chapter 3 92
Integration of Fourier Series Solution The main idea is to integrate the given identity from 0 to x. For the left-hand side we have while the right-hand side is x 0 4 π k=1 x 1 (2k 1)πt sin dt = 4 2k 1 π = 4 π 2 0 1 dt = x, = 4 π 2 1 x (2k 1)πt sin dt 2k 1 0 x 1 (2k 1)πt cos (2k 1) 2 k=1 k=1 [ ] 1 (2k 1) 2 1 (2k 1)πx cos (2k 1) 2 k=1 0 fasshauer@iit.edu MATH 461 Chapter 3 93
Integration of Fourier Series Solution (cont.) Therefore, splitting into two series, x = 4 π 2 k=1 1 (2k 1) 2 4 π 2 k=1 This is a cosine series with constant term A 0 = 4 π 2 k=1 and we can now conclude that k=1 1 (2k 1) 2 = 1 1 (2k 1)πx cos (2k 1) 2 1 (2k 1) 2 = π2 4 2 = π2 8. 0 x dx = 2,. fasshauer@iit.edu MATH 461 Chapter 3 94
Integration of Fourier Series Solution (cont.) Alternatively, we could have evaluated the series expansion x = 4 1 π 2 (2k 1) 2 4 1 (2k 1)πx π 2 cos (2k 1) 2 k=1 k=1 for some special value of x. For example, for x = we get = 4 π 2 so that = 4 π 2 = 2 4 π 2 k=1 k=1 1 (2k 1) 2 4 π 2 1 (2k 1) 2 4 π 2 k=1 k=1 k=1 1 (2k 1) 2 1 (2k 1)π cos (2k 1) 2 1 cos(2k 1)π (2k 1) 2 }{{} = 1 k=1 1 (2k 1) 2 = π2 8. fasshauer@iit.edu MATH 461 Chapter 3 95
Integration of Fourier Series Solution (cont.) For x = 2 we get 2 = 4 π 2 = 4 π 2 k=1 k=1 1 (2k 1) 2 4 π 2 1 (2k 1) 2 4 π 2 k=1 k=1 1 (2k 1) 2 cos (2k 1)π 2 1 (2k 1) 2 cos(2k 1)π 2 }{{} =0 so that 2 = 4 π 2 k=1 1 (2k 1) 2 k=1 1 (2k 1) 2 = π2 8. fasshauer@iit.edu MATH 461 Chapter 3 96
Integration of Fourier Series Example The Basel problem, first proved by eonhard Euler in 1735: 1 n 2 = π2 6 One can prove this as we did for the squares of odd integers above. Here we evaluate the Fourier series of f (x) = x 2, x 2 = 2 3 + 42 π 2 at x =. ( 1) n See [Proofs from THE BOOK] for three different proofs. n 2 cos nπx, fasshauer@iit.edu MATH 461 Chapter 3 97
Complex Form of Fourier Series Fourier series are often expressed in terms of complex exponentials instead of sines and cosines. The main ingredient for understanding this translation in notation is Euler s formula e iθ = cos θ + i sin θ. This, of course, implies and so e iθ = cos θ i sin θ, cos θ = eiθ + e iθ 2 sin θ = eiθ e iθ. 2i fasshauer@iit.edu MATH 461 Chapter 3 99
Complex Form of Fourier Series We can therefore rewrite the Fourier series as f (x) a 0 + f (x) a 0 + = a 0 + 1 2 [a n e i nπx [ a n cos nπx [( a n + b n i nπx i + e 2 + b n sin nπx ] e i nπx + b n ) ( e i nπx + a n b n i ] nπx i e 2i ) e nπx i ] fasshauer@iit.edu MATH 461 Chapter 3 100
Complex Form of Fourier Series We break this into two series and use 1 i = i to arrive at f (x) a 0 + 1 2 (a n ib n ) e i nπx + 1 2 nπx i (a n + ib n ) e Now we perform an index transformation, n n, on the first series to get f (x) a 0 + 1 2 n= 1 nπx i (a n ib n ) e + 1 2 Note that, using the symmetries of cosine and sine, a n = 1 b n = 1 f (x) cos ( n)πx f (x) sin ( n)πx nπx i (a n + ib n ) e dx = a n dx = b n fasshauer@iit.edu MATH 461 Chapter 3 101
We can therefore rewrite as f (x) a 0 + 1 2 f (x) a 0 + 1 2 Complex Form of Fourier Series n= 1 n= 1 If we introduce new coefficients nπx i (a n ib n ) e + 1 2 nπx i (a n + ib n ) e + 1 2 c 0 = a 0 and c n = a n + ib n 2 then we get the exponential form of the Fourier series nπx i f (x) c n e with Fourier coefficients c 0 = 1 2 n= f (x) dx nπx i (a n + ib n ) e nπx i (a n + ib n ) e fasshauer@iit.edu MATH 461 Chapter 3 102
Complex Form of Fourier Series and c n = a n + ib n [ 2 = 1 2 = 1 2 = 1 2 f (x) cos nπx dx + i f (x) f (x)e i nπx [ cos nπx dx nπx + i sin f (x) sin nπx ] dx dx ] Note that this formula also gives the correct value for c 0. Remark Sometimes the formula for the Fourier coefficients c n is referred to as the finite Fourier transform of f. fasshauer@iit.edu MATH 461 Chapter 3 103
References I Appendix References Aigner, Martin, Günter M. Ziegler, and Karl H. Hofmann. Proofs from THE BOOK (4th Ed.). Springer, 2009. J. W. Brown and R. V. Churchill. Fourier Series and Boundary Value Problems. McGraw-Hill (5th ed.), New York, 1993. R. Haberman. Applied Partial Differential Equations. Pearson (5th ed.), Upper Saddle River, NJ, 2012. M. A. Pinsky. Partial Differential Equations and Boundary-value Problems with Applications. American Mathematical Society (reprint of 3rd ed.), Providence, RI, 2011.. N. Trefethen. Approximation Theory and Approximation Practice. Society of Industrial and Applied Mathematics, Philadelphia, PA, 2012. fasshauer@iit.edu MATH 461 Chapter 3 104