Fourier Series coefficients for a 2L-periodic function f(x) are derived using orthogonality relations: the constant term a₀ = (1/L)∫₋ᴸᴸ f(x)dx, the cosine coefficients aₙ = (1/L)∫₋ᴸᴸ f(x)cos(nπx/L)dx, and the sine coefficients bₙ = (1/L)∫₋ᴸᴸ f(x)sin(nπx/L)dx, where the orthogonality of sine and cosine functions ensures that cross terms vanish when integrating over the symmetric interval [-L, L].
Deriving the Fourier Series Coefficients | Oxford Calculus Guide
Added:hello math fans Dr Tom Crawford here at the University of Oxford and today we're looking at Fourier Series in the last video in the Oxford calculus series we saw how to find a solution to the heat equation one of the first partial differential equations that you will study as an undergraduate mathematician and we saw that this solution was valid provided we could express our initial heat profile as an infinite series of sine and cosine terms this is exactly what Fourier series allow us to do Fourier series work by taking advantage of two Key properties of sine and cosine the first is their periodicity so if I have a function sine of x or cosine of x then both of these are going to be 2 pi periodic now we want to consider a more General periodic function defined by f of x so let's suppose that our function f is 2 L periodic so we have a function f of x which is going to be 2L periodic so this means it repeats every 2 L As you move along the x-axis much like sine and cos repeat every two pi now because we want to construct our function f using an infinite series of sine and cos we actually want to consider a certain form of sine and cos which are going to be to our periodic also so in fact what we're going to look at here is rather than just sine of N X or COS of NX for some integer and then we sum them what we're going to do instead is to consider sine of n pi x divided by L and cosine of n pi x divided by L because for each value of N and again we're going to add together all of these as n increases from 0 to Infinity for each value of n these functions are now 2L periodic and so they match with our function f which is a general periodic function the second property that we need to construct our Fourier series is going to be the orthogonality of both cos and sine I'm going to show you an example to demonstrate exactly what we mean by the word orthogonality so suppose I want to do the following integral and to integrate from minus L to L you'll notice this has length 2L which is going to be the period of our function and I want to integrate sine of let's suppose we have m pi x divided by L so that function again is 2L periodic multiplied by sine of n pi x divided by L and we're integrating with respect to X using the appropriate product to sum formula this tells us that the interval becomes minus L to L there's going to be a factor of a half which I'm going to put outside of the integral and then inside we have I believe a COS of M minus n pi x over L and then we subtract COS of the sum plus n X right now if you're unfamiliar with the product to some formulas if you start from the second line here and use the standard trigonometric Edition formulas you will see that the various terms you get cancel out and you're left with exactly what we have at the top so this is now an integral that we can do this is the advantage of turning the product into a sum we have two pieces we can integrate cause of something and use the reverse chain rule to get the answer so we can do that and say this is a half times the integrated part so that's going to be a sign of M minus n pi x over l that's not changed and then we've also reverse chain rule given us an L divided by pi times M minus n on the bottom there and then we subtract off and again we're going to get an L over M plus n times pi and that's also come from a sine l and between minus L and L okay so I think that's correct so far now there are two things that can happen here and this is a very important technique or thing to always check whenever you're doing any maths problem not just this one this could be zero there's at this point there's nothing telling us that M and N are different we know they're both positive integers because remember we're interested in adding together this infinite sum from n equals naughts to Infinity of all of these different sine and cosine terms so we can certainly assume that a positive without loss of generality let's say m is bigger than n but they could be equal that's the key thing so so we're going to split this up into two cases so we've got one case when m is not equal to n which is the one that I've written out here so provided m is not equal to N I am not dividing by zero and therefore I can evaluate this expression so when I do that I could of course explicitly substitute in the L terms and add together those four pieces but you can spot what's going to happen because when I substitute in l this becomes Pi L over l so the else cancel and I'm left with a sine function of an integer multiple of Pi it's sine of some integer times pi if you think about the graph of sine it is zero at every integer multiple of Pi so this will be zero when X is l similarly this is sine of an integer multiple of Pi L over l gives me 1 again so this is another sign of an integer multiple of Pi so that's also zero minus l the exact same thing is going to happen we substitute in here we get sine of negative integer times pi it's still zero minus sine of negative integer times pi it's still zero so all four individual terms plugging in two from each limit they're all zero so provided this is valid in the first place provided this is valid the answer here um is just zero so we get zero now the interesting case is exactly when M does equal n so for this one I'm going to take a different colored chart so we can see this more clearly so when m is equal to n we go back to this stage here and say um is now equal to n so what does this mean well this m equal to n that gives me zero now so this is COS of zero it doesn't matter what's here this is COS of zero so we know that becomes a one so this now become one and then here M and N are again they're the same thing so we've got a one minus cos and what we're going to get inside that bracket will be two and pi x over okay so proceeding from here and integrating again we're going to get the factor of a half outside determine one that integrates to give me an X then the cost term again comes from the sine term so that's now minus this thing's still valid so I will get L over 2 N pi and then we're left with sine of 2 N pi X over l and that's P minus L and down plugging in the limits just as before we're going to get to half of X which is L so we get there writing it down here we get half and then I'm going to get an l minus L over 2 N pi times sine of 2N Pi L over L is one it's an even integer multiple of Pi still zero again so nothing from that and then we get minus bracket when we plug in x equals minus l so it's minus minus l and again when we plug in minus L that gives us a minus 1 in here we get minus an even integer multiple of sine it's also zero so it's minus minus L brackets so factoring all of those things out we get so what we've seen is when we have a product of two sine terms and we will do the same for COs in just a moment when we have a product of two signs with an m and an n we've seen that if they are different values they are integer values but if they are different we've seen the answer is zero and if they're equal then we actually get exactly l so what we can do or a nice shorthand notation that we can use is to say that this integral is equal to l which is the answer we got when they were equal multiplied by the Delta function so I'm going to write this as Delta m n and this is where Delta m n takes the value 1 when m equals n and zero otherwise so it's just a shorthand way of expressing exactly what we found here in terms of the integers having to be equal in order to get a non-zero answer now we can do the exact same thing with cosine so we consider the integral from minus L to L of cos M pi x over L which remember is a 2L periodic function multiplied by COS of n pi x L DX as before we want to use the appropriate product to some formula to turn our product of causes into a sum we can then integrate those terms individually and again as before we're going to get a different answer depending on whether m is equal to n or not following through all of those steps and I really do recommend trying this one for yourself you'll actually get the exact same answer so this is equal to l half of the length of the period of our function multiplied by again Delta m n now that just leaves a final combination which is going to be the integral from minus L to L of sine of M pi x over l times cos of n pi x over l so for the first two we had two sine terms two cos terms so the only other possibility that could happen when dealing with cos and sine is we have a sine multiplying because now for this one we could proceed and use the product to sum formulas just like we've done for the first two however we can be slightly cleverer and actually spot something about the function that we're integrating so we know both of these are 2L periodic and importantly we're integrating over a symmetric region we're integrating from minus L to L so we're integrating over a region which is symmetric about zero now sine is what we call an odd function so and label that as odd and to see why or to see what I mean by this let's look at its graph so if I have sine function over here then I'm going to have something like this and then it's kind of reflected over here so we say that sine or it's true that sine of x is equal to minus sine of minus minus X and that's how we Define an odd function so it's odd I like to think of it as almost like being flipped in the line Y equals X now cos is even causes an even function and what that means if I draw the graph of cars is we start at the top we go down and we come back up and then down and there we go now I like that so cars is reflected in the y-axis so we know that COS of x is the same that's because of the minus X and that defines an even function so because we have an odd function multiplying an even function together we have overall an odd function and this works in just the same way as it would with odd and even numbers or if you want you can follow through these definitions and convince yourself that when you multiply a cause on a sign it does satisfy the property of being an odd function so this whole thing is odd so whilst we could try and work out its shape but of course that will vary for different m and n the fact that it's odd tells us that we have this sort of reflective symmetry in the line Y equals X or Y equals minus X so what that's going to mean here is whatever we have on one side of zero we're going to have like the exact negative on the other side so when we do the integral and this is true in fact for any odd function if you integrate any odd function over an interval which is symmetric about zero you will always get zero so we can use this property to immediately conclude this is in fact going to give us zero so in summary we have a total of three orthogonality relations which are going to be incredibly important when deriving our Fourier Theory the first one tells us that two sine terms when multiplied together and integrated we get zero and less they have the same integer m and n for cos we see that again we get zero unless they are the same cos term and if we have a sign in a cars because that's an odd function that will always integrate to give us zero and these three relations are actually going to be key in deriving the coefficients for our infinite series of cause and sine terms now some of you may have noticed that these orthogonality relations that we've just derived are stated for integrals from minus l to l now we definitely need an interval of length to L because our functions are 2L periodic and that's clearly an important relationship between the function and the interval over which we're integrating but a perfectly valid question might be to ask do we always get the same results here over any interval of length to L if you wish to investigate this further then I recommend checking out the maple learn worksheet Linked In the video description below this box which takes you through a step-by-step proof of this property I've also included some exercises looking at the properties of odd and even functions as well as some further exploration of the orthogonality relations that we've just derived and if you get stuck with any of the questions then don't forget the maple calculator app is here to help just download the app onto your phone take a photograph of the equation you want to solve and then click the steps feature to see a breakdown of the solution now that we have the orthogonality relations let's put them to use in deriving our Fourier series so we begin with a general function f of x which is 2L periodic where of course l can be any number and what we want to do is rewrite f of x as an infinite series an infinite sum of cos and sine terms so let's suppose that is possible let's just go with it and see what happens so assuming we can do this we can rewrite f of x is equal to the sum from n equals naught to Infinity of the unknown coefficients a n times COS of n pi over l plus the unknown coefficients b n times sine on N pi x over l and the idea is that adding together all of these terms is going to give us F but of course we need to determine what these coefficients are just saying this exists doesn't really help us when we're trying to solve a problem we need a method of determining the coefficients a n and BN now if we focus on n equals naught first so when n is equal to zero and this is the only one we're going to do I'm not going to go through all different values but there's something special about n equals naught so when n equals naught we're going to get a 0 times COS of zero plus B zero times sine of 0.
now sine of zero well that's just not and COS of zero well that's just one so all we're left with here is actually going to be this first coefficient a0 so this is a smudge simplified case when n is specifically naught and so what we tend to do in our definition of the general Fourier series is in fact to start the sum from one and then we add in what we call the zero coefficient which is often labeled as a half times a zero the choice of the half there will become apparent shortly but for now you can see this is a constant because when n is not we're going to get a constant term so the question now becomes how do we calculate our three different coefficients we want a formula for a naught the constant term a formula for a n and a formula for b n and the trick here which really all of the theory of Fourier series relies on is going to be to use our orthogonality relations so to begin with coefficient one let's take this equation which remember we've assumed exists this Fourier series was saying suppose it exists let's see how we might calculate the coefficients so let's take this whole equation and let's integrate both sides of the equation from minus L to l so we can say minus L to l times f of x DX is equal to the integral from minus L to l of a half a naught DX Plus the sum and here what I'm going to do is take the integral inside the sum I will talk more about that well I will talk more about why that's allowed at the end of the video but for now let's just go with it I'm going to take the integration inside the sum and say this is then the integral from minus L to l of a n cos n pi x over L DX and then we've got another infinite sum integral minus L to l of BN sine n pi x over l DX now what do we get when we do these integrals well this one's relatively straightforward this is just a constant so when you integrate a constant this just gives me a naught X over 2 between L and minus l so that will be a naught L over 2 minus minus a naught L over two so I'm just going to get two lots of it so it's going to be a naught l so this first integral here gives me a naught multiplied by L now this one we have a constant and multiplied by cos n pi x over l now if I integrate cos so that will give me a n and then I've got to remember to do L Over N pi and then I'm going to get sine of n pi so actually now when I substitute in these values for X so I get sine of n pi well that's zero and then I get sine minus n pi well that's also zero so this whole thing is zero in fact and similarly when you integrate over here you integrate your sign it gives you some multiple of Cars and Cars at these two points they're going to actually perfectly cancel out precisely because each of these functions for any value of n each of them is actually 2L periodic and we're integrating over period total length two out so this also gives you zero and again if you want to do the integral and substitute in you can see that explicitly for yourself so both of these vanish and even though there's an infinite number of them each individual piece is always zero because the fact that these integrals were zero is entirely independent of the value of n so all of these pieces are zero so all we're left with is the integral of f is exactly a naught times l so we can just rearrange that equation so putting this all together we can just say well therefore 1 over L dividing both sides times the integral from minus L to l of f x DX that is exactly a naught so the first of my coefficients that I want to work out in this Fourier series is just simply given by integrating my function f between minus L and L and then putting a 1 over L outside that is why we had the half because it simplifies to this nice neat formula at the end so we have the first of our coefficients a zero given by integrating F but how do we work out a n and BN for a more General value of n the trick lies in the integration and the application of the orthogonality relations over here so you'll note we didn't actually need these relations to get this first result but what we're going to do to get a n and BN is actually going to be to combine this idea of integration on both sides of the expression along with these orthogonality relations that we've derived so to get our second coefficient we're going to take the a n in general what we want to do now is to integrate both sides of the equation we want to first multiply by COS of M pi x over l so the left hand side is FX cos m pi x over L DX that's just multiplying the left by cos cos n by X over L and then integrating so now we have to do this for everything on the right hand side so this is now equal to a half a naught so I can take that out bracket a half a naught the integral from minus L to L of cos M pi x over l the X again we're going to assume that it's okay to Interchange the infinite sum and the integral I'll talk about that at the end so that then gives us a second term which will be the sum from n equals one to Infinity then we've now got um the integral from minus L to L of a n cos n pi x I have L times cos M pi x through the L DX and then we've got the sine term so plus the sum from n equals 1 to Infinity the integral from minus L to l b n sine n pi x l times cos of M by L d x so hopefully you can immediately see these two look like our orthogonality relations and that is what we're going to use to figure out what these coefficients a n need to be so the first integral we have something very similar to what we just saw in step one for our a naught coefficient we're integrating cos which is 2L periodic between minus L and L it's going to be zero so this is zero since 2L periodic function now over here let's look at this second term because we've got a sine of n times a COS of M that's exactly what we've got here in our third orthogonality relation and we saw here that this was Zero no matter what value of M or n so remember here m is a general number from One potentially three to infinity and N covers all possible values from one to Infinity so this covers all possible pairings of signs and causes but by the orthogonality relation we know this is always zero so this whole thing whole thing here is zero by orthogonality orthogon oh let's see precisely from this third one up there so that just leaves this time now we've got a COS n pi x over L times a COS of M pi x over l and that's exactly what we've got over here it's l times Delta m n so what we can do is say this here becomes we've still got the a n because that can come outside so we're left with the sum from n equals 1 to Infinity and then doing the integral but taking out the a n because it's constant we've got a n l Delta m n now L is just a constant so we can just divide by that that's no big deal but the N here a n depends on the sum but it's being multiplied by Delta m n now remember the Delta function was 1 when m equals n and they are the same value it gives you one and gives you zero when they are different so what this does is it actually picks out exactly when M and N are the same thing so even though there are an infinite number of terms in this sum this ensures that we get a single term and that single term is when n and M are the same thing so whatever value of M I pick if I pick m is 1 m is 2 m is three every time I pick a value of M this will pick out exactly that coefficient so we can actually say this whole thing is just l times a because again we only get a non-zero answer to this integral when n and M are the same thing so what this means for our coefficient in our Fourier Series neatening this all up is we're actually left with this expression here so we've got the integral from minus L to L of f x times cos remember we fixed this COS of M pi X over L DX that's the left hand side of our expression and all we've got on the right was we've got zero from this Zero from this l a m that's it so this whole thing we can actually just say well if I just put am here then this is 1 over L times all of this so again you think about it by saying if I want to know the coefficient am so say I want to know A2 the way to get a 2 is to take my function f multiply by cos 2 pi x over L integrate from minus L to L all of these terms disappear and I get A2 so we can do this for any value of M so this gives us a way to calculate now every single coefficient that goes up here in our Fourier series finally to get the term B N which is the coefficient the constant coefficient of our sine term in the infinite Fourier series we follow the same approach and as I'm sure most of you may have realized we're going to now multiply by sine of M pi x over L and then integrate so for our third coefficient we do exactly that as we've seen a few times before now this integrates to give me zero since it's 2L periodic and we're integrating over an interval of length to l this term is a cause times a sign that's zero Always by orthogonality so this is zero by orthogonality and then finally we have this expression involving the two sine terms exactly as we just saw with the COS terms we're going to get this result here this is equal to L Delta m n and then we've of course got the sum from n equals one to Infinity b n the Delta function picks out exactly the BM coefficient and absolutely nothing else so this whole thing together is L times b m so again we can rearrange and get our final formula b n is equal to 1 over L the integral from minus L to L of f x times sine n pi x over l DX so we have our formula here for all three coefficients this allows us to determine the constant one a zero we integrate F to minus L and L for our constant in front of the COS term we multiply by cos n pi x over l multiply F by that and then integrate and for our coefficient here on the sine term multiply F by sine and integrate so this gives us explicit formulas for all of the coefficients which means we can indeed write down our Fourier series for any 2L periodic function the best way to get to grips with Fourier series is of course to play around with them for yourself which is exactly what you can do in the accompanying maplelearn worksheet there is a question which takes you through a full derivation of the Fourier coefficients for the Sawtooth function and allows you to see how the series provides a better and better approximation to the graph as you include more terms as always the worksheet is linked below and is available for free courtesy of maplelearn now I did mention that I would briefly address the issue of interchanging the sum and integration sign as of course our derivation of the formula for the Fourier coefficients in all three cases did rely on this interchangeability being okay I'm not going to go into the full details because that would require a course in analysis and I don't want to go off on that much of a tangent but the key aspect or the key property that we need of our sum for this to be justified is that the sum is uniformly convergent now what this means in a nutshell is that not only does our sum converge to a limit which of course has to be finite it has to converge to something here it's clearly converging to f so not only does it have to converge but if you were to give me an Epsilon any Epsilon small number that you can think of my task is to find an n sufficiently far down the sum that I can always add up terms to that value of N and be within Epsilon of the final limit so that just means that this sum converges now if it's going to be uniformly convergent then for any Epsilon that you give me I actually need to find an N which does not depend on x so whatever N I pick in order to get within Epsilon of the limit that n has to be true or has to hold true for whatever value of x is selected based on the domain upon which this series converges so for normal convergence I can pick an N which depends on X so I can pick a different value of n depending on the values of X we're interested in for uniform convergence my n the distance I have to go down the sum it actually has to hold true no matter what value of x we pick so provided uniform convergence holds we're able to Interchange the integral and the sum and therefore our derivation of the coefficients is totally sound thank you everyone for watching please do remember to subscribe to the channel if you've enjoyed the video and I'll see you all soon take care
Up Next

Euler's Formula Explained via Group Theory
@3blue1brown
2.7M views•2017-03-03

Gain Recalibration in Hippocampal Path Integration: Math Theory
@1024kyz
144 views•2020-07-02

Fourier Series Introduction: The Big Idea Explained
@DrTrefor
387K views•2021-05-03

The Mathematical Impossibility of Accurate World Maps
@Vox
23.3M views•2016-12-02
Related Study Plans & Knowledge Roadmaps
Structured learning paths in Mathematics














](https://i.ytimg.com/vi/TDryxdgeJ14/maxresdefault.jpg)





























