 Hello, I'm Simon Benjamin, and this is lecture one of my course on Fourier series, Fourier transforms, a little bit of Fourier transforms, and partial differential equations. This is a, I really enjoy teaching this because it's a very visual and intuitive kind of mathematics, which gives us a set of tools, the Fourier series stuff, which then allow us to tackle a bunch of very interesting and otherwise very hard problems, which become super easy because of the tools we've learned. So it's, I like it, it's eight lectures in all, and this is number one. In this first lecture we're going to remind ourselves what even odd and periodic functions are, what are those terms mean, and then we'll start exploring Fourier series. Now, along with this course goes some notes that explain things that I'm saying in a slightly different way and contain a lot of the equations and examples that we'll look at, and so for those notes, they are available online in a bunch of different places, but if you have trouble finding them, go to SimonB.info, and that is where you'll always be able to find the notes that go with this course. I'll make sure they're there, and you might like to have a copy and work through as we go through the lecture. Alright, let's begin. So, what is an even function? What does that phrase mean? Let me just draw a couple of examples, and I think that will nail it for us. So I'm going to throw out my axes, just x and y axes. Come on, let's make it nice and straight, using iPad's cheap mode. Now I'm going to draw on a function, and this function is just going to be a sort of, well, let's start with a sensible function, the best of my ability to sketch it, which is not very great. So that's the side, and now I'll try and suggest. Yeah, that'll do. It's not amazing. So what I'm trying to draw, now it looks, what I'm trying to draw here is just x squared. So my axes are x and f of x. x squared is an even function. An even function is one where you get the same result from feeding in x and minus x. x squared is a great example, because of course when we square something we lose the sign. Minus two squared is four, same as plus two squared. So in general an even function f of x, or we can say f of minus x is equal to just f of x. That is an even function. What's another example of an even function that we could quickly think of? Well, we could go over to periodic functions if we want to, and then the obvious even function to think about would be cos. Move things around a bit. Cheating. I'm not stop cheating. Just being neat. Okay, here I go with my cos sketch. That's pretty poor. That'll do. So cos of course goes from plus one to minus one, and oscillates and completes one period in when x goes from zero to two pi. But for our present purpose is the interesting thing about cos. Not very happy with the sketch. The interesting thing about cos is that it gives us the same thing, whether we feed in an angle or the minus of that angle. So in other words, yes, cos of minus x is equal to cos of x. That is a second then even function. Even functions. There we are. All right, let's talk about the odd function or the family of functions that are odd rather than even. And so I've given myself a new pair of new set of axes down here. Let's just draw on some examples. The easiest example I can think of of an odd function is just f of x is equal to x. So just a diagonal line on our diagram. f of x equals x. Now the reason for that is being an odd function is that the magnitude is the same for if we change the sign of x, the magnitude of our function stays the same, but it changes its sign. So in other words, f of minus x is equal to minus f of x. And of course is the case if it is x itself. But another example, well, let's go on to our trigometric functions. We've already had cos. Of course, the partner to cos is sine and sine is an odd function. It could be difficult to draw. Considering this course needs a lot of sine and cos stuff in it, we'll have to hope that I get a bit better at sketching them as we go along. That's not too terrible. It's a little bit better than my cos actually, I think. Let me grab it. I haven't quite got it on the origin there. Which is the crucial point. So our sine function, of course, has the property that sine of x or sine of minus x is just minus sine of x and therefore it is an odd function. We could carry on and add further lines on here. The next thing I'd be inclined to try and draw on would be x cubed, which of course recovers. So x, cares about its sine, x squared loses the sine, x cubed again cares about the sine. But I think that's probably made the point clearly enough. An interesting point about a odd function is certainly if it's continuous, it needs to go through the origin. Because if you think about it, if it's a smoothly changing function and it has to get from a value for a positive x to the minus of that value for negative x, then as we approach the origin, we're just going to have to go through zero. Okay, so now, how would we formally, we've already put down sine and cos as a couple of our examples. That's led us into periodic functions, which is what we'll be thinking about a lot. How do we write down the fact that a function is periodic in a sort of neat, neat way as an assertion? What we would write is that a function is periodic with period p if f of x plus p is just equal to f of x. And we understand this to mean for all values of x in all the expressions I've written up to now defining even, odd, and now periodic functions. Of course, we don't mean this to for just some particular value of x. We mean that for any value of x, if we add on p, we just get f of x back again. So that's, in fact, copy my reasonably good sine, sine of course being a example of a periodic function. Let's just duplicate that sine function from above. Let me shrink it a little bit. Get fit. And so what we're saying is that any point that we choose on here, if we look ahead, a distance of p will find, we must find the same point. So we can show this by just doing this little trick. As we add on p, we must always go ahead to obtain the same value. Or we would if my drawing was perfect, which of course it isn't. That's not too bad. So that was just a brief recap on even functions, odd functions, and periodic functions. Now, it's time to play around with the ingredients of the Fourier series. The Fourier series is a sum of sines and causes and maybe a constant. That's it. Sines and causes are functions that we're pretty familiar with. We've been sketching them. What does it mean to add them together? Well, let's think about what happens if we add together a sine function and another sine function. And I think for this, the best thing to do is switch over to a math package that allows me to just type stuff in and we'll plot it and now the diagrams will actually look smart and accurate. Okay, so I'm gonna just stick my iPad on with its keyboard. So I've come over here to a maths package. It's actually the package called Mathematica, which is a very powerful and general maths package, and it doesn't actually run on an iPad. But what I'm doing is I'm looking at the desktop of another machine on my iPad so that I can do everything on the same device for you. Let's create a function and we'll just make it a good old, I don't know, cos of x and we'll then plot it. And I guess that the notation here is fairly obvious. We're gonna plot from minus 10 to 10 and we will need to just shrink that down a little bit so it doesn't fill the whole screen. There we are. Well, there we are. That's a cos function and a nicer one than I was able to draw for you. When I was sketching. But let's now put together that cos function with another one. So I'll add on and I'm just gonna randomly essentially mash the keyboard here. I'll wait the second cos function by a different amount and I'll also change the frequency by boosting it up by this other number that I'm just mashing in here. What will happen now? So we're putting in a second cos function. What do we expect to see? Let's just find out. Okay. Yeah, it doesn't seem to have made very much difference. Let's look, I mean it has made a difference, of course, in that now it's not a simple cos anymore. But let's zoom out a little bit and look from say minus 20 to 20. See what we get. Okay. We seem to have here a function that actually looks quite, so it's still an even function. And that's not surprising because we're putting together to even functions. That is inevitable. It has to be an even function. But is it a periodic function? Does it repeat itself? It doesn't seem to, right? So it looks like we certainly don't see a repeating pattern here. We see the mirror effect from it being an even function. But there's no sign of it repeating. We could try going out a bit further before it gets just too fiddly to plot for us. And now we are getting a kind of sort of a sense of a repetition. And that's because we've got a basic cos function. And on top of it, we've written a higher frequency cos function. But if we looked at this carefully, we would find that it isn't actually perfectly repeating. The points that seem like they might be corresponding will be slightly off. There won't be a repeat on this length scale. And in fact, where I typed in these keyboard mashing numbers, if I'd have put in, for example, square root two, in fact, I can just do it. Two to the power of 0.5. And so there, again, we're just seeing, yes, it's an even function. We may sort of, something may catch our eye and it looks like it's repeating itself. It actually isn't ever perfectly repeating itself. And now it will never repeat itself. Because root two is an irrational, that is to say, the digits required to specify it go on forever. And it will never come back into sync with the basic cos function. But that's not what I want. I don't actually want anything as sort of challenging as that. I want to put together cos functions and sine functions, by the way, and have them create for me a new periodic function. And so in that case, I better stick to ratios between the frequencies of the different cos functions that are just integers, essentially. If I do that, let's see what happens. In fact, if I take away the root two here, and I just make this cos plus a weighted cos 2x, now that's a periodic function. It doesn't look very useful. We could home in a bit on the, just to stop us having quite so many repetitions. This is a perfectly periodic function. As I say, it doesn't look like I'm going to want to use it for much, but it's periodic. Now, is there a way for me to add together signs and causes that it will give me something actually more interesting than this? Well, let me just type in an example. So here is cos, I'm going to actually not have cos 2 of x. I'm going to have cos 3 of x, and then I'm going to have cos 5x divided by 25. Let's see what this one does. I'm going to do anything stunningly different, but it may give us a hint that adding together causes, or indeed signs, can sometimes be useful. So now we've got a little bit of an interesting one. This function is, it's cos like, in a sense, that seems to have the usual period. It has to have period 2pi, for example. And excuse me, it has to have period 2pi because we've added together just integer multiples of basic x. So in the same 2pi range that was the period of our basic cos of x, our cos of 3x must complete three full cycles and again be back to the beginning and similarly 5, and if the even terms are in there, they also would have to sync up. So it must have the same period as the slowest or the longest period version, which is 2pi here. But it seems to be doing something interesting in that we seem to have sharper corners. In fact, we don't normally get corners in a sine or a cos function, right? We seem to be developing corners and something approximating straight line elements. And that's indeed the case. You can see perhaps, or you've already noticed that there's a pattern here, that we put 3x divided by 9, which is 3 squared, and 5x, the cos 5x term gets divided by 25, which is 5 squared. And if we add a couple more. All right, so I actually crashed there, so I had to rebuild the point we were at. But what you can see is I've put in another function g, which is the same thing, except I've added the next logical term in the sequence. Of course, we don't know why at this stage in the course these numbers are the ones to go for, but just repeating or continuing the sequence, just pattern recognition, we see that the next logical thing would be cos 7x over 49. We can compare whether that sort of does anything interesting. Let's home in, by the way, on the point near the origin. And we can see that, yeah, okay, so we're now, this is a zoom in on what looks like a somewhat sharper angle than we would normally see when we do signs and causes. And let's compare, that we can actually get Mathematica to plot both functions, the one that only goes up to cos 5 and the new one that goes up to cos 7x and put them on top of each other and see what is the effect of adding, what is only a little term, because it's divided by 49. And we see that the new line, the brown line, even has a slightly sharper turn than the previous one. So we're getting the hint here that the more terms we add, as long as we stick to this pattern, the closer we get to something that's not so cos-like, which is to say straight lines meeting at a sharp angle. So let's just see only function G and go back to our range from minus 10 to 10, just to look at that again. Yeah, that's looking pretty sharp and that's actually a triangular wave, that shape is called, and that does come up in various areas of science that we want to analyze a triangular wave. Let me give you one other instance of why this could be interesting. If I home in to just minus pi to just pi, and now if I shift this up a bit, maybe it will just suggest exactly what I'm after. So if I shift it up by one. So now this is still only a crude approximation because we've only got four terms, but if you imagine this becoming perfect, so that it's two straight lines coming to a sharp angle, I want to suggest to you that that looks like something that you will have encountered many times in your life. Imagine a guitar. So I'm not a guitar player, I imagine sort of holding a guitar like this. The guitar strings are fixed at each individual string. It's fixed at two points, which I want to suggest are like the points at either end of this figure. And then if I pluck my guitar string, I might lift up the string with my nailed or my plectrum, and maybe I pluck it right in the middle, in which case the string will momentarily be forming exactly a shape like that before I release it. And then we might ask what happens next. Now it's going to take us a while before we can answer that question, but we will be able to answer. We'll actually be able to predict the full physics of what will happen next when a guitar string, for example, is released. That will require us to understand Fourier series a bit. That will take us a few more lectures of that, and then we'll need to understand the wave equation. But answering real world questions like that becomes possible because problems like this starting function, which is, for example, a stretched string of our guitar just before we release it, they don't look like signs and causes, and they would be apparently quite difficult to feed into the differential equations that we'll meet in the second part of the course. But if we can learn how to break them up into signs and causes, and this example suggests that we could do that, then we'll find that those otherwise difficult equations just kind of melt apart and are extremely easy. It's beautiful to see, but we'll have to wait a little bit before we actually do that. So now if I come back over to my sketching area, let me pose the following question. Suppose that any periodic function could be written as a sum of signs and causes. In the little example we saw there, the triangular wave looks like it could be written, at least to a very excellent approximation, as a bunch of causes. We've got it as a pretty decent approximation just by choosing four terms. But how would we find out the correct amount of cause and sign? So let me, in fact, make that proposal a little bit more specific. Let's suppose that I have some function, I'll need a pen for that, maybe a blue pen. I have some function f of x, and it's a periodic function. So I can use this x plus p. Now, in fact, just to keep things simple, I'm going to say it has period of 2pi. We'll see how to generalize that later, but it will keep things neat. So now I'm thinking of some period 2pi function. But it's periodic, but it could have any old shape. So what kinds of shape could it have? It certainly could have the triangular wave that we were just looking at. That's a horror idea. Let me try a little bit harder to make the thing. I mean, the pad lets me draw straight lines, so I shouldn't be making it this hard to draw a half-decent diagram. So sure, it could be this triangular wave that we've already met, but it could be any number of other things. It could be, for example, another very famous periodic function that doesn't look much like a sign or a cause, would be the square wave. So that would be a function that is either 1 or 0, and it just switches from one to the other abruptly. So that's, yes, it's periodic, but it's just made of horizontal components and perfectly vertical components. So that's not very sign or cause-like either. And anything else that I could write on here is also a legitimate example for what I now want to ask. I want to say, suppose that with enough signs and causes, we can create these periodic functions. And I'm just thinking of one such function. Maybe it's the triangular wave. How would I figure out how much sign and cause to have? So what I would say is we're going to assume that it's possible to write f of x, as well as defining it as a triangular wave or a square wave. It is possible to write it as a sum that is made of, well, bear with me, I'm just going to write out the proposition and then we'll talk about it. So a0, and for reasons that will become apparent, I'm going to divide it by two. Don't worry about that. Plus a sum. So I'm sure you've met this sum symbol before, which just allows us to run over a bunch of values, of in this case, the symbol n. And then, so don't worry, I will talk through this expression. I need to move it a little bit, make a bit of space. Draw a little scribbly diagram up a bit. I'd like to get this one on one line. So this is now a fairly complicated looking expression. The first thing to say is that these symbols a, n and b, n are just some constants. So a0, a1, a2, and so on are just some bunch of constants. And we want to find out what those constants should be. We can see that these sums run from n equals 1 to infinity. So this sum, this first sum, just for any who are a little bit unfamiliar with this notation, what this means is that we're going to have a, the first value is a1 cos of x plus a2, another constant, a different one, cos of 2x plus and so on. And it goes on forever. But of course, these constants could be 0. And so then the sum could actually just practically stop at a10 in that a11 and all higher ones might be 0. That would be fine. It fits within our description. Our description is super general, so it just allows any amount of any cos of any integer multiple of x. There's any amount of cos 3x, there's any amount of cos 37x, whatever we like. And similarly, the symbols bn are used for the constants that say how much of the sign terms we would like to have. Now, my claim is, or the claim we're investigating is that I could create any periodic function I want by this very general prescription of adding together suitable signs and causes. The only constraint is that the function I am going to try and create will have to have period 2pi. And that's just because I didn't want to make the expression for the sum of terms look even more complicated by putting in divide by p, divide by p as the period of the function. So I was happy to accept, sure, it's a 2pi period function. I can generalize that later. But in terms of the shape of the function, I'm claiming now, or I'm investigating the claim, that we can make anything we want. So if I just put on something crazy here, that could be, that does look pretty crazy. If I just copy that, if I just duplicate it and sort of try and join it up with itself, okay, it's got a bit big, let's scale it down a bit. Oh, doesn't want to scale there with me. There we go. So this is a periodic function. It does repeat itself. And so it goes on forever. And the claim would be that I can make this using signs and causes if only I can find the right amounts of sign and cause. If that claim is true, what are the amounts of sign and cause? Let's target first this term here. It's the constant term. So if we can get anything, maybe we can deduce what that has to be. Given some kind of function we've been told to look at like this brown one that I just randomly made up. Now, what does changing the value of that a0 do? So if we had found out all the terms and we'd correctly built this function and now we just, for fun, tried altering a0, what would the effect be? It would be to move our function up and down, because it's just an additive constant. So if I sort of put it back roughly where I found it, how could we work out what the correct value of a0 is? Yes, it moves the function up and down. Well, if we're interested in how much of the function is above the x-axis and how much is below over one complete cycle, because of course it just repeats. So the first observation would be if we can understand our function, if we can successfully reproduce it over the range, say, 0 to 2 pi, then we will have 1, because the sum of terms that we've written down here is necessarily going to repeat itself. The whole thing will repeat itself every 2 pi. So we can just focus on that range. So let's just kind of mark that off in our diagram. So we're going to focus going from here to here. This range, 2 pi, is all we need to analyze. We get that. We necessarily have got the function working everywhere. So yes, what should be the value of this constant a0 that shifts things up and down? If we think about this function and we're asking, all right, how much will it need? Is it mainly above the axis? Is it way above the axis? Is it below the axis? The simplest thing we might start to write down mathematically to explore that would be to think about doing an integral over one period, because that will add up all the area here. And I guess we could change color because it will subtract off the area there. And therefore, we would have some kind of mathematical measure of how much our function likes to be above or below the x-axis. And then we could apply the same condition onto our sum here where we're trying to discover the correct values of these constants. But we would notice something really neat, which is that when we do an integral, let's even just do it now. So suppose that we, given the periodic function that we've been told to recreate as a sum of signs and causes, sure, we could do that if we wanted to just say, all right, fine. It must integrate to something even if it's zero. So let's say that it integrates to some constant C when we take our function and go from 0 to 2 pi of f of x dx. In my diagram, it's just the green area minus the red area. But now, what happens when we substitute in for f of x this proposed new way of expressing it? So I'll copy that so that I don't have to keep writing it. And we'll just stick an integral symbol on it. Let's give ourselves a new screen. There we are. So now we want to do the integral from 0 to 2 pi. Make my pen a little bit sharper. Make a bit of space of our function. And that is going to be equal to, of course, the integral over this whole thing. And we can, of course, break up an integral that's over a sum of terms into each term that we're interested in. So I'm going to break it up just according to these sums. So 0 to 2 pi, oops. 0 to 2 pi here. And 0 to 2 pi here. And 0 to 2 pi here. Okay. So we're saying that, what did we call it? Some value C is what we must get when we perform this integral. But here's an interesting thing. The sum, the integral, well, let's take one of these terms, this one, and investigate what we're talking about here. It's the integral I missed off my dx out to dx. So it's the integral of a sum of terms. So I can just move the integral sign through, and there's a constant, which also can come out in front of my integral. So in fact, I can just write the integral in here and make it a sum of integrals. So to say it in words more clearly, the integral of a sum of terms is the sum of the individual integrals of each term. So what? How is that helping? It's helping a lot, because n here, of course, has to be an integer. And the integral from over one complete period of a cos function is just zero, always. So let's draw what we mean here. We're taking cos, we're going over one, that's a horrible cos. I mean, that's slightly, that's horrible. So when we integrate cos from naught to two pi, we'll get zero. And if we integrate cos of two pi, we're still going to get zero, because it doesn't matter what the, as long as it's an integer. So as long as it does have period two pi, the integral over one complete period of cos is always zero. And the same for sine, actually. So all these terms which have a n and b n, so a1, b, a1, a2, a3, a4, a4, a4, and all the b ones, all these unknowns just vanish. It doesn't matter what their value is for the moment. They're just going to get multiplied by an integral that is zero. So we can just delete all of that and all of that. So what we've discovered in fact is a very simple fact, which is that the coefficient that we were after, the first of our unknown constants is not unknown anymore. We know now that doing the, let's just finish the story. So if we go from naught to two pi of just the x, as I've taken the constant out in front, it's equal to naught to two pi of whatever the periodic function we're supposed to be trying to reconstruct is from naught to two pi. And we could note that the integral of just one from naught to two pi is two pi. So if we rearrange it a little bit more, we've just got a0 is equal to one over pi, the integral of the function we're trying to analyze from naught to two pi. So look, we've managed to get one of the things that we were after. And that should give us some hope, but it did rely on this cute trick that doing an integral over one complete cycle of any sine or cos will always vanish to zero. Doesn't look like we're going to be able to use quite the same trick again, right? So if we come up back up to our statement here written in huge writing across the screen, we've managed now to identify what that should be. But how are we going to get at the others? There's still an infinity of a constants unknown and an infinity of b constants that we don't know. We'd like to do somehow the same trick where everything except the one we're currently asking about vanishes because it gets multiplied by zero. What could we do? How could we change this function? What could we do to it? So that, for example, cos of 37x, which has the constant in front a30, a subscript 37, is the only one that will not vanish away. Well, at the moment, cos of 37x, when we integrated over one complete cycle, it does vanish away because cos of 37x will spend as much time above the axis as below the axis to put it that way. How could we put a stop to that? How could we put a stop to that? Well, the most basic way to take a function that was integrating to zero because it was spending as much time positive as negative would be to make it have to be positive. How could we take our particular cos function or sine function that we're looking at and force it to be positive? The most basic way to make anything positive is just to square it. So we could try squaring our cos 37x, which is that we just imagined we're trying to get at that particular constant. And so if we squared it, what would that mean? Let's try multiplying the whole function by a particular, let's say, cos term and see what that gets us. So I will copy this one more time, at least one more time, paste it in. And the idea we're now exploring is that it might be helpful to cause one of the terms in our sum to become squared because then when we do an integral it won't be able to vanish anymore. And maybe the others still will, let's find out. So I'm saying I won't take cos of 37 because that seems very specific. I'll write cos of mx and m can be 37 if you want to imagine it that way. So that's going to be, of course, cos of mx multiplied by that whole sum. So we're going to get a0 cos of mx and then all our cos terms are going to be multiplied by this extra cos of mx and all our sines will get multiplied by cos of mx. Now, looking over on the right, on the left hand side and remembering that f of x has been provided to us as some kind of equation or diagram like my brown line here, I could just provide you that. I could just draw this brown line really carefully and say that's the function. But if you give it to you and then you could use a computer to integrate it based on my diagram or as closely as you could approximate it. Sure, whatever that thing is, if I want to, I can perform the integral of over one complete cycle of that thing just like we did before but now with the cos of mx and it will come out, again, it will come out to something or other. It might come out to zero, but it'll come out to something. So again, I've already used the symbol c so I don't know, let's call that... What would be a nice symbol for it? I don't know, e for some reason. So that integral will come out to some value but what happens when I perform that integral on the right hand side? That's where we got our miracle to happen last time and everything vanished except the one term we were interested in. Well, now what about that term? What about the a0? That's now multiplied by cos of mx. When we integrate over one complete cycle, it will vanish because, remember, m is just some integer, e.g. 37, and so it will vanish away. But what about these other terms? So what happens when I do an integral from 0 to 2 pi of cos of mx times cos of nx where these are two integers that are not equal to each other? So I understand that m is not equal to m. Well, that's a puzzle. That's a mathematical question that's reasonably gonna need you to stare at it and think about it. Now, the answer I can tell you is that it will be 0 but the proof that it is 0 is actually one of the exercises that goes along with this course so I won't get into that. But I will just state it. So it's exactly what we might hope that wherever we have a mismatch between the particular cos term that we're focusing on, the one that's mx and any other cos term when we integrate it will vanish. How about the other set of things we're gonna get here which is cos of mx times sin of nx. How about that one? And now I'm interested in that case for absolutely any values of cos of, excuse me, any integer values of m and n including when they are equal to each other when they're both 37 because it's gonna be the sin term 37 but I'm trying to actually discover a subscript 37 which is the cos term so I would like that all to vanish and it does. So that is a part of the as I say part of the exercises is to prove that. Now it's not really a Fourier series it's vital for Fourier series we need that in the analysis we're doing right now but it isn't about creating a Fourier series it's simply a maths problem that could be asked in I suppose an A-level maths exam it's about that sort of level to go ahead and show that these things are true but they are. All we need for the moment is for me to just assert that these things are true and that you would find that you could prove it with enough effort or maybe it's not much effort I don't want to give it away I will say this it's a good moment for me to actually whiz all the way back to the beginning when we were talking about even and odd functions. Is there anything interesting about even and odd functions when it comes to thinking about what happens if we integrate them? So let's look at the odd function in particular if we perform an integral from any value let's say minus k to any value k let me try and spot the right point for that so that's just about here if it's an odd function the integral must be zero and I guess you can see why it's that for every little bit of area that there is let's choose this bit for example for every little bit of area that there is on the one side there is exactly the equal and opposite sign or area with equal magnitude and opposite sign on the other side and so the integral from minus k to k of an odd function is zero and the reason I'm mentioning that right now is that if you were to try and prove this little remark I have written down here about integrals over one complete cycle of causes and sign it can be helpful to notice whether or not you're dealing with an odd function now 0 to 2 pi is not integrating from minus something to positive something but remember these integrals only need to be over one complete cycle it doesn't matter if we're integrating from 0 to 2 pi or for example minus pi to pi because all of these functions are periodic with at least the period 2 pi and it may be that it completes several cycles within that but that's still a period with 2 pi we can go if we want we could rewrite these as being from minus pi minus pi to pi and they would necessarily come to the same thing so if we can spot any cases where there's an odd function going on then that may be a shortcut to have waffled enough figuring out both of these is an exercise all we need is that it is true so what we see here is that as before all the terms in our integral are going to vanish so let's write it out nope try harder to write it out here we go here's my assertion now based on admittedly a piece of maths I'm just claiming and I'm challenging you to do it if I do the integral could be from minus pi to pi I'll keep on writing from 0 to 2 pi because that's what I started writing and I don't want to mysteriously change halfway through this thing it's equal to some number when we're given the final form of our periodic function that where we would like to break up but what is it equal to when we do think about the series expression it's equal to a whole bunch of zeros and then just the term a m integral of cos mx and squared I'll put the square there dx only the term where we had cos of mx multiplied by cos of nx but they were equal so we can just write them both as m only that term survives and what is it equal to well that's an easy integral to do why do we know that well let's just draw a quick sketch just because I realize that otherwise might sound a bit mysterious if we looked at something squared it can only do this this is cos squared doesn't really matter how many complete cycles it fits into two pi you can see that I hope you can see that the area under this is the same as the area over it up to the fact that my sketch looks horrible so the brown and the orange areas are the same and so the area must be half of the total height which is one times the width which is two pi so it must be must integrate to pi that's the intuitive reason but it's pretty easy to just turn the handle and just follow the rules of integration and just do it anyway regardless of how that integral is done that is the answer to it and so now we are in a really strong position to write down any of these coefficients changing back to my more sensible color blue we're saying now that if you want to know any of the coefficients a m which are the coefficients of the cos terms we can get those just by doing one over pi times the integral from 0 to 2 pi of cos of mx fx dx so you give me that fx function I will now be able to tell how much of each cos is inside it and the same without sort of just saying all the same things again unsurprisingly the same is going to be true of the bm terms when we just go ahead and we multiply through what a sine mx term so we can say this straight away and you can verify it but it's exactly the same steps as an argument that we just went through so what we've done we've done it okay so what have we done that the in fact let's go and get the the first one we managed to discover was the constant a0 term have a look at what that looks like when we put it with its friends so if I move this down a bit maybe make it a little bit smaller there'll be room to pop in the the one we previously discovered but what we can see and this is the point why we realize it was helpful to put in a factor of 1 over 2 it's because now the a0 expression looks extremely similar to the am expression and in fact they are the same expression we realize because if we put m is equal to 0 in then we would have if we put m is equal to 0 into the general expression for m here which we derived only for m for the ones that were cos like terms so they were m is 1, 2, 3, 4 but if we put m is equal to 0 in here then we would have cos of 0 which just vanishes it's just 1 and that is the line above so in fact we don't even have to write down three different lines here we only have to write down the two lines and we understand that these expressions are four this one is for m is greater than equal to 0 and this one is for m is greater than equal to 1 because there is no b0 number so these do the job of capturing for us what all those unknown initially unknown constants are so the statement we're able to make is this if a periodic function can be described as as a sum of signs and causes with some amount of each one then this is how much of each of those terms there should be now in the next lecture we're going to go ahead and we're sort of a little bit out of time to do it now but it's it's it's quite easy so it's almost tempting to do it now we're going to go ahead and put in the triangular wave which is the one that we were looking at in the maths software and we could see it starting to work for us we're just going to finish that story do it properly now put in the triangular function as our target function work out these integrals in that case and show that indeed what we should be doing is just adding together cos terms we don't need the sine terms only the ones that have odd values of m and the a0 excuse me the a constants are actually going to drop off with the square of that m factor which is what I was of course just typing in because I already knew the answer in order to make our little maths exercise work so now we're going to finish that story but more to the point we'll be able to do any periodic function that we want and we will therefore be able to just create these sums of signs and causes the Fourier series for any problem that we're interested in good I'm just going to round off now by a little exercise that is in the notes that go with this course and it invites us to think about because we've been playing with a lot of integrals we've been multiplying by signs and causes and doing integrals and all sorts of things and it may seem that this is just a one-off trick that happens to be the thing we should do to solve this puzzle of the Fourier series but it's just you just have to memorize oh that's the maths trick that lets you get to the answer for the Fourier series but it's a bit more general than that and one way to emphasize that is to think that the things we've been doing today are actually very similar in spirit to another kind of maths not involving functions that you've already met and the way to stress that is maybe to make a table and just compare very quickly so let's have a table with just two columns and um nope doesn't want to go straight that's annoying that table with two columns there we go and on the one side we're going to have the the Fourier series tricks that we've just been talking about so I'll just put Fourier series on the one side and the thing I want to compare with is actually just vectors vectors as in good old three-dimensional vectors that are made out of i, j and k components right so we've played with that that kind of thing so what on earth have Fourier series which are all about taking periodic functions and expanding them how are they like vectors well I'll show you so in the one case the general object is some function f of x which is periodic so I'll just write down the periodic the the rule that shows that the thing is periodic in the other case the general thing is some general I'll just write general vector v in both cases those are the the sophisticated thing that we might want to build up now in the case of Fourier series we argue that this general periodic function can be built out of sine nx where n is some integer and cos nx components in in the vector case we can build up our general vector with appropriate amounts of i, j and k Cartesian unit vectors so in both cases we have something basic and we can use it just by adding terms together we can make the basic thing represent the complex thing in vectors we say any amount of i, j and k and k the correct sumo any amount the correct amounts of i, j and k added together can give us any vector that we want in three-dimensional space the Fourier series claim is with the a correct amounts of the sine and cos functions we can build any periodic function so it's that what's similar here is that we're building a general complicated thing out of simple building blocks and we can even push the analogy a little bit more when we want to work out how much of our general vector lies in the let's say Cartesian i direction what do we do well you might remember this so if you look at my general expression for a vector it's got vx times i and v y times j and vz times k if I want the vx part of that how would I get it so I would write that vx for example is equal to I would do the dot product between vector direction that I'm interested in the i component and the general object and that will just extract for me the interesting bit because the other two parts will just go to zero and the trick we were just doing with our integrals is very much like that what we're basically saying there is if we want for example the am component which is how much of a particular cos term is there but we don't do a dot product because that's just and that makes sense in the context of vectors but we do the analogous thing we do an integral over one cycle of our function and again we multiply the building block component which instead of being Cartesian i vector it's now that cos term I'm sorry and I should have an m there we multiply that by the full complex object and we do the interval so in the place of doing the dot product between the building block of interest and the general vector we do the product between the periodic function the building block periodic function which is in this case a simple cos and the general entity and we do an integral because that allows us to look over the full range of the function there's no analogous thing needed in the case of the vectors because the dot product is essentially automatically doing that for us there is a well there is okay there's one more thing to say just to and this is a very deep connection actually so this is a complete orthonormal set of entities mathematically but I'll just highlight one more feature to just try and convince you that there's a strong analogy here even though one thing is vectors which are just these sort of simpler objects and the other is functions if we do the dot product between two different building blocks i.j for example is going to be zero and if we do the equivalent of our dot product for our building block functions so we say cos of mx times cos of nx or indeed of a sine but let's stick with cos for our example and we do the integral over the full cycle that is also zero so the building blocks have this relationship with each other that they come to zero when you do the correct operation in vectors case it's the dot product and in the Fourier series case it is the the integral over one cycle and this is the this is the generalization of concept of being at right angles for vectors this is true because the i.j and k are at right angles to each other it doesn't quite make sense to say two functions are at right angles to each other you know they're not geometric objects but they do have this property that when you combine the two different functions and do the integral they come out at zero so the word orthogonal is used in both cases it's an orthogonal set of building blocks well okay that's enough hammer it's not very important to grasp that it's just a nice observation that we really met the same kind of ideas from two very different angles now when we've learned about vectors and now we're learning about Fourier series but with that thought I'm going to end this lecture and in the next lecture we'll actually build some Fourier series we will can reconstruct properly now our triangular wave and look at some other interesting ones as well thanks a lot for listening and remember that the notes if you would like to look at them are available online various places but if you have any trouble getting hold of them just go to simonb.info thanks a lot