 Hello, I'm Simon Benjamin and this is lecture 8, the very last one in my course on Fourier series, Fourier transforms and partial differential equations. Being the last one I'm wearing a waistcoat, thought I'd make a bit of an effort and I think you'll find that this is a, I hope, a pretty interesting lecture. The maths level is gone back to a much more modest one after we really went deep in the last lecture and had to sort of really reach for some sophisticated solutions. This I think will be a gentler presentation, so let's have a look. I want to wrap up the whole diffusion topic by showing or looking at an overview of all the different things we've done and summarizing them. Then it is onto some fresh material deriving the wave equation, which is perhaps the most important equation in physics. There's something called de Lambert's formula, again excuse my accent, which is a very important insight that comes immediately after we've derived the wave equation and then we'll get down to solving a particular scenario, an extremely interesting one that captures a lot of the ideas of waves, which is a vibrating string and that then we'll be able to see if we can actually use our ideas to predict successfully how something like a vibrating string behaves in the real world, so a guitar string for example. As always, the notes for this course are available at SimonB.info and elsewhere. So what I have here is a table that I've pasted in from my notes, the brand new version of my notes that I just uploaded, by the way, in case you have an older version, and I scribbled onto these printed, these typeset notes, some little diagrams to remind us of all the different things we've done, so let me just very quickly run through it. We have thought about what happens if you either have matter diffusion, which of course is fixed second law, or heat diffusion from the heat diffusion equation, where you start off with a distribution that can be described by some kind of periodic function, such as the infinite square wave. It doesn't have to be a square wave, you would use the same techniques for any kind of periodic distribution. The square wave is a good one, it could be a series of thin layers, films forming a stack, which then blend into each other if it were matter diffusion. And the technique that we use there is that we used a Fourier series to build the initial condition, and then we inserted a term e to the minus k squared t, also with a diffusion or either matter or temperature diffusion coefficient up in there, unless it's equal to 1, and the result is that the higher order terms in the Fourier series decay the most rapidly, and so we end up smoothing off our initial distribution, and then over time it becomes more and more smooth until eventually it reaches just a flat distribution. Then the second thing we looked at was, or the second thing I want to summarize, was what happens if we have a scenario where there's only a finite width to our problem, like a length of a bar or the width of a sheet of material, and the endpoints are held at two different temperatures or concentrations. So there what we needed to do was make our function periodic, and we had to do that carefully because we had to think about how to extend a finite function into a periodic form so that we don't introduce any discontinuities or other anomalies. We've talked about that a fair bit, and what we found is that if we've done it properly the long-term solution would just be a straight line between the two fixed points and intermediate timescales we would just get again a softening and a reduction in the initial distribution. Pretty much intuitive stuff. Well then I would like to talk about actually the thing we did first, which was what if we have a Gaussian distribution in the first place. For example, we've heated up a region of a bar with a blowtorch, and it can be described reasonably with a Gaussian. And again there's a symmetry argument here that meant that mathematically that's the same as if we had a heat distribution at one end of an infinite bar. It would be the same mathematical treatment. So in that case we ended up with another Gaussian as we had guessed we should, but the interesting point is that the thing spread out in time with a speed if you like. The characteristic width increased according to the square root of time. So the more it evened out the more slowly it continued to spread. And that in fact is what we saw again and again in all these solutions is that there would tend to be a root T behavior. Okay then we thought about winding back the Gaussian solution in time until all the energy was focused in one point or all the material was just focused in one infinitely thin layer. And we realized that that was just going to give us a Gaussian again, but this time we were able to formally show it. And there we used the Fourier transform method rather than the Fourier series. But we used our same trick, which was to simply put in this decaying time factor. But now we put it into the integral just like we put it into the sum previously. And that allowed us to in fact re derive the Gaussian solution. And then the final and most impressive thing that we did really quite tough was to consider the innocent sounding situation of two blocks of material that were next to each other or at different temperatures and next to each other or one block that was in contact with a reservoir. Again, mathematically we can show that these received the same treatment. And a physical example would be the carburization of steel where carbon penetrates into the surface of steel until we've got just the concentration that we want. And that was another Fourier transform scenario. This time Fourier transform of a step function. Same trick to put in that time dependent exponential decay. It's simply that now the mathematical treatment was more challenging. We ended up with an error function. And again, we saw that the shape of the error function or how rapidly it softened was characterized by the square root of t. So a lot of stuff that we've looked at there are a lot of analysis. And I think it's fair to say that we've comprehensively looked at the diffusion equation in many different forms. We've usually made it 1d, but very often the three dimensional extension to this is very straightforward because the dimensions just separate and you get a one dimensional problem in each direction, so to speak. Moving on. Okay, so now I would like to talk about waves. What we'll do first is derive the governing differential equation that tells us how a wave behaves. And to do that we'll think of the case that we have an elastic string that's fixed at two points along the x axis and we want to know how it vibrates. The equation that we get, however, will be much more general than that and will apply to electromagnetic waves and waves on the oceans and all sorts of things. But this is how we will get to it. So let me draw a sketch of what I want to think about. All right, let me pause in my drawing now and talk about what I've drawn so far. By the way, the analysis we're going to do here is very reminiscent of how we got the diffusion equation in terms of taking small pieces and thinking what's happening at the boundaries of a small piece. So here in the purple line I've drawn, so this path here is actually our string. So it's a hugely exaggerated sort of oscillation that looks like a string that could be the case, I guess. And I've just drawn an arbitrary curve. You could draw any curve you like, except that it has to be fixed at x equals 0, our string is fixed at the x-axis and at x equals L. It's the same thing. So the y-direction in our diagram is the displacement. So this could literally be a photograph with a sort of fast acting camera that just is able to take a crisp shot of a rapidly moving thing of a vibrating string. Now, what we're focusing on is a little bit of string, just like in the diffusion equation we focused on a little bit of a little slice of the region so that material was diffusing in and out. Now we want a little piece of string and, of course, we're going to think of it as being infinitesimal really, but to draw it we have to give it some finite width to it. So I'll sort of bolding it in here, that's the piece we're interested in. These two extra lines I've drawn on here are supposed to be tangents to the curve at point A and point, let's call this point A. Maybe I'll draw below. So that's, we'll call that point A and this is point B. So these are tangents to that curve that are point A and point B. So let me carry on now and just write on a few more elements. Right, so I've added in there a few more features. I've put on a couple of forces, force one that acts at point A and force two that acts at point B. And these forces are pulling in different directions. They are the forces which are acting on our little segment of our elastic string. So remember it's an elastic string so it has a tension and that little piece of string that I've identified by drawing it in bold there, let me circle it, this little piece of string here clearly has forces on it. We're just interested in the forces on it due to the fact that it is elastic. So the string is stretched and it's trying to pull itself back to a shorter length. And so we can see that this little piece of string is going to have a force that's pulling it to the left and a force that's pulling it to the right. But they're not going to be in the horizontal direction. Those forces are going to be along the tangent of the string at those two points. So we have F1 and we have F2 and crucially those forces are not quite in opposite directions. And so we need to care about that slight difference. These forces are by the way not small because they are the magnitude of them it relates to the tension in the string, which isn't necessarily a small quantity. But the things like the difference in their angle will be small. So that's the kind of thing we now need to explore. I've also drawn on here alpha and beta. And these are the angles that those two forces make with the horizontal. So I hope it's pretty clear from the diagram what all those ingredients are. Now we can begin our analysis. Now we're going to start by making an assumption which if we were worried about it we could actually watch some strings vibrating with a sort of high speed video camera and we could verify that this is true unless you go out of your way to sort of set up an initial condition that would break it. In general a vibrating string will have the property that at a particular point let me mark one away from where all the other clutter on my diagram is will just vibrate up and down in the center. So what I mean by that is it won't vibrate from side to side. So that point that I've marked in red will not go either left or right it will just go up and down. So there will be no lateral movement of elements on my string. With that assumption I can now go ahead and start balancing out some forces. So if our little piece of string is not moving left or right and it's not even going to start moving left or right what that means is that the forces must balance each other in terms of the component that is in the horizontal direction. So we can immediately write down a constraint on the horizontal component of those forces. So I'm actually switching to using the symbol T just to remind myself that in the context of an elastic string we can talk about the tension within the string itself. So the tension at point one has a magnitude T1 and the tension at point two is a magnitude T2 but crucially we want to equate the horizontal components of that and so that should be cause and we can confirm it's caused by realizing that if the angles went to zero then all the tension would be in these two directions. Okay so that's really helpful now we need to think about resolving in the vertical direction. Well I've just added in there that what we can think of is that since these two quantities must be equal to each other let's just give them the symbol T and that will help us in simplifying. Okay what's this second equation I've got here well here we have the difference between the forces that act vertically on the two ends of the string. So what we're now thinking about is will the string be in cut will the forces on the string the net forces make it want to accelerate in the up direction in other words speed up or accelerate in the downward direction and sort of come back towards the relaxed horizontal axis. So we can find that out just by looking at the diagram and seeing that F1 wants the string to the our little piece of string to go down. So it supports an acceleration in the down direction and F2 supports an acceleration in the up direction. So we can just take the difference of these two and whichever one wins that will dictate whether the acceleration is positive or negative. Now so that is simply the force that's on at the net force in the vertical direction and then on the other side of our equation here what do we have nothing else but mass times acceleration. So we know from Newton that force equals mass times acceleration. Our mass is the density per unit length that's what I'm using the row symbol for here multiplied by the length of our little component which must be delta x from the diagram and then acceleration is of course just the second derivative of the position with respect to time and so there we can write that down immediately. So that's captured the question of how forces are acting to course our little component of our string to move. Now before I go any further I want to combine these lines above into a form that will be more useful for us. I want to eliminate these quantities t1 and t2 so that I've only got some kind of constant tension which we've been calling just the simple symbol t and our angles and then all we have left to deal with is the angles. So how will I do that? Well I'll just substitute for t1 and t2 like this. We can see that t2 must be t the overall tension divided by cos beta and t1 is the overall tension divided by cos alpha just from the previous equation. So now we won't need the diagram for a bit we can simplify. There we are and that is going to be helpful because we can immediately see that these quantities are tan so let me write that in. How can we get any further? Well we have to think what tan actually means so now we will go back to the diagram. What does the tan of an angle anywhere on this curve mean? In fact because it's so cluttered up in the focus area of our little piece of string I could draw a line at some other point. It's the same answer anywhere so have a think about this. Here I've tried to suggest the tangent to my curve at this orange point. What does the tan of that angle there which we could call I don't know gamma or something we won't be using it of course because it's not part of the region that we're interested in. What does the tan of that mean? Well the tan in a triangle the tan is of course the ratio of the two sides right so if this side was x and this side was y then and we had a little angle which we'll keep on calling gamma in there then tan of gamma is the ratio x over excuse me the there we are. So what does that mean when we go to our curve? Well we realize that it the tan of the angle is simply the gradient. It's how fast is y changing with respect to x at that point. We could if we put little delta symbols here then we can see immediately what we mean as we zoom in to the curve and we consider a little bit of y a little bit of x we must obtain the tan so we can immediately substitute where we have our tan alpha and tan beta for the gradients of the curve at those points let's do it. Oops I see that I'd written tan beta twice apologies for that I don't know how I did that so that should of course have been tan beta minus tan alpha so let's put those gradients in. Well we're getting there what I've emphasized in this way of writing things is I want the gradient dy by dx at the point which is the the right hand end of our piece of string of course that's the beta point or that's point b where the angle is beta and then I'm subtracting off the alpha point which is back at where x is equal to x so that's what I'm putting in brackets here just to emphasize that we're dealing with two slightly different gradients and then all we have to do is think how can we write that difference in a more elegant way we know that that although the gradient might be quite strong the difference in the gradient will be very small because we're only considering a tiny piece of string and so there can only possibly be a small change in the gradient between those two points the trick is and this is the same as we used in the diffusion problem what we'll do is we'll say well the that first element in fact let's just focus on this first one if I want to write that in a different way I could say well that must be the gradient just at x plus a little bit of a change which would be the rate at which the gradient is changing with x let's write it out explicitly times that little shift so it's the second derivative the gradient of the gradient times however far we're going but then we can see of course what the trick is going to be is that the gradient x now appears twice and so we'll be cancelling it out and that gives us a very simple equation let me write it out there I've written out I've also taken the opportunity to correct uh sneakily correct another error I'm sorry I'd written d2y by dx squared over on the right whereas of course that side is by dt squared so there we are this gives us then quite a compact form it would do if I remember to put the dx there we are so that equation is what we've reached and we can see that we're going to be able to cancel the small the the distance delta x from both sides and we may as well move all the constants to one side and even give it a new symbol so that we so that our final equation has the most elegant possible form let's do that there we are we're done let me put a box around it because it deserves it now I've introduced a symbol c squared because I know it's going to be helpful to just define it as the constant squared in this way it's simply that ratio between the tension in the string and the density per unit length of the string okay so of course we want to try this out we want to build an example give ourselves a reasonable initial condition for a plucked string and watch it go and see if we can solve it but before that there's an observation we can make straight away from the very structure of this equation this was the innovation due to the alemba which let me check when the year was okay sometime in 1700s delta and let's see what we get when we simply make a very smart choice of change of variables something then will come immediately out of these equations that's quite profound so this is the variable change that I want it's simply mixing together the space and time parts and because space and time have different dimensions we'll certainly need a constant that makes that work and that constant is c which by the way tells us that c is a speed right so c the dimensions of c must be a distance over time in order to make these statements dimensionally correct so with these variables what happens when we try and transform our equation instead of being with respect to x and t make them with respect to these new coordinates so let's write down the rule that we'll use to change a derivative say with respect to x to instead be derivatives with respect to the new coordinates so this is the chain rule type structure we come up with we see that the way that function change changes with respect to x is can be expressed as how fast is it changing with respect to u times how fast is u changing with respect to x plus how fast is it changing with respect to v times how fast v is changing with respect to x so it in this is hopefully a familiar rule for you and it makes a lot of intuitive sense and now of course we can actually write down what some of these things are so du by dx holding t constant is just going to be one and dv by dx holding t constant is also going to be one okay so what we really want of course is to take the second derivative so let's write out what we're after but now we can just regard the dy by du and dy by dv as just functions and we win we made no special assumption about the function y in the first place so we can just reapply the rule to quickly jump to what we need so in what I've written here these first two terms come from just taking the second derivative of the first term there and similarly of course the second two terms come from taking our d by dx derivative of the second of those terms and just following the same principle that we used the first time but now we can collect things up so that's just tidying things up slightly but now we have a nice further observation to make which is that when you for a continuous function like y so we're assuming some things I said we weren't assuming anything about why I guess we're assuming that it's not mathematically pathological it is a function which is capable of describing a string so it's continuous and you know it has this kind of sane behavior that we expect from our function which means that when we take the derivative with respect to one coordinate and then the other doesn't matter which order we do that in and so these two terms that I've highlighted in the middle must be the same so I can finally write that as there we are that's about as neat as it will go so that is what d2y by dx squared becomes when we put it in our new coordinate system now of course we have to do the same thing for d2y by dt squared but we can go quite fast because it's an extremely similar process let's just start it off and see how it goes there we are exactly the analogous starting expression and so the the difference oops excuse me this is of course for the first derivative and what we see is that this time we have of course du by dt and dv by dt because we're considering the time derivative but these what we what we'll find then is that we need to put in the constant c for both these things because of course we know that u is equal to x plus ct oh and we should have a minus sign hang on and v is equal to x minus ct so this one is minus c fine so let's just need that up a little bit and now we need to take the second derivative let me just do that without wasting much more time there we are and as before you can see that we just apply the the principle we we found above is just apply the second time to get the second derivatives and now we can tidy up again there it is and we find that we have a c squared constant out in front and again I've taken the two terms which are with these ones and just combine them they are both they're equal to one another so we just get a factor of two there now let's summarize well let's insert these two statements so our original equation just up to a factor of c squared that we will certainly find is in the right place we were saying that we just set the d2 by dx squared and the d2 by d times squared equal to one another let's do that and see what we're saying in the new coordinates there we are so I've just substituted substituted in the equations that we discovered and we can see that yes the c squareds are in the right place and we can just cancel them out and it looks like the right hand side is equal to the left hand side fine fine fine except then suddenly we notice that this term the cross derivative appears with a plus two on one side and a minus two on the other all the other terms can just be cancelled so what this is telling us just by change of coordinates is that that cross derivative is equal to minus itself and the only way that that can be true is if it's actually equal to zero so the discovery is that d2 y by du dv is equal to zero what does that mean well it means that if we were to write our function y in terms of these coordinates u and v then taking the partial derivative with respect to one of these things holding the other one constant and then taking the other derivative must give us zero what does that tell us about the form of the function y when written in these new coordinates tells us that the following must be the form let me write it down so what we're saying now is uh-huh if we write down our solution to the wave equation as a part that only depends on u and a part that only depends on v and add them up it's an addition unlike in separation variables where we generally have a product this is simply an addition of two separate terms then that will satisfy our equation because clearly taking the derivative with respect to v holding u constant will kill the f term and then the other derivative will kill whatever has become of the g term if these things were a product if there was even so much as a let's say a times u over on this side then our rule would no longer be followed because it would mean that one of these two terms would survive at least in the form of a constant after we have taken both our derivatives so that imposes this form which is a pretty you know that's a pretty strong conclusion if we must be able to think of a solution to the wave equation as a solution that involves only one of these coordinates added to a solution in terms of the other there must be something special about these coordinates what are we saying so the way to understand the implications of this is just to consider one of these two functions and then we'll see what it means to have both so let's just consider the g function actually so i'm going to say that my wave shape which so back in the coordinates space and time is going to be equal to just one of these two things so that if i'm going for the v then that means it must be a function of x minus ct that's no longer the general case that's just one of the that's a special case that only one of these two things that i'm allowed to use i'm actually gonna use and i'm setting i'm just choosing to set f is equal to zero for now what does that mean so let me draw out a wave or a distribution of y and we'll assume that this is at some particular moment in time there we are i've just drawn a curve nothing special about it and this is at some particular time i will call it time t z or the time t one now what i'm interested in is what will this line look like at some later time t2 well let me just draw on what we're going to get at t2 and let me just then i'll justify why i can get the function at some time t2 just by moving on a bit like let's move on a little bit like that so what you can see i've done here is just take the take it and move it a bit right so that's just a shifted on version yeah maybe i can make that more clear by drawing over it hang on and now if i erase underneath it there we are that's kind of nicer so the pink curve is the t2 line that's at t2 and the green curve was at t1 so what i'm saying is that if my function my solution for y can indeed be written as some function of just the difference between x and ct then at later times the shape of my curve will be the same as at any particular moment that i care to look at it it will always keep the same shape but it will just move along the x-axis and i wonder if you can see why so if i just consider that so let's choose a particular point i think this is the way to do it just focus on some point of interest let's take that particular point there and we'll call that x one and then the analogous point later on if my rule is correct will be x2 so provided that x2 is equal to x1 plus c times the difference in the two times as a positive thing so time two is later then we find that if we compute the thing that actually goes into the g function well for the green curve it was x1 minus ct1 and for the pink curve it's x2 minus and then well sorry ct2 but that if i use the substitution above there is in fact just going to give me x1 and then i'll have plus ct2 minus ct1 minus ct2 running out of space let me move up a bit ct2 and of course we've got a cancellation there let's change color cancellation pen we get to cross out that cross out that and we find that we're feeding exactly the same number into our function g and so of course we get the same number back so maybe stop and stare at that a bit to convince yourself of what i'm saying but because the function g can only see this hybrid quantity that is x minus ct then if it has if we can draw the shape of our curve for some particular fixed value of time and sweep x then if we consider a later fixed value of time we just need to move our entire function along a bit so what this means is that our function g which was one of only two parts that were allowed to use just the f and the g parts if we are writing our solution in terms of these new coordinates our function g is simply describing a wave that keeps its shape but moves in the positive x direction and then you can guess that if we were to have a careful think about that other function that we're allowed to use that f object that would be a wave that keeps its shape but moves at speed c in the negative x direction and that a general wave it's already interesting that those things exist right that that a solution to the wave equation or a solution allowed by the wave equation is a thing that keeps its shape and propagates in in the x direction in either direction but more than that what this is telling us is that we should always be able to think of a solution to the wave equation as something that moves in something that moves in the positive x and some potentially some completely different function could be a different shape but it moves at the same speed speed c in the negative x direction so that's I think a really nice observation to make just from looking at the fundamental equation itself and doing a coordinate change and this of course is exactly what we see right so when we throw a rock into a pool then we see ripples and those ripples move with a fixed speed if we throw a bigger rock in we get bigger ripples but they will move with is to first approximation the same speed of course there are higher order order effects in any particular medium like water dissipative processes and so on but to a first approximation in any medium and in mediums like electromagnetic radiation it's then strictly the case that we see waves propagating keeping their shape and moving with a fixed speed and they can move backwards and forwards across the medium order can be waves that go one way waves that go the other way and they interfere with each other so we the waves add up but that capturing the idea of something that keeps its shape and just moves is what we immediately discover just from this very elegant argument so I think that's really nice but now but now we're going to think about a scenario where we're fixing a string at two points and while we could try and express this in terms of waves propagating one way and propagating the other way that's no longer the natural way to think of it and so let's see what we find out when we investigate that by the way briefly going back to our original diagram if you were being very alert you might have said why did it matter that that I insisted that our string was fixed at x equals zero and x equals l where did that come in and you'd be right it actually didn't come in at all it was part of our story because it's helpful to then think of a string that has a certain tension because we imagine that it stretched to some extent even when it lies flat along the x axis so it's under tension and then when we pluck it it vibrates but we didn't actually use that property and in fact any it could be an infinitely long string if there could be such a thing as long as it had a certain tension along the string but now we will be using that fact but really for the first time because we haven't used it yet in our analysis so there I've repeated the diagram we had before but I've cleaned up all the annotation which we don't need now all we need is the conclusion we reached which is the wave equation but now I want to think how would we set about solving this in the coordinates x and t well as before when we were looking at the diffusion equation in general it's difficult to solve an equation of this form for all possible solutions which may mix together the x and the t coordinates in a complex way but what we can do is we can start to make some progress by saying let's suppose that the way my string is behaving can be described as just a product of a function that depends only on the spatial coordinates x and a function that depends only on the time coordinate so in other words we say let's limit ourselves and it's a huge limitation but we know from experience that we're going to be able to break free of this but initially we will say let's imagine that we have some function let's call it capital x of x and some function capital t not temperature but time of time so if we have a solution of that form we know that what we can do is then greatly simplify our equation because the partial with respect to x doesn't care about the time function and vice versa and so we can immediately turn our function our partial derivative has actually become full derivatives let me jump to the punchline because we have done this before what do we get so we get this function immediately or this equation and we can we've turned our partial derivatives into total derivatives because the thing they're operating on doesn't even mention the other variable and then our trick is that we divide both sides by the whole solution y and that leads us to and then the next line very similar to what we did before is to divide throughout by the whole function y and actually we'll divide by the constant c squared as well so that will just turn out to be a bit more handy so what they will then find is one over x capital x our function d2x by d coordinate x squared is equal to one over c squared one over t d2 capital t by coordinate t squared so here I've completely put all the x related quantities on the left all the time related quantities and the constant by the way on the right and as before we then have the argument that well since this is true for all values of x and t I could for example hold t constant and sweep x but then the left hand side that depends on x isn't actually allowed to change because I'm holding t controlling the right hand side constant and so it must be that the left hand side is in fact always equal to a constant regardless of the value of x same argument works the other way around these two things are both equal to some constant and now I just get to make up a symbol I go to call it minus k squared in the notes I think I use psi and that's just harder for me to write so I'm going to use k squared why minus k squared because I know that that will work out neater in the next few lines but I could have used any symbol that doesn't have to be squared and it doesn't have to be minus but then I'd find myself putting in extra stuff in the next few lines so what do we get as our separate our separate equations two similar very similar looking expressions now remember that when we were doing the diffusion equation because we only had the first derivative with respect to time our space and time equations at least were different to each other at this point but now they're practically identical the only difference really is that c square term on the right hand side and the solutions to these things are both both of them are solved the same way which is cause and sign like solutions so let's write down the general solution for each of these equations there we are that's the general solutions and I've introduced just temporarily a capital c symbol just so that I can go a b c d for my unknown constants don't worry we'll get rid of that in a minute because it is confusing to have two kinds of c around although I guess I've also got two kinds of x and two kinds of t anyway those are the sign and cause like solutions that will solve our separated differential equations what does that mean it means that a general solution that is separable must have the following form so there we are I've just multiplied the line above so I've multiplied the x and t explicitly so we can see this is the general form of our solution where capitals a b c and d convey anything we like there's even you could argue a bit more freedom than we need there in the magnitude of a you know we could move some of the weighting between a and b and c and d but that's fine we'll leave it in that form that is a separable solution but our equation is a linear one the full equation when we go back here this is a linear differential equation just like it was for diffusion and that has the very very powerful consequence that any solution we write down call it solution one and any other solution we write down solution two can always be added together to make a new legitimate solution we can keep on doing this if we thought of many different solutions we could add them all together and that would be a new solution what does that imply for our purposes well of course this solution it has freedom in the capital letters a b c d but the most interesting thing is this constant k which actually changes the form of the function changes the frequency of our signs and causes that can be any constant we like once we've set one of these then the other ones must use the same k but we can add we can we can add together an entire solution like this to a second entire solution using a different value of k and we can keep doing that for as many different k values as we like so what we find is that the general solution has to be of the following form or can be anything of the following form so what I've done there is I've just copy pasted the line above and put n subscripts all over the place so now my a symbol is in fact one of a family of constants a n a 0 a 1 a 2 and so it's my b and so it's my capital c and so it's my d and moreover this k quantity is also a set of different k values so for each particular k value there must be a cos like or sine like pi it's a sine of sodium part that varies with that k frequency multiplied by a time part that varies with the same k frequency multiplied by the constant c that pairing must always be respected but I can add together as many such pairings as I like and so this is very similar to the situation we were in with the diffusion equation of course except that there instead of this sum of signs and causes in time we had if you recall an exponential that was something like minus k squared and then some constant such as alpha for our diffusion and then t so instead of that on this occasion both the space like and time like parts are oscillatory but it's still the same basic idea because what we can do as we're about to see is plug in time t is equal to zero and bam we've got a boundary condition expression which is essentially an invitation to use Fourier series to describe our time t equals zero arrangement but let's let's step through that now what I'd like to do is think about anything further we can say about these constants a b c d given that what we're going to be interested in for the rest of the lecture is a vibrating string that is pinned like a guitar string at two points what can we say well the first thing that we can say is that when we set time t equals zero or in fact any fixed time it must be the case that at x equals zero we have no displacement at all and so that makes me come and focus on this term here and decide that I need it because what that will give me is a finite value for the display for the x is equal to zero but I am never going to need that I'm always happy that my x is equal to zero point has zero displacement a different way to say it is that I could imagine mirroring my string which I will just draw sort of with some dotted lines here I could make it into an odd function and mirror it's not really mirror so much as it is rotating it around in the usual way of an odd function and so that would be extending my solution and of course we do that when we use Fourier series to describe a finite problem a solution of that kind will always be fine that's in fact the correct way to extend this fixed function into the negative x direction and also into the direction of great x is greater than y we should extend it on by essentially considering what an odd function would look like where the origin is at that point the reason being that then there will never be any force any net force in the up down direction if you zoom if you imagine zooming in fact I can zoom in contact so having zoomed in on the x coordinate if I mirrored my function I keep on saying mirrored what I really mean is rotated 180 degrees so if I if I've enforced the principle that it's an odd function at that around the origin then okay I haven't drawn it perfectly but if I had drawn it perfectly you could see that the forces on the point at the origin would always perfectly balance out which is just what we want because we don't want the origin to move and as long as we were considering a an extended solution that by the way happens to have the property that the origin never wants to move then we're safe to stick a pin in it and say well I've pinned the origin so we've we've sort of constructed the scenario where the origin never wants to move by using the appropriate extension to our function all right and same argument works out at x is equal to l so what does that tell us about our constants well it it said we've I've just argued that I want an odd function in terms of the x coordinate just by thinking about the x equals 0 case so that allowed me to immediately say that all my an constants for this kind of solution for this fixed string should be zero all of them so that was easy got rid of one whole family of constants can I keep going in the same spirit and get rid of some other stuff well the next trick is actually to think about the velocity of the string so what I would like is to limit myself to cases where the velocity of the string at time t equals zero is zero so now I'm being very specific I'm saying this is a plucked string at time t equals zero so I am holding the string at time t equals zero and I release it so it starts from zero velocity if I'm willing to further constrain myself to those scenarios then I can take a look at the time part and just think about what that looks in fact I can write it out what does it look like in terms of a velocity oops so if I put a little dot above the y to show that that's the derivative of y with respect to x well of course that wouldn't affect the x part at all although by the way we've already deleted all the causes we've argued that they should go away but the cos terms here will become sines and have a minus sign in front and the sin terms here will become causes and we'll also oops not chalk cos and we'll also by the way have picked up a factor of lowercase c in front but that doesn't matter all I all I actually want to focus on is the fact that there's a family of sine like and cos like terms but at time t equals zero I want the velocity to be zero where that leaves me is we've argued we don't want the cos like spatial terms because of the pinned at zero condition we don't want these cos terms but they actually came from sine terms in the original expression of course so in fact what I should really do instead of me applying my deletions here I should go back to the expression above and say up here I don't want the causes and I don't want the sines because they become causes and I only want the terms that become sines and give me a zero velocity at time t equals zero so that simplified it a lot as long as I'm only thinking about a plucked string then I I reckon I should be able to do the job just using a solution of the following form that I reckon should do the trick I've introduced a symbol e as the constant that can it's just a pure number of scalar that is just telling me how much of each one of those pairings I want and they do have to be pairings now so the same k n must occur in these two things but of course I can choose to have as many different k n's as I like okay so there we've written down an expression that I'm claiming is going to give us all the generality we need to solve plucked string problems and in fact there's still one more thing we can do to simplify this expression or put a further restriction on it and that comes from our choice of these k constants do we need to consider absolutely every possible k no we actually only need to consider ones that are consistent with the periodicity of the function we're trying to build and we're going to use our trick as we've already said of extending a non-periodic function to make it periodic let's zoom out in fact the risk of making this look really silly and small let me try and extend this function okay that's the best sketch I can do it's not a great sketch but what I hope I've managed to communicate is that in the region from x is equal to l to x is equal to 2l I've just got the the same shape as between 0 and l but rotated 180 degrees around so this kind of mirror inversion that I was talking about and it's consistent with what I've drawn over in the x is negative region by the way because that would just match this region here of my overall repeating function and just for the same as the argument at x is equal to 0 the reason I like this is if I zoom in at the x is equal to l point I can see that the forces will forever and at all times be perfectly balanced so there is no force that's trying to pull my string away from its anchor point and that's why this periodic solution that is for all values of x is going to align with the scenario where we have just a finite function that's why it's the correct continuation but then the period of this thing is clearly 2 part a 2l the overall period is 2l so we should be able to use values of k oh let's go for a thicker pen again that our that are 2 pi over 2l times n and we can cancel the 2s of course so finally that gives us the form that we need to you we need to fit a Fourier series 2 we will set time equal to 0 that will cause the cos terms to disappear for our boundary condition and we essentially have the task of using a sine Fourier series to build any initial condition that we want for a plucked string but we know already what we want because a plucked string is essentially where the string makes a straight line between anchor point 1 and anchor point 2 and where we have our plectrum or thumbnail or whatever plucking it so let's draw that well and oh and we've already argued quite carefully how we're going to extend this Fourier excuse me extend this function which is that this is this is the up half and what will happen in the x is equal to l to 2l it's the the down part of our triangular wave so this is a triangular wave that's centered on the x axis and has a frequency of has a period of 2l now we can just write down what the Fourier series is for that because we've already worked with triangular waves before I'll do that now this that I've just written down is the Fourier series we want it may look a little bit different to the Fourier series we wrote down before for the triangular wave but the reason for that is that last time we considered the triangular wave we made it centered on the origin so the peak of the triangular wave was centered on the origin so in other words it was an even function made out of causes this is the shifted version that creates the same triangular wave but now as we want it now passing through zero at the origin so that's why we have a slightly different form with this minus 1 to the power of n that's a consequence of that change you can get from one Fourier series to the other just by introducing a shifted x coordinate for example now what I've written down here this is the the more primitive Fourier series actually isn't quite matching our scenario yet because it has a period of 2 pi and it has a it goes goes between plus 1 and minus 1 whereas we want to go between plus a and minus a and we want to have a period of 2l so now we need to just adjust that and that will be our solution at time t equals 0 there we are that's just made those adjustments so that should be our time t equals zero solution what then is our solution for all times well we just have to go back to our rule here and see that for every sign that's varying with some frequency k subscript n we must pair it with a cos that has the temporal frequency c times k which that's the same k so we just add that in now there we are as is often the case with these Fourier series type solutions we end up with quite a a big expression especially since here we we didn't want to have a period of 2 pi we wanted it to be realistic so that we could type in an l number so we have those constants floating around here but conceptually it's a pretty easy thing once we're familiar with Fourier series it's just our Fourier series that solves the boundary condition with the appropriate time like factor inserted for each term so to be very clear about it this quantity here is the same as this quantity here and you can see the extra c factor that's speed of our wave is the is correcting between the spatial frequency and the temporal the temporal frequency i guess angular frequency so there we are that's our full solution so here we are in Mathematica i've set the amplitude equal to 2 the length of our the distance between the fixed points on our guitar string is equal to 4 i've set a value for the speed and then as you can see here i've defined our y function exactly as we derived it just now i've also introduced a symbol kn just to keep things a little bit not too crazy and you can see that the the key line is this one here which is exactly copied across and i'm considering 20 or 21 terms so a pretty good but not infinite number of terms in our Fourier series and i'm already plotting out for us here what it looks like at time t is equal to zero over a range which is slightly bigger than the full range so remembering that the way we extended our function it actually has period two l even though we're any interested in the part from zero to l this is exactly what we expect to see right it has a period of two l that's eight and it has the right amplitude and it has the right triangular waveform so now let me tighten this up a bit now i'll zoom in to say i don't know negative 0.5 to l plus 0.5 just so that that's the region we're really interested in just going a little bit beyond the fixed points and let's start running time forwards and see what happens so let's run it forward a little bit uh what do we get oh that's easy quite a large bit all right let's run it by and it's quite strange shape right so this is a moment after we've released our pluck string and it seems like the prediction that we're getting from our equations is that we have actually a straight line it's quite strange as we've released it we've got a flattened off triangular wave what happens if we run on so we were already looking at this one but this is what we see later so that flat region just widens and the triangular wave just kind of sits there waiting for this flat region to reach it quite strange and then if we go to maybe a further 1.5 okay so let's maybe go to 2 then and maybe 2.4 it's doing a mirror image of what it did before it's starting to build that same triangular form but now in the negative uh wide direction so if we go out to I don't know 4.4 or something like that we see it's it's it's nearly finished building that and then we can guess what's going to happen it's going to oscillate backwards and forwards in fact uh Mathematica has a function that allows me to um to to to control time just with the slider let's use that so here's exactly the same uh thing again but this time I've got a little slider that I can move and I'll do that and here we see there we are that's what Mathematica predicts let's do it again so we should see this collapsing uh ripple essentially and then it builds itself up in the negative y direction now and then it would come back again of course and uh it will keep on doing that now that do we believe that do we think that that's actually what would happen if let's not say a guitar actually a guitar string I keep on saying guitar string guitar string has a very it's not very stretchy so if we wanted to see this um you know in a real experiment we would actually want to use something more like a piece of elastic because it's more stretchy so we would be able to deflect it much further and and see and you know see something like what we see literally on the screen can we do that experiment well I can't do it for you because I don't have the the gear here but fortunately I found a YouTube video and I should put the reference to it into this video because it um someone else has done the work for us and we can see whether what happens in the real world is a bit like this or have we really just made so many approximations and assumptions that what we've ended up here is an artificial solution okay so here we are the moment of truth has our maths been any good here is someone has done exactly the experiment for us there's that stretch string it's being held by some kind of little release mechanism and I can sweep sweep forward in this video just like I was on the Mathematica but what kind of shape will the wave have let's have a look look at that pretty much exactly what we predicted and it even inverts down and starts to build the same thing so we're seeing seeing some slight curvature but wow look how perfect that is okay so I think with that success story I think it's a nice moment for me to sort of wrap up the lecture so there we are that that I think is a really nice vindication of the material certainly in this lecture but of the techniques we've used in general now at the beginning of the course I promised that we would introduce some tools Fourier series and Fourier transforms that would allow us to describe real world situations that otherwise would be very very tough and indeed even something like the triangular wave it's not a very natural thing to describe mathematically unless you understand that it can be broken down into the natural sign and cause entities so there we are it it works and uh let's leave it there and I I hope you've enjoyed the course thanks a lot