[Notes on Diffy Qs home] [PDF version] [Buy paperback on Amazon]

[next] [prev] [prev-tail] [tail] [up]

4.3 More on the Fourier series

Note: 2 lectures, §9.2–§9.3 in [EP], §10.3 in [BD]

4.3.1 2L -periodic functions

We have computed the Fourier series for a 2π -periodic function, but what about functions of different periods. Well, fear not, the computation is a simple case of change of variables. We can just rescale the independent axis. Suppose we have a 2L -periodic function f (t) . Then L is called the half period. Let s = πt L . Then the function

 ( ) g(s) = f L-s π

is 2π -periodic. We must also rescale all our sines and cosines. In the series we use πLt as the variable. That is, we want to write

|-------------∞-------(---)--------(----)--| | a0- ∑ nπ- nπ- | | f(t) = 2 + an cos L t + bnsin L t . | -------------n=1----------------------------

If we change variables to s we see that

 ∑∞ g(s) = a-0+ an cos(ns) + bnsin(ns). 2 n=1

We compute an and bn as before. After we write down the integrals, we change variables from s back to t , noting also that  π ds = L dt .

|----------------------------------------------------| | 1 ∫ π 1 ∫ L | | a0 = -- g(s) ds =-- f(t) dt, | | π ∫−π L −L ∫ | | 1- π 1- L (n-π ) | | an = π g(s)cos(ns) ds = L f(t)cos L t dt, | | ∫−ππ ∫ −LL ( ) | | b = 1- g(s)sin(ns) ds = 1- f(t) sin nπt dt. | | n π −π L −L L | -----------------------------------------------------

The two most common half periods that show up in examples are π and 1 because of the simplicity of the formulas. We should stress that we have done no new mathematics, we have only changed variables. If you understand the Fourier series for 2π -periodic functions, you understand it for 2L -periodic functions. You can think of it as just using different units for time. All that we are doing is moving some constants around, but all the mathematics is the same.

Example 4.3.1: Let

f(t) = |t| for − 1 < t ≤ 1,

extended periodically. The plot of the periodic extension is given in Figure 4.8. Compute the Fourier series of f(t) .


PIC

Figure 4.8: Periodic extension of the function f(t) .


We want to write  a0 ∑ ∞ f(t) = 2 + n=1an cos(nπt) + bnsin (n πt) . For n ≥ 1 we note that |t|cos(nπt) is even and hence

 ∫ 1 an = f (t)cos(nπt) dt −1 ∫ 1 = 2 tcos(nπt) dt 0 ∫ [ t ]1 1 1 = 2 ---sin(nπt) − 2 ---sin(nπt) dt nπ t=0 0 n( π ) ( -1--[ ]1 2-(−1)n-−-1- ||{ 0 if n is even, = 0 + n2π2 cos(n πt) t=0 = n2π2 = ||( -−4- n2π2 if n is odd.

Next we find a0

 ∫ 1 a0 = |t| dt = 1. −1

You should be able to find this integral by thinking about the integral as the area under the graph without doing any computation at all. Finally we can find bn . Here, we notice that |t|sin (nπt) is odd and, therefore,

 ∫ 1 bn = f(t)sin(nπt) dt = 0. −1

Hence, the series is

1- ∑∞ -−4-- 2 + n2π2 cos(nπt). nn=o1dd

Let us explicitly write down the first few terms of the series up to the  rd 3 harmonic.

1 4 4 -− -2 cos(πt) −--2 cos(3πt) − ⋅⋅⋅ 2 π 9 π

The plot of these few terms and also a plot up to the  th 20 harmonic is given in Figure 4.9. You should notice how close the graph is to the real function. You should also notice that there is no “Gibbs phenomenon” present as there are no discontinuities.


PICPIC

Figure 4.9: Fourier series of f(t) up to the 3rd harmonic (left graph) and up to the 20th harmonic (right graph).


4.3.2 Convergence

We will need the one sided limits of functions. We will use the following notation

f(c−) = lim f(t), and f(c+ ) = lim f (t). t↑c t↓c

If you are unfamiliar with this notation, limt ↑c f(t) means we are taking a limit of f(t) as t approaches c from below (i.e. t < c ) and limt↓cf (t) means we are taking a limit of f(t) as t approaches c from above (i.e. t > c ). For example, for the square wave function

 (| f(t) = |{0 if −π < t ≤ 0, ||(π if 0 < t ≤ π,
(4.8)

we have f (0 −) = 0 and f(0+ ) = π .

Let f (t) be a function defined on an interval [a,b] . Suppose that we find finitely many points a = t0 , t1 , t2 , …, tk = b in the interval, such that f (t) is continuous on the intervals (t0,t1) , (t ,t ) 1 2 , …, (t ,t ) k−1 k . Also suppose that all the one sided limits exist, that is, all of f(t +) 0 , f (t1−) , f (t1+) , f (t2−) , f (t2+) , …, f(tk− ) exist and are finite. Then we say f (t) is piecewise continuous.

If moreover, f (t) is differentiable at all but finitely many points, and f′(t) is piecewise continuous, then f(t) is said to be piecewise smooth.

Example 4.3.2: The square wave function (4.8) is piecewise smooth on [− π,π] or any other interval. In such a case we simply say that the function is piecewise smooth.

Example 4.3.3: The function f (t) = |t| is piecewise smooth.

Example 4.3.4: The function f (t) = 1 t is not piecewise smooth on [− 1,1] (or any other interval containing zero). In fact, it is not even piecewise continuous.

Example 4.3.5: The function  √3- f(t) = t is not piecewise smooth on [−1,1] (or any other interval containing zero). f (t) is continuous, but the derivative of f(t) is unbounded near zero and hence not piecewise continuous.

Piecewise smooth functions have an easy answer on the convergence of the Fourier series.

Theorem 4.3.1. Suppose f(t) is a 2L -periodic piecewise smooth function. Let

 ∑∞ ( ) ( ) a0+ ancos nπt + bn sin nπt 2 n=1 L L

be the Fourier series for f(t) . Then the series converges for all t . If f(t) is continuous near t , then

 a0 ∑∞ (nπ ) (nπ ) f(t) =---+ an cos ---t + bnsin ---t . 2 n=1 L L

Otherwise

 ∞∑ ( ) ( ) f-(t−-) +-f(t+) = a0-+ a co s nπt + b sin nπ-t. 2 2 n=1 n L n L

If we happen to have that f (t) = f(t−)+2f(t+) at all the discontinuities, the Fourier series converges to f (t) everywhere. We can always just redefine f (t) by changing the value at each discontinuity appropriately. Then we can write an equals sign between f(t) and the series without any worry. We mentioned this fact briefly at the end last section.

Note that the theorem does not say how fast the series converges. Think back to the discussion of the Gibbs phenomenon in the last section. The closer you get to the discontinuity, the more terms you need to take to get an accurate approximation to the function.

4.3.3 Differentiation and integration of Fourier series

Not only does Fourier series converge nicely, but it is easy to differentiate and integrate the series. We can do this just by differentiating or integrating term by term.

Theorem 4.3.2. Suppose

 a0 ∑∞ (nπ ) (nπ ) f (t) = --+ ancos --t + bn sin --t 2 n=1 L L

is a piecewise smooth continuous function and the derivative f ′(t) is piecewise smooth. Then the derivative can be obtained by differentiating term by term,

 ∑∞ ( ) ( ) f ′(t) = −ann-πsin n-πt + bnnπ-cos nπt . n=1 L L L L

It is important that the function is continuous. It can have corners, but no jumps. Otherwise the differentiated series will fail to converge. For an exercise, take the series obtained for the square wave and try to differentiate the series. Similarly, we can also integrate a Fourier series.

Theorem 4.3.3. Suppose

 a0 ∑∞ (nπ ) (nπ ) f (t) = --+ ancos --t + bn sin --t 2 n=1 L L

is a piecewise smooth function. Then the antiderivative is obtained by antidifferentiating term by term and so

 a0t ∑∞ anL (nπ ) − bnL (nπ ) F(t) = ---+ C + ----sin --t + ----- cos ---t , 2 n=1 nπ L nπ L

where F ′(t) = f (t) and C is an arbitrary constant.

Note that the series for F (t) is no longer a Fourier series as it contains the a0t 2 term. The antiderivative of a periodic function need no longer be periodic and so we should not expect a Fourier series.

4.3.4 Rates of convergence and smoothness

Let us do an example of a periodic function with one derivative everywhere.

Example 4.3.6: Take the function

 ( ||{ (t + 1)t if − 1 < t ≤ 0, f(t) = ||( (1 − t)t if 0 < t ≤ 1,

and extend to a 2-periodic function. The plot is given in Figure 4.10.


PIC

Figure 4.10: Smooth 2-periodic function.


Note that this function has one derivative everywhere, but it does not have a second derivative whenever t is an integer.

Exercise 4.3.1: Compute  ′′ f (0 +) and  ′′ f (0−) .

Let us compute the Fourier series coefficients. The actual computation involves several integration by parts and is left to student.

 ∫ 1 ∫ 0 ∫ 1 a = f(t) dt = (t + 1)t dt + (1 − t)t dt = 0, 0 −1 −1 0 ∫ 1 ∫ 0 ∫ 1 an = f(t)cos(nπt) dt = (t + 1)tcos(nπt) dt + (1 − t)tcos(n πt) dt = 0 −1 −1 0 ∫ 1 ∫ 0 ∫ 1 bn = f(t)sin (n πt) dt = (t + 1)t sin(nπt) dt + (1 − t)tsin (nπt) dt −1 ( −1 0 4(1 − (−1)n) ||{-833 if n is odd, = ----3-3-----= ||π n π n (0 if n is even.
That is, the series is
 ∞ ∑ --8-- π 3n 3 sin(n πt). nno=d1d

This series converges very fast. If you plot up to the third harmonic, that is the function

8-- --8-- π3 sin(πt) + 27π 3 sin (3 πt),

it is almost indistinguishable from the plot of f(t) in Figure 4.10. In fact, the coefficient -8-3 27π is already just 0.0096 (approximately). The reason for this behavior is the  3 n term in the denominator. The coefficients bn in this case go to zero as fast as  3 1∕n goes to zero.

For functions constructed piecewise from polynomials as above, it is generally true that if you have one derivative, the Fourier coefficients will go to zero approximately like 1 3 ∕n . If you have only a continuous function, then the Fourier coefficients will go to zero as 1∕n2 . If you have discontinuities, then the Fourier coefficients will go to zero approximately as 1∕n . For more general functions the story is somewhat more complicated but the same idea holds, the more derivatives you have, the faster the coefficients go to zero. Similar reasoning works in reverse. If the coefficients go to zero like 1∕n2 you always obtain a continuous function. If they go to zero like 1 3 ∕n you obtain an everywhere differentiable function.

To justify this behavior, take for example the function defined by the Fourier series

 ∞ ∑ 1-- f(t) = n3 sin(nt). n=1

When we differentiate term by term we notice

 ′ ∑∞ 1-- f(t) = n2 cos(nt). n=1

Therefore, the coefficients now go down like 1∕n2 , which means that we have a continuous function. The derivative of f ′(t) is defined at most points, but there are points where f ′(t) is not differentiable. It has corners, but no jumps. If we differentiate again (where we can) we find that the function f′′(t) , now fails to be continuous (has jumps)

 ′′ ∞∑ − 1 f (t) = -n-sin(nt). n=1

This function is similar to the sawtooth. If we tried to differentiate the series again we would obtain

∑∞ − cos(nt), n=1

which does not converge!

Exercise 4.3.2: Use a computer to plot the series we obtained for f(t) , f ′(t) and f′′(t) . That is, plot say the first 5 harmonics of the functions. At what points does f′′(t) have the discontinuities?

4.3.5 Exercises

Exercise 4.3.3: Let

 (| |{0 if −1 < t ≤ 0, f(t) = ||(t if 0 < t ≤ 1,

extended periodically. a) Compute the Fourier series for f(t) . b) Write out the series explicitly up to the 3rd harmonic.

Exercise 4.3.4: Let

 ( ||{−t if − 1 < t ≤ 0, f (t) = || 2 (t if 0 < t ≤ 1,

extended periodically. a) Compute the Fourier series for f(t) . b) Write out the series explicitly up to the  rd 3 harmonic.

Exercise 4.3.5: Let

 (||−t f (t) = {|10 if −10 < t ≤ 0, |(1t0 if 0 < t ≤ 10,

extended periodically (period is 20). a) Compute the Fourier series for f (t) . b) Write out the series explicitly up to the  rd 3 harmonic.

Exercise 4.3.6: Let  ∑ f (t) = ∞n=1 1n3-cos(nt) . Is f(t) continuous and differentiable everywhere? Find the derivative (if it exists everywhere) or justify why f(t) is not differentiable everywhere.

Exercise 4.3.7: Let f(t) = ∑ ∞ (−1)nsin(nt) n=1 n . Is f(t) differentiable everywhere? Find the derivative (if it exists everywhere) or justify why f(t) is not differentiable everywhere.

Exercise 4.3.8: Let

 ( ||||0 if −2 < t ≤ 0, |{ f(t) = ||||t if 0 < t ≤ 1, |(−t + 2 if 1 < t ≤ 2,

extended periodically. a) Compute the Fourier series for f(t) . b) Write out the series explicitly up to the  rd 3 harmonic.

Exercise 4.3.9: Let

f(t) = et for − 1 < t ≤ 1

extended periodically. a) Compute the Fourier series for f(t) . b) Write out the series explicitly up to the 3rd harmonic. c) What does the series converge to at t = 1 .

Exercise 4.3.10: Let

 2 f(t) = t for − 1 < t ≤ 1

extended periodically. a) Compute the Fourier series for f (t) . b) By plugging in t = 0 , evaluate ∞∑ (−1-)n 1- 1- n2 = 1 − 4 + 9 − ⋅⋅⋅ n=1 . c) Now evaluate ∑∞ -1- 1- 1- n 2 = 1 + 4 + 9 + ⋅⋅⋅ n=1 .

Exercise 4.3.101: Let

 2 f(t) = t for − 2 < t ≤ 2

extended periodically. a) Compute the Fourier series for f(t) . b) Write out the series explicitly up to the 3rd harmonic.

Exercise 4.3.102: Let

f (t) = t for − λ < t ≤ λ (for some λ > 0)

extended periodically. a) Compute the Fourier series for f(t) . b) Write out the series explicitly up to the 3rd harmonic.

Exercise 4.3.103: Let

 ∞ 1- ∑ ----1---- f (t) = 2 + n(n2 + 1) sin(nπt). n=1

Compute f′(t) .

Exercise 4.3.104: Let

 ∑∞ f(t) = 1-+ 1-co s(nt). 2 n3 n=1

a) Find the antiderivative. b) Is the antiderivative periodic?

Exercise 4.3.105: Let

f(t) = t∕2 for −π < t < π

extended periodically. a) Compute the Fourier series for f(t) . b) Plug in  π t = ∕2 to find a series representation for π∕4 . c) Using the first 4 terms of the result from part b) approximate π∕4 .