# Lecture 16: Continuation: More General Periods

Flash and JavaScript are required for this feature.

Topics covered: Continuation: More General Periods; Even and Odd Functions; Periodic Extension.

Instructor/speaker: Prof. Arthur Mattuck

Okay, that's, so to speak, the text for today. The Fourier series, and the Fourier expansion for f of t, so f of t, if it looks like this should be periodic, and two pi should be a period. Sometimes people rather sloppily say periodic with period two pi, but that's a little ambiguous. So, this period could also be pi or a half pi or something like that as well.

The an's and bn's are calculated according to these formulas. Now, we're going to need in just a minute a consequence of those formulas, which, it's not subtle, but because there are formulas for an and bn, it follows that once you know f of t, the an's and bn's are determined. Or, to put it another way, a function cannot have two different Fourier series.

Or, to put it yet another way, if f of t, if two functions are equal, you'll see why I write it in this rather peculiar form. Then, the Fourier series for f is the same as the Fourier series for g.

And, the reason is because if f is equal to g, then this integral with an f there is the same as the integral with a g there. And therefore, the an's come out to be the same.

In the same way, the bn's come out to be the same. So, the Fourier series are the same, coefficient by coefficient, for f and g.

Now, my ultimate goal-- let's all put down the argument since there are formulas, since we have formulas for an and bn. Now, a consequence of that is, well, let me first say, what I'm aiming at is you will be amazed at how long it's going to take me to get to this.

I just want to calculate the Fourier series for some rather simple periodic function. It's going to look like this.

So, here's pi, and here's negative pi.

So, the function which just looks like t in between those two, so, it goes up to, it's a function, t, more or less, goes up to pi here, minus pi there. But, of course, it's got to be periodic of period two pi.

Well, then, it just repeats itself after that.

After this, it just does that, and so on.

It's a little ambiguous what happens at these endpoints.

Well, let's not worry about that for the moment, and frankly, it won't really matter because the integrals don't care about what happens in individual points. So, there's my f of t.

Now, I, of course, could start doing it right away. But, you will quickly find, if you start doing these problems and hacking around with them, that the calculations seem really quite long.

And therefore, in the first half of the period, the first half of the period I want to show you how to shorten the calculations. And in the second half of the period, after we've done that and calculated this thing successfully, I hope, I want to show you how to remove various restrictions on these functions, how to extend the range of Fourier series.

Well, one obvious thing, for example, is suppose the function isn't periodic of period two pi.

Suppose it has some other period.

Does that mean there's no formula?

Well, of course not. There's a formula.

But, we need to know what it is, particularly in the applications, the period is rarely two pi.

It's normally one, or something like that.

But, let's first of all, I'm sure what you will appreciate is how the calculations can get shortened.

Now, the main way of shortening them is by using evenness and oddness. And, what I claim is this, that if f of t is an even function, remember what that means, that f of negative t is equal to f of t. Cosine is a good example, of course, cosine nt; are all these functions are even functions. If f of t is even, then its Fourier series contains only the cosine terms.

In other words, half the calculations you don't have to do if you start with an even function.

That's what I mean by shortening the work.

There are no odd terms, or let's put it positively.

All the bn's are zero. Now, one way of doing this would be to say, well, y to the bn zero, well, we've got formulas, and fool around with the formula for the bn, and think about a little bit, and finally decide that that has to come out to be zero.

That's not a bad way, and it would remind you of some basic facts about integration, about integrals.

Instead of doing that, I'm going to apply my little principle that if two functions are the same, then their Fourier series have to be the same.

So, the argument I'm going to give is this, so, I'm going to try to prove this statement now.

And, I'm going to use the facts on the first board to do it.

So, what is f of minus t?

Well, if that's equal to f of t, then in terms of the Fourier series, how do I get the Fourier series for f of minus t? Well, I take the Fourier series for f of t, and substitute t equals minus t.

Now, what happens when I do that?

So, the Fourier series for this looks like a zero over two plus summation what? Well, the an cosine nt, that does not change because when I change t to negative t, the cosine nt does not change, stays the same because it's an even function.

What happens to the sine term? Well, the sine of negative nt is equal to minus the sine of nt.

So, the other terms, the sine terms change sign.

So, all that's the result of substituting t for negative t and f of t.

On the other hand, what's f of t itself?

Well, f of t itself is what happened before that.

Now it's got a plus sign because nothing was done to the series. Well, if the function is even, then those two right hand sides are the same function.

In other words, they're like my f of t equals g of t. And therefore, the Fourier series on the left must be the same.

In other words, if these are equal, therefore, these have to be equal, too.

Now, there's no problem with the cosine terms.

They look the same. On the other hand, the sine terms have changed sign.

Therefore, it must be the case that bn is always equal to negative bn for all n. That's the only way this series can be the same as that one. Now, if bn is equal to negative bn, that implies that bn is zero.

Zero is the only number which is equal to its negative. And so, by this argument, in other words, using the uniqueness of Fourier series, we conclude that if the function is even, then its Fourier series can only have cosine terms in it.

Now, you say, hey, that's obvious.

The cosine, that's just a point of logic.

But, this is a mathematics course, after all.

Many of you would say, yeah, of course that's obvious because cosines are even, and the sines are odd.

I say, yeah, and so why does that make it true? Well, the cosine's even.

Plus t into minus t, and what you are proving is the converse. The converse is obvious.

Yeah, obvious, I don't care.

If the right-hand side is the sum of the functions, well, so is the left. But I'm saying it the other way around. If the left is an even function, why does the right-hand side have to have only even terms in it? And, this is the argument which makes that true. Now, there is a further simplification because if you've got an even function, oh, by the way, of course the same thing is true for the odd, I ought to put that down, and so also, if f of t is odd, then I think one of these proofs is enough.

The other you can supply yourself.

That will imply that all the an's are zero, even including this first one, a zero, and by the same reasoning.

So, an even function uses only cosines for its Fourier expansion. An odd function uses only sines. Good.

But, we still have to, suppose we got an even function. We've still got to calculate this integral. Well, even that can be simplified. So, the second stage of the simplification, again, assuming that we have an even or odd function, and by the way, [LAUGHTER]. Totally unauthorized.

So, if f of t is even, what we'd like to do now is simplify the integral a little. And, there is an easy way to do that, because, look, if f of t is an even function, then so is f of t cosine nt, is also even. Imagine, we could make little rules about an even function times an even function is an even function. There are general rules of that type, and some of you know them, and they are very useful.

But, let's just do it ad hoc here.

If I change t to negative t here, I don't change the function because it's even.

And, I don't change the cosine because that's even.

So, if I change t to negative t, I don't change the function.

Either factor that function, and therefore I don't change the product of those two things either.

So, it's also even. Now, what about an even function when you integrate it? Here's a typical looking even function, let's say, something like, I don't know, wiggle, wiggle, again. Here's our better even function. All right, so, minus pi to pi, even, even though the t-axis is somewhat curvy. So, there is an even function.

The point is that if you integrate an even function from negative pi to pi, I think you all know even from calculus you were taught to do this simplification.

Don't do that. Instead, integrate from zero to pi, and double the answer. Why should you do that?

The answer is because it's always nice to have zero as one of the limits of integration. I trust to your experience, I don't have to sell that. Minus pi is a particularly unpleasant lower limit of integration because you are sure to get in trouble with negative signs.

There are bound to be at least three negative signs floating around. And, if you miss one of them, you'll get the wrong signs of answer.

The answer will have the wrong sign.

So, the way the formula from this simplifies is that an, instead of integrating from negative pi to pi, I can integrate only from zero to pi, and double the answer.

So, our better formula is this. If the function is even, this is the formula you should use: zero to pi, f of t cosine nt dt.

Of course, I don't have to tell you what bn should be because bn will be zero.

And, in the same way, if f is odd, the same reasoning shows that bn-- of course, an will be zero this time. But it will be bn that will be two over pi times the integral from zero to pi of f of t sine nt dt.

Maybe we'd better just a word about that since, why is that so?

If it's odd, doesn't that mean things become zero? If you integrate an odd function like that, the integral over minus pi to pi, you get zero. Well, but this is not an odd function. This is an odd function, and this is an odd function. But the product of two odd functions is an even function. Odd times odd is even.

I said I wasn't going to give you those rules, but since this is the one which trips everybody up, maybe I'd better say it just justbecause it looks wrong.

Right, this is odd. That's odd.

Think about it. If I change t to negative t, this multiplies by minus one.

This multiplies by minus one. And therefore, the product multiplies by minus one times minus one.

In other words, it multiplies by plus one.

Nothing happens, so it stays the same.

Why does nobody believe this, even though it's true?

It's because they are thinking about numbers.

Everybody knows that an odd number times an odd number is an odd number. So, I'm not multiplying numbers here, which also I'll put them in boxes to indicate that they are not numbers. How's that?

Brand-new invented notation. The box means caution.

The inside is not a number, it's the word odd or even.

It's just a symbolic statement that the product of an odd function and an odd function is an even function.

Even times even is even. What's odd times even?

Yes, it has to get equal time. Obviously, something must come out to be odd, right.

Okay, so, now that we've got our two simplifications, we are ready to do this problem.

Instead of attacking it with the original formulas, we are going to think about it and attack it with our better formulas. So, now we are going to calculate the Fourier series for f of t.

The first thing I see, so f of t is our little thing here. Well, first of all, what kind of function is it: odd, even, or neither?

Most functions are neither, of course.

But, fortunately in the applications, functions tend to be one or the other.

Or, they can be converted into one to the other.

Maybe if I get a chance, I'll show you a little how, or the recitations will. So, this function is odd.

Okay, half the work just disappeared.

I don't have to calculate any an's.

They will be zero. So, I only have to calculate bn, and I'll calculate them by my better formula.

So, it's two over pi times the integral from zero to pi, and what I have to integrate, well, now, finally you've got to integrate something. From zero to pi, this is the function, t.

So, I have to integrate t times sine of nt dt.

Okay, so this is why you learned integration by parts, one of many reasons why you learned integration by parts, so that you wouldn't have to pull out your little calculators to do this. Okay, now, let's do it.

So, it's two over pi.

Let's solve that away so we can forget about it.

And, what's then left is just the evaluation of the integral between limits. So, if I integrate by parts, I'll want to differentiate the t, and integrate the sign, right? So, the first step is you don't do the differentiation. You only do the integration.

So, that integrates to be cosine nt over n, more or less. The only thing is, if I differentiate this, I get negative sine nt instead of, so, I want to put a negative sign in front of all this. And, I will evaluate that between the limits, zero and pi, and then subtract what you get by doing both things, both the differentiation and the integration.

So, I subtract the integral from zero to pi.

I now differentiate the t, and integrate.

Well, I just did the integration.

That's negative cosine nt over n.

You see how the negative signs pile up?

And, if this is negative pi instead of zero, it's at that point when it starts to lose heart.

You see three negative signs, and then when you substitute, you're going to have to put in still something else negative, and you just have the feeling you're going to make a mistake.

And, you will. Okay, now all we have to do is a little evaluation. Let's see, at the lower limit I get zero, here. Let's right away, as two over pi. At the lower limit, I get zero. That's nice.

At the upper limit, I get minus pi over n times the cosine of n pi.

Now, once and for all, the cosine of n pi-- If you like to make separate steps out of everything, okay, I'll let you do it this time, -- -- but in the long run, it's good to remember that that's negative one to the n'th power The cosine of pi is minus one .

The cosine of two pi is plus one, three pi, minus one, and so on.

So, at the upper limit, we get minus pi over n, oh, I didn't finish the calculation, times the cosine of n pi, which is minus one to the n'th power. And now, how about the other guy? Shall we do in our heads?

What is it? It's plus sine nt, right? So, I combined the two negative signs to a plus sign by putting one this way and the other one that way. And then, if I integrate that now, it's sine nt divided by n squared, right? And that's evaluated between zero and pi. And of course, the sign function vanishes at both ends.

So, that part is simply zero. And so, the final answer is that bn is equal to, well, the pi's cancel.

This minus combines with those n to make one more.

And so, the answer is two over n times minus one to the n plus first power.

And therefore, the final result is that our Fourier series, the Fourier series for f of t, that funny function is, the Fourier series is summation bn, which is two, put the two out front because it's in every term.

There's no reason to repeat it, minus one to the n plus first power over n times the sign of nt.

That's summed from one to infinity. Let's stop and take a look at that for a second. Does that look right?

Okay, here's our function.

Here's our function. What's the first term of this?

When n is one, this is plus one.

So, the first term is sine t.

What's the next term? When n is two, this is negative. So, it's minus one to the third power. So, that's negative one over two. So, it's minus one half sine two t, and then it obviously continues in the same way plus a third sign three t.

Now, watch carefully because what I'm going to say in the next minute is the heart of Fourier series.

I've given you that visual to look at to try to reinforce this, but it's really very important, as you go to the terminal yourself and do that work, simple as it is, and pay attention now. Now, if you think old-fashioned, i.e.

if you think taylor series, you're not going to believe this because you will say, well, let's see, these go on and on. Obviously, it's the first term that's the important one. That's two sine t.

Now, the derivative, two sine t, sine t would exactly follow the pink curve. Sine t would look like this.

Two sine t goes up with the wrong angle.

The first term, in other words, does this. It's going off with the wrong slope. Now, that's the whole point of Fourier series. Fourier series is not trying to approximate the function at zero at the central starting point the way Taylor series do. Fourier series tries to treat the whole interval, and approximate the function nicely over the entire interval, in this case, minus pi to pi, as well as possible.

Taylor series concentrates at this point, does it the best it can at this point. Then it tries, with the next term, to do a little better, and then a little better. The whole philosophy is entirely different. Taylor series are used for analyzing what a function of looks like which you stick close to the base point. Fourier series analyze what a function looks like over the whole interval.

And, to do that, you should therefore aim to, so the first approximation is going to look like that, going to have entirely the wrong slope.

But, the next one will subtract off something which sort of helps to fix it up. I can't draw this.

That's why I'm sending you to the visual because the visual draws them beautifully. And, it shows you how each successive term corrects the Fourier series, and makes the sum a little closer to what you started with.

So, the next guy would, let's see, so it's 2t.

So, I'm subtracting off, probably I'm just guessing, but I don't dare draw this. I haven't prepared to draw it, and I know I'll get it wrong. So, okay, your exercise.

But, it'll look better. It'll go, maybe, something like, let's see, it has to end up...

some of it gets subtracted off...

I don't know what it looks like.

When you use the visual at the computer terminal, I've asked you to use it three times on a variety of functions.

I think this is maybe even one of them.

Notice that you can set the parameter, you can set the coefficients independently. In other words, you can go back and correct your works, improving the earlier coefficients, and it won't affect anything you did before. But, the most vivid way to do it is to try to get, visually, by moving the slider, to try to get the very best value for the first coefficient you can, and look at the curve. Then get the very best value for the second coefficient and see how that improves the approximation, and the third, and so on. And, the point is, watch the approximations approaching the function nicely over the whole interval instead of concentrating all their goodness at the origin the way a Taylor series would.

Now, there is still one mathematical point left.

It's that equality sign, which is wrong.

Why is it wrong? Well, what I'm saying is that if I add that the series, it adds up to f of t.

Now, it almost does but not quite.

And, I'd better give you the rule, the theorem.

Of all the theorems in this course that aren't being proved, this is the one that would be most outside the scope of this course, the one which I would most like to prove, in fact, just because I'm a mathematician but wouldn't dare.

The theorem tells you when a Fourier series converges to the function you started with. And, the essence of it is this.

If f is continuous, is a continuous function, let's give the point, it's confusing just to keep calling it t. If you like, call it t, but I think it would be better to call it t zero just to indicate I'm looking at a specific point.

So, if the function is continuous there, the value of f of t is equal to, the Fourier series converges, and it's equal to its Fourier series, the sum of the Fourier series at t zero.

And, the fact that I can even use the word sum means that the Fourier series converges. In other words, when you add up all these guys, you don't go to infinity or get something which just oscillates around crazily.

They really do add up to something.

Now, if f is not continuous at t zero, this emphatically will not be the case.

It will definitely not, but by far, the kinds of discontinuities which occur in the applications are ones like in this picture, where the discontinuities are jump discontinuities. They are almost always jump discontinuities. And, in that case, in other words, they are isolated.

The function looks good here and here, but there's a break.

Typically, electrical engineers just don't leave a gap because they like, I don't know why. But electrical engineer, and others of his or her ilk would draw that function like this, like a rip saw tooth. Even those vertical lines have no meaning whatever, but they make people look happier. So, if f has a jump discontinuity at t zero, and as I said, that's the most important kind, then f of t, then the Fourier series adds up to, converges to, it converges, and it converges to the mid point of the jump. Let me just write it out in words like that, the midpoint of the jump.

That's the way we'll be using it in this course.

There's a notation for this, and it's in your book.

But, those of you who would be interested in such things would know it anyway. So, let's just call it the midpoint of the jump. So, if I ask you, to what does this converge? In other words, this series, what this shows is that the series, I'll write it out in the abbreviated form, summation minus one to the n plus one over n sine nt, what's the sum of the series?

What is it? Let's call this not little f of t. Let's call it capital F of t.

I want to know, what's the graph of capital F of t?

Well, the initial thing is to say, well, it must be the same as the graph of the function you started with.

And, my answer is almost, but not quite.

In fact, what will its graph look like?

Well, regardless of what definition I made for the endpoints of those pink lines, this function will converge to the following. From here to here, I'll draw it. I won't put in minus pi's.

I'll leave that to your imagination.

So, there's a hole at the end here.

In other words, the end of the line is not included. And, the end of this line, regardless of whether it was included to start with or not, it's not now. And here, similarly, I start it here with a hole, and then go down parallel to the function, t, slope one.

And now, how do I fill in, so the missing places, this is the point, pi.

This is the point, negative pi, and there are similar points as I go out.

Well, since the function is continuous here, the Fourier series will converge to this orange line.

But here, there's a jump discontinuity, and therefore, the Fourier series, this function converges to the midpoint of the jump, in other words, to here.

This function, in other words, converges to this very discontinuous looking function, and rather odd how these points are, I say, but in this case, I can prove to you that it converges here by calculating it. Look, this is the point, pi. What happens when you plug in t equals pi? You get everyone of these terms is zero, and therefore the sum is zero.

So, it certainly converges, and it converges to zero.

Now, that's a general theorem. It's rather difficult to prove.

You would have to take, again, an analysis course.

But, I don't even get to it in the analysis course which I teach. If I had another semester I'd get to it, but I can't get everything.

Anyway, we're not going to get to it this semester to your infinite relief. But, you should know the theorem anyway. People will expect you to know it. Well, that was half the period, and in the remaining half, you're going to stay a long time today. Okay, no, don't panic.

I have to extend the Fourier series.

Okay, let me give you the hurry up version indicating the two ways in which it needs to be extended.

Extension number one -- The period is not two pi, but two times, I'll keep the two just to make the formulas look as similar as possible to the old ones. The period, let's say, instead of two pi, is two times L.

Now, I think you know enough mathematics by this point to sort of, I hope you can sort of shrug and say, well, you know, isn't that just kind of like changing the units on the t-axis?

You're just stretching. Yeah, right.

All you do is make a change of variable.

Now, should we make it nicely? I think I'll give you the final answer, and then I'll try to decide while I'm writing it down how much I'll try to make the argument.

First of all, the main thing to get is, if the period is not pi but L, what are the natural versions of the cosine and sine to use? Use the natural functions.

Natural has no meaning, but it's psychologically important. In other words, what kind of function should replace that?

I'll certainly have a t here. What do I put in front?

I'll keep the n also. The question is, what do I fix? What should I put here in between in order to make the thing come out, so that it has period 2L? You probably should learn to do this formally as well as just sort of psyching it out, and taking a guess, or memorizing the answer.

If this is the t-axis, here is t and L, zero and L. What you want to do is make a change of variable to the u-axis where the axis is the same.

This is still the point. But, L, now, on the u coordinate, has the name pi.

Now, so I'm just describing a change of variable on the axis.

What's the one that does this? Well, when t is L, u should be pi. So, t should be L over pi.

When u is pi, t is L, and vice versa. How about expressing u in terms, well, then u is equal to pi over L times t.

That's the backwards form of writing it, or the forward form, depending upon how you like to think of these things. Okay, so the cosine should be pi over L times t, in order that when t be L, it should be like cosine of n pi, which is what we would have had.

So, if t is equal to L, in other words, where is this from? What am I trying to say?

That's the function. This one is probably a little easier to see. Where is this one zero?

The sine functions that we used before was zero at zero pi, two pi, three pi. Where is this one zero?

It's zero at zero. When t is equal to L, it's zero. When t is equal to 2L, so, this is the right thing.

So, it's zero. It's periodic, and it's zero plus or minus L plus or minus 2L.

And, in fact, formally you can verify that it's periodic with period 2L. So, in other words, we want a Fourier expansion to use these functions as the natural analog of what would be up there.

So, the period of our function is 2L, and the formula is, I'll give you the formula. It's f of t equals identical summation, an, except you'll use these as the natural functions instead of cosine nt and sine nt. So, n pi t over L plus bn, okay, I'm tired, but I'll put it in anyway, n pi t over L.

Yeah, but of course, what about the formulas for an?

Somebody up there is watching over us.

Here are the formulas. They are exactly what you would guess if somebody said produce the formulas in ten seconds, and you'd better be right, and you didn't have time to calculate. You say, well, it must be, let's do the cosine series.

Okay, let's not do a cosine. So, it's one over L times the integral from negative L, in other words, wherever you see an L, wherever you see a pi, just put an L times the f of t cosine, and now we'll use our new function, not the old one.

I submit that's an easy, if you know the first formula, then this would be an easy one to remember.

All you do is change pi to L everywhere.

Except, you got to remember this part.

Make it a function periodic of period 2L, not 2pi.

And similarly, bn is similar.

It looks just the same way. And, how about, and the same even-odd business goes, too, so that if f of t, for example, is even, and has period 2L, then the function, then the best formula for the an will not be that one. It will be two over L, and where you integrate only from zero to L, f of t cosine.

So, now, the bn's will be zero, and you'll just have positive, etc. for L.

As I say, this is important case, particularly if the period is two, in other words, if the half period is one because in the literature, frequently one is used as the standard normal reference, not pi.

Pi is convenient mathematically because it makes the cosines and sines look simple. But, in actual calculation, it tends to be where L is one. So, usually you have a pi here.

You don't have just nt. Well, I should do a calculation, but instead of doing that, let me give you the other extension. Fortunately, there are plenty of calculations in your book.

So, let me give you in the last couple of minutes the other extension. This is going to be a very important one for us next time. Typically, in applications, well, I mean, the first thing, periodic functions are nice, but let's face it.

Most functions aren't periodic, I have to agree.

So, all this theory is just about periodic functions?

Really, it's about functions where the interval on which you are interested in them is finite.

It's a finite interval, not functions which go to infinity. For those, you will have to use Fourier transforms, Fourier transforms, not Fourier series. But, if you are interested in a function on a finite interval, then you can use Fourier series even though the function isn't periodic because you can make it periodic. So, what you do is, if f of t is on, let's take the interval from zero to L. That's a sample finite interval. I can always change the variable to make the interval from zero to L.

I can even make it from zero to one, but that's a little too special. It would be a little awkward.

So, if a function is defined on a finite interval, the way to apply the Fourier series to it is make a periodic extension. Now, since I have so little time, I'm just going to get away with murder by just drawing pictures. So, let me give you a function.

Here's my function defined on zero to L, colored chalk if you please. Let's make it the function t squared, and let's make L equal to one.

That function is not periodic. If I let it go off, it would just go off to infinity and never repeat its values, except on the left-hand side.

But, I'm not even going to let it be on the left hand side.

It's only defined from zero to one as far as I'm concerned.

Okay, that function has an even periodic extension.

And, its graph looks like this extended to be an even function.

Okay, now, that means from zero to negative L, you've got to make it look exactly as it looked on the right-hand side. Otherwise, it would be even.

And now, what do I do? Well, now I've got, from minus L to L. So, all I'm allowed to do is keep repeating the values. In other words, apply the theory of Fourier series to this guy, use a cosine series because it's an even function, and then everything you want to do, you say, okay, all the rest of this is garbage.

I only really care about it from here to here.

And, that's what you will plug into your differential equation on the right-hand side, just that part of it, just this part of it. How about the odd extension?

What would that look like? Okay, the odd extension, here I start like this. And now, to extend it to be an odd function, I have to make it go down in exactly the same way it went up. And, what do I do here?

I have to make it start repeating its values so it will look like this. So, the odd extension is going to be discontinuous in this case.

And, what's the Fourier series going to converge to?

Well, in each case, to the average, to the midpoint of the jump, and the odd extension looks like this, and this will give me assigned series.

Okay, you've got lots of problems to do.