 Hello, I'm Simon Benjamin. Welcome to the fifth of my lectures on Fourier series, Fourier transforms and PDEs, partial differential equations. And this is the first of the lectures when we will be getting into those partial differential equations. So what does this lecture contain? Well, we're thinking about diffusion. So that includes how heat flows in, for example, a solid, but also how matter spreads out. So, for example, how a gas might diffuse into a space or how atoms might migrate around inside a heated solid. It's really very general and important stuff. And we'll in particular be encountering the heat equation. But I'll be showing you that that is actually essentially the same thing as the law that handles how matter spreads out, which is called fixed second law. We'll then be using that equation to figure out how a particular kind of scenario would unfold. We'll solve it. And that will be one where we can kind of guess the answer, which is a bit of a cheat. So then we'll ask, what if we're faced with these equations and we need to understand a particular situation, a particular scenario which could be a heat propagation or it could be gas flow or something that's important for research or design. But we can't guess the answer. What mathematical tools will allow us to take on these differential equations? And the answer, of course, is Fourier series and Fourier transforms. And that's why we've equipped ourselves with that gear is exactly in order to tackle quite realistic and challenging problems. So let's go. Right, let's get straight into it. So what I want to do is think about the flow of heat inside a solid. We'll take it to be a solid bar of metal, just for the sake of making it a definite example. And let me just sketch that and then I'll talk about it. Now, I should mention that there are some notes that go along with this course. You can find them, for example, at simonb.info. And these notes have spaces for you to add things like this sketch. So now what's going on here is I've just drawn a bar. I understand it to be a long, thin bar so that I can make it a one-dimensional problem. I don't want to have to worry about the y direction or the z direction in the maths I'm going to write down. So we will erase that straight away. What we'll assume is that however the heat is distributed in this bar, it's the same across the cross-section. But where it does vary is along the length of the bar. It's a reasonable assumption if we make the bar thin enough and so we'll assume it is thin enough. This doesn't really restrict us to only ever thinking about 1D problems. It simply allows us to get to an equation which is one-dimensional and we can generalize that if we want to. So let me mark off a region of my bar here. That is the one we're going to think about. I'll draw it with a finite thickness but I understand that in due course I'm going to make that disappear down to arbitrarily narrow. And I'll say that we're calling the... So it's a slice and the left hand side of that slice is at location x and the right hand wall, if you like, of that slice is... we'll write it as x plus delta x. Now we understand by the way that this symbol delta x, it doesn't mean delta times by x. It's just its own symbol. We could use a different... we could write k or something. But it's usual to use this little symbol delta and then a variable to mean a small change, a certain small change in the variable. So that's a single thing. It's not two things multiplied together. All right. Now that's our little region and also I want to... So I could draw in some dotted lines, sort of highlight what that is. Of course the bar isn't physically sliced up that way. We just imagine a region that is mathematically defined from here to here. There's nothing special about that region. There are no actual cuts in my bar. Now I'm also going to consider a small amount of time. I'm going to consider time from, let's say, t to t plus delta t. Now what I actually want at the end of the day is to capture mathematically how the temperature inside my bar will change because heat flows. So let me draw a second diagram just to capture the idea of that. There we are. I've put that on. Now this symbol theta, capital theta here, is what we're going to be using, that symbol there, to mean temperature. It saves me writing capital T, which later on I'll want to mean something else. So theta means the temperature. And you can see I've just drawn a squiggly line here which shows how the temperature might be varying inside the bar at some moment in time. So that is against x. Now if indeed that's the distribution at some moment in time, I want an equation that governs how the temperature will later change. We can assume the time being that this bar is insulated from the rest of the world. So heat energy is not going to flow in and out of the bar, but it will flow along in the bar. And we can imagine that the irregularities will even out. That's our experience from everyday life, right? Hot things cool down until everything is at an even temperature. But what governs that? We have to discover it. So what we'll be doing is thinking about how the energy, the heat energy, the amount of energy that's just sloshing around, essentially, thermal energy inside our little slice of the bar will change over time, over the, in fact, this little interval of time, delta T. So we can also write delta E for the change in the amount of heat energy inside that slice. And we'll need to figure that out. And what we'll do is, in fact, we'll figure out, figure it out two different ways, set them equal to one another, and that will give us our governing equation. But first things first, we need to translate between the observable thing, which is the temperature, and the quantity that's really flowing around, which is heat energy. How do we do that? Well, if I told you that our little slice is at a certain temperature, or in fact, if I told you that that temperature changes a little bit, so again, we can use our delta symbol. Suppose the temperature of our little slice changes by delta theta. How much, therefore, has the energy changed by? Now, fortunately, we've already met, you'll have met probably a long time ago, the concept you need to relate the temperature to the energy, and it's simply heat capacity. The heat capacity of a material is how much energy you have to put into it in order to make its temperature go up by a certain amount. And that's what we need here. So the heat capacity is usually written as the specific heat capacity, which is the amount of heat you have to put in per kilogram in order to make the object go up by one degree Kelvin. Let's use that, and that will allow us straight away to relate the change in energy content of our slice to the change in temperature. So what we need is the specific heat capacity, which we can just write as C, but we also need to multiply that now by the mass of our little slice. Well, what is the mass? Let's say that the area, the cross-sectional area of our bar, we can write it up here, area is capital A. All right, so how does that help? Well, the area times the mass of our little slice the length of our little slice, delta X, is clearly going to be the volume because that is just, let's mark in what the area is, that's the area, and it comes to our little slice. And if we multiply that by the thickness, there we have the volume. We don't want the volume, we want how much it weighs, the mass of it, I should say properly. So then I have to multiply by the density of the material. Okay, well, fine. I'll throw in the symbol rho that means the density. And then if I multiply all that by the change in temperature, then we've got it. That's how much energy must enter or leave if the temperature is going down, our little slice in order to change the temperature by that much. So let's just be clear, that rho symbol was the density. Good. Well, that's one way of thinking about things, but that doesn't give us an equation. That just tells us, well, it relates the energy change to the temperature change, but it doesn't allow us to bring in this concept of how that's happening over time. For that, we simply have to write things down through a second line of argument. How can we get at that? Well, what I now want to think about is that heat energy is entering and leaving our slice. So here I'm drawing it in terms of flow in the x direction, just so that I can put it on the diagram in a clear way. Some energy is entering our slice, or perhaps leaving it, but let's call it positive if it is entering our slice on the left-hand side, where we have coordinate x. And some energy is leaving, let's call it positive if it leaves, at the x plus delta x location. The difference between these two things, because of conservation of energy, must also be another way to write how the energy is going up or down. So if more is coming in than going out, then it must be going up. All right, how do we get at that? Well, we need to now relate temperature to how fast heat is flowing. And that is not something you've necessarily met before, unlike the specific heat capacity. If we say that we have a temperature gradient in our diagram, so in fact, let me move my diagram around a little bit to help you make this point. What I've done is I've moved my line around a little bit so that it looks a little bit simpler when I draw downwards, the vertical alignment between the slice and my little temperature curve there. So we can see that the way I've now drawn it, it looks like the side of the little slice on the left is at a higher temperature than the side on the right. Okay. It looks like then heat will, we would intuitively expect, flow into the slice from the left hand side and flow out of the slice to the right hand side because we would expect that, of course, heat is going to flow from the regions which are hotter into the regions that are colder. How do we actually make that specific? How do we make it definite? What we need is to propose a way that the rate of energy flow is related to the temperature gradient. And there it's Fourier again. So when Fourier was thinking about Fourier series, it was in the context of this kind of problem. He was creating tools and they're great tools, as we'll see in a bit, for solving these problems. So he was also very interested in heat and what did he come up with? He came up with the following proposal, which turns out to be extremely accurate. So there we are. I've written it out. It's Fourier's law. What's it saying? Well, Q, the quantity on the left, is exactly what we want. It's the rate of flow of heat energy. It's called the heat flux sometimes. So it's actually the amount of energy that's flowing per unit time. So that's a power, technically, per unit area. It's exactly what we want. If we know that, then we'll know how much energy is coming in and out in our little period of time. But what's over on the right-hand side? What is Fourier telling us about the heat flow? That it is depending on the gradient of the temperature. There's a constant, of course, because some materials will have faster heat flow than others. And there's a minus sign. So what this is saying is that when the gradient is going down, as it is in the region that I've highlighted in our diagram, that's a negative gradient going on there, then we should see a positive flow of heat. So heat in terms of the x direction, the heat will be flowing in the plus direction. And that's right. As we've argued before. And that how steep that gradient is determines how rapidly the energy flows, how much energy flows. So that's completely intuitive. I would suggest that's the easiest equation we could possibly write down that captures common sense. We know that if we have a very hot object, it will radiate more heat. It will put out more heat than if we have a cold object or if we raise in our case of our bar, if we raised a region of our bar to a very high temperature, then more heat would flow initially than later in the process when the temperature distribution was more regular. That's common sense. That's just our experience of the world, captured mathematically in the simplest possible way. So it turns out that's a great description and we will use it. But it was Ferrier who sort of wrote that down mathematically. Given that we've got that, can we now write how our energy content will change in a second way as we can? So I will just write that down. Don't think we need our figure anymore. We can say that a second perspective must be that the energy change must be, well, the flow of energy, let's say at X, so that's at the left-hand side of our slice, times the amount of time that goes past, times area. Because as I said, Q is the energy flow per unit time per unit area. So this is how much will actually flow in the little snapshot that we're considering. But that's only the energy flow on the left-hand side. We must also consider that it's exiting, the energy is exiting on the right-hand side. So we better take that off. So that's minus Qx plus delta x and then the same factor. So we'll immediately be able to simplify this. Let's try and neaten that up. So what we've got is a delta t and then the difference between these two Q factors. Okay, well, we need to see if we can do some more work on that. Where we have the difference of two functions at a point and a slightly further or shifted point, we can use a trick. We can think how fast is that function changing with X and then multiply by a little shift in X. Let me show you what I mean. It's easier to write it down than to say it. We can write. This would be true of any function, by the way. It's not a special function of Q at special property of Q. There we are. So I've written out the trick I want to use. It's nothing special about the fact that our function Q happens to be a flow of energy. It's true of any function that's continuously varying, which we know what we can't have here is sudden discontinuities. We understand this is a physical quantity, the flow of heat that will smoothly alter over space. And that means we can safely write down the following. That the flow rate at some point that's a little distance away from X must be equal to the flow rate at X plus how fast is the flow rate changing with X multiplied by that little shift in X, the width of our slice. But now we can substitute that into the line above. Let me give myself some more space and write that the little change in energy that we have must be equal to area, delta, time. And now we have what we can see. Let me just write it out. There we are just by substitution. But what we can see is we can just immediately delete the flow rate at X and just focus on the last part there. And simplifying that up, what we're asserting is that the change in energy is area times the amount of time times by how fast is the flow rate changing with X and times by our little shift in X. Now this has all been in terms of Q, which is fine, but we really want it in terms of the temperature distribution. And as we said, Fourier's law will help us with that. So this is what we now need to use to substitute that in. Let's put it over here so we can see it. And what that means is that really our little change, oops, our little change in energy, but we're going to have two minus signs that will cancel. That's good. Delta T, delta X, K, our constant K. And now D2 theta by DX squared. Our derivative becomes a second derivative. All right, that's pretty good. So now we've captured how the energy is changing by thinking about flow of energy. Let's go back and find our first observation based on the specific heat capacity, which was this one. How are we getting on? Let's compare the two. Well, one of these is now written in terms of a small change in time and a small change in X. The other one has a small change in X, but it's written as a small change in the temperature. I want to go more basic with that. Unfortunately, it's easy to do. I can simply recall that a small change in temperature must be just how fast is temperature changing with time times how much time has gone by. And with that substitution, we're now ready to equate these two things and see what we've got. I'll do that now. There we are. Now we can see we're going to get some very nice simplification by cancelling quantities. Now the rules we wrote down were true in the limit that these quantities, the small change in time and the small change in X were infinitesimal. But we can just imagine that we're making them smaller and smaller but keeping them, of course, the same on both sides of this equation. So at any point we can just cancel those out. So there we are. That's a lot of nice simplification. We also noticed that the area cancels because it was important both in thinking about this specific heat capacity way of looking at things and the flow of energy way of looking at things. All right. Well, now what have we got if we tidy this up? We have this expression. Fairly neat. Doesn't look like it's necessarily going to be all that easy to work with. It is a partial differential equation but it's not too bad. And we can see that k, the heat capacity c and the density row are all just constants. So to make things neater, we could just use the symbol alpha to represent that particular combination of constants making our equation easier on the i and more compact to work with. But there we are. That is the heat equation. We've got it. That there. Let's give it a label. Now we have our heat equation. I mentioned that diffusion of matter such as a gas spreading out is exactly the same mathematics. If the mathematics is the same, the formal word for that would be isomorphic. It's mathematically has the same form. But what is the equation? We may as well write it out. It's a good time to do so. So this would be called fixed second law. So there it is. You can see how similar it is. I've just used different symbols essentially written the same equation. So we now have a capital D which is the diffusion coefficient for the material or gas that we're considering. And we have a symbol here. I've used five but it may be written in other ways. That now means the density of the diffusing substance which is instead of our temperature distribution. But the form of it that it is a second derivative with respect to x and a first derivative with respect to time is the crucial thing that makes it the same. So this is fixed in one of its forms. There we are. All right. So we've got it. We've got the heat equation. How does that help? Well, it helps a great deal. This is going to govern how temperature evolves in any situation that we care to think about. So let's think about one and see if we can sort out the maths. I want to think about a bar that's actually an infinite bar because I don't want to have to worry about the limits, the boundaries of the bar for our first example. So we'll say it's an infinite bar but we're looking at some point along the length of this infinite bar and we'll call that x is equal to zero. Now I want to imagine that I take a blow torch and so okay. My bar is going to be at some temperature let's call it theta c, theta subscript c before our story begins. But then also before our story begins I've taken a blow torch and heated the region around x is equal to zero. And then I switch the blow torch off and now our story actually begins. Now to make it something as this is just our first example in order to make it something we can handle I'm going to assume that the mathematical description of the temperature is a nice simple one that approximately matches the story I've just told. So what would I draw for that? I'm going to say that the temperature so this is x equals zero middle point the temperature initially has this distribution it's simply a Gaussian. So what is a Gaussian? It goes as e to the minus x squared. I haven't drawn it let me try to draw a little bit better but again it's a kind of tough to draw with the just freehand. So what this is is e to the minus x squared. So it falls off according to the square of x. It's a very very common function that we write down and often it's mathematically quite a friendly one to work with so I'm hoping that we'll be able to get somewhere with this as our initial distribution. So it's not a hundred percent realistic because it never quite falls down the gradient never quite goes away. So it's still slightly changing at any distance out in x which sounds a bit wrong for a blow torch that was only on for a while but it's pretty good. It's giving us a raised temperature in the center of our region and it's giving us and it drops off in a kind of smooth way so it's a pretty good first effort. In fact I should shift it up a bit let's do that. Okay I've fixed up our figure a little bit because I did say that the bar was at the cold temperature before the blow torch acted so that must be the lowest that our temperature distribution will go to and it is picking up to what I'm calling theta H the hot point in the center of where I was focusing the blow torch. So actually I need to let's see if we can start writing out what is our temperature distribution at the beginning of our story. Well I want it to be the cold temperature plus a boost to the temperature which I could use this capital delta symbol for and I'll say that's the initial boost is multiplied by e to the minus x squared. So now at x is equal to zero I get the full effect of that boost and since I know that I want that to come out as the hot temperature I can write that the initial boost is just the difference between the hot and the cold temperatures and that will work because if I put in x is equal to zero that will give me what I want. On the other hand as x goes off to infinity or minus infinity e to the minus x squared becomes zero and I just have the cold temperature that's what I want. There's one extra ingredient though I want the width of this distribution let's use another color here I want to be able to say what that is because you know I want to be able to choose my own scale for that maybe it's roughly a centimeter wide the region I've been blasting with my blowtorch or maybe I used a massive wide blowtorch and it's 10 or 100 centimeters wide right so what is that? I'll say that I'm going to introduce a symbol l for the initial characteristic width of course it doesn't have a sharp width because this gradually decays down to zero but if I were to introduce to my distribution if I divided x by some constant l for the initial distribution that would do it because that would set a kind of length scale it would mean that x needs to be l in order for the temperature to have dropped off by a factor of e and if it's if x is 2l then we'll have dropped off by a factor of e to the minus two squared e to the minus four so l now sets our characteristic length and we're going to want that and I'm using l in it I've written in it meaning initial on all these things because I know that things are going to change but that's how I want my initial distribution to look all right how would we proceed so I'm not going to do the line by line detail derivation but I'm going to outline how we might get there what we're going to do is take a guess which is always a great way to solve a differential equation you guess what the answer might be you try it out you use you then fix any variable elements of your guess and hopefully if your guess was a good one that's a legitimate solution that is a perfectly solid way to solve differential equations it does leave us with the puzzle of what to do if we didn't have a good guess but we'll come onto that so what should we guess in this case what would you think will be the shape of the distribution at a later time actually in speaking of time I'm going to say that the moment when I turn my blowtorch off I'm going to say that that happens at time t in it so I'm using this subscript in it to mean initial in each case the initial height of the temperature change and the initial width of it and also the time now why am I not just saying look let's just call it time t equals zero it's actually because I know where the equations are going to take us and it will be convenient to be able to just say oh the initial moment is at so and so time of course we don't care right I mean I can it's the same physics whether I call the first moment t equals zero or t equals 10 or t equals 57.3 the point is how will it change as time progresses by allowing myself the freedom to later pick what I call that first moment it will just make the solution simpler and they you know they're gonna they aren't all that simple so we want that okay so that's fine t in it is the moment when the blowtorch goes off and the temperature can start to redistribute itself all right what how do we get any further we have to guess a solution we have to guess what's going to happen here's my guess I think the shape the Gaussian shape is going to stay there it's just going to spread out more and more I don't see why my heat distribution should change radically into any other kind of shape it's already a kind of slowly smoothly evolving smoothly shaped thing maybe it will just stay shaped like that but spread out more and more let me sketch what I mean there I've drawn a second sketch so the one at the top here is just our distribution at what we're calling t in it the initial moment that the blowtorch goes off so we have our full height of our temperature irregularity in the center of the bar and it has this characteristic width l and now what I'm proposing things look like look like at a later time is that we still have the same kind of distribution but it's dropped down so the peak temperature is less and it's broadened out so our equivalent to l which characterizes how wide it is is now a larger number that's my guess let's see if it works so I now have to write down my proposed form for the temperature distribution as a function of both space and time and see if we can make it work there we are that's my proposal it's the it's the same kind of expression we were having before except I've allowed now the characteristic width l to become a function of time I know what it should be at the initial time but I'm saying that it's going to go up over time and the delta which was giving me the height of that temperature peak I'm also making a function of time all right that's my guess can I relate these two quantities I don't think I can write down yet what they are but can I at least form a relationship between this quantity the way that the width of the distribution changes in time and this quantity the way that its height changes in time I actually should be able to do that even before I go and bring out our heat diffusion equation and plug it in and the reason is that I'm assuming heat isn't escaping from the bar it's just flowing along the bar so the total amount of heat that I introduce from my blowtorch is always inside the bar conserved it's just spreading out more so what that means is if I were to integrate over the full length of the bar multiply my temperature by the specific heat capacity to translate from a temperature into how much energy that should be conserved so what that what that practically means is the area under these two curves that I've drawn must be the same as it gets wider it must get lower in a way that conserves the area now I could take us through the the the careful argument for why the following is the case but I'm just going to say that the way that the width and the height must be related if the area is going to stay the same is what you would guess which is simply that the width must be proportional to that's a proportional sign and one over the sorry the height is proportional to one over the width so that the product of the two stays the same as another way of thinking about it right so as we make it wider we correspondingly make it shorter twice the width half the height it's what you would expect and i'm telling you it is correct so we can in fact substitute in and simplify our guess at least reduce the number of unknown quantities and then put it into our diffusion equation so there we have it that's my guess you can see what I've done there I've used our initial height and width of the distribution to substitute in so that now you can see that as this quantity here how our width varies with time when we put in its initial width then that's just going to cancel top and bottom and give us our initial height and so that that works out but now in order to see if we can really solve our diffusion equation using this form we need to try it what happens when we plug our expression into that well the differentials whether they be partial by x or partial by t will certainly get rid of the constant which is our cold temperature of the bar that's fine and we can also see that any constants that multiply the actual function part will also cancel so these whoops these will also cancel and we'll end up with just the interesting core of it so let me quickly write that out okay that's what we have to somehow make work with the right choice of how the width varies with time we're asking is there any way we can choose l as a function of t that will make this equation work if yes then we've guessed the right approach if no then it was wrong to say that the shape will stay a Gaussian all right well what will happen so we could write it out and we'd have four terms in total two on the left two on the right i'm just going to tell you what that would simplify down to if we didn't make any slips what would our condition turn into well after admittedly quite a lot of tidying up of those four terms what we would find is the following very compact expression provided that we can think of some function l of t that satisfies the following we're done the partial of this function with respect to time is equal to just two alpha remember alpha is a constant divided by the function so roughly we're asking what is it that when you differentiate it it's equal to one over the original function well i'll give you a second to think about that well what you may have spotted is that if you take the derivative with respect to time of something that goes like t square root of t t to the half then that will become a half t to the minus a half and so that's that's our trick that's what we need to do that tells us how we're going to solve this and all we have to do is just make sure that alpha factor comes out correctly what we'll end up then is the following we simply find that our length as a function of time must be just two times the square root of alpha times t and let me paste in for you a little check argument for that so what we find is that when we take that differential just to make sure we've got the constants correct then we can rewrite we can write the answer in this way and that thing on the bottom is indeed just L of t again so we satisfied our expression so that's what it needs to be in order for our guess to indeed have been correct good so now we can write out our final expression but just before we do that we gave ourselves the freedom to have different to have to define the starting point of time as just t in it and we said well we don't care we don't care what we call the first time moment we just care how it evolves in time so now we can actually find out what we should what we should call that first moment when the blowtorch switches off because we know that the length at t is equal to t initial should be just the initial length but now we have that function so we can substitute that in and what we're saying is that two times the square root of alpha t initial is equal to L initial in other words that t in it the moment our clock watch clock stop watch or clock one or the other is equal to simply square and divide so that's going to be one over alpha l in it over four squared there we are so that's our initial moment but that's not very important that's just good to get that nailed down let's write out our expression that we have deduced must be with that use of our initial time what are we saying what was this guess that has worked out let's write it all out so that we are done there we are that is it uh it's a Gaussian it has a e to the minus x squared divided by some constant times time that's the core of the thing out in front we have a bunch of constants that make it work and again we're dividing by now the square root of time which is showing us how the height of the function must be dropping that the peak temperature is dropping with the square root of time okay so we've our guess worked it was a bit of effort and I even skipped over some of the you know some of the working and just told you how things tidy up but at least it is possible to solve our diffusion equation in the way that we often solve differential equations which is just making a good guess and showing that that guess works and it's quite a nice example actually now just before we move on here's a nice little fact by solving that problem we've solved a second one for three let me show you what I mean okay so the diagram above is the one we've been working on it's our infinite bar that got blow-torched in the middle of the bar what have I drawn below I've drawn the initial distribution of temperature I might consider for a different problem this would be a bar which goes off to infinity in let's say the positive x direction but but stops at x equals zero it would be called a semi-infinite bar if you want to think of it that way and what I've done is I've imagined that I've heated up the end of the bar by just blow-torching let's say right on to the end of it so there the initial distribution at some initial moment is that it's hottest at the end of the bar and it drops off going into the bar and then I ask how does that after I switch the blow-torch off same same story how does that heat distribution how does the temperature distribution in particular change well that might it's clearly a similar problem I've also started with a Gaussian a kind of initial distribution but you might think we have to go back to basics and think about it all over again because now it's not the midpoint of a bar it's the end of it but actually symmetry allows us to see that the solution is exactly the same exactly the same it's just that the bar is not defined for minus values of x so we ignore the function at minus values of x but wherever we have our bar existing for all positive values of x it's exactly the same expression this one that we just derived why well have a think about how heat must be flowing in the original problem that we did solve it's never the case that any heat can flow from the left hand side of the diagram into the right hand side of the diagram that never happens because of the symmetry of the problem it's always the case that the hottest point in our distribution is at x is equal to zero heat is flowing out of that region actually symmetrically if we imagine a little slice of material at x equals zero that the heat will be flowing out of that equally to the left and right but it will never be flowing in so we can just slice our problem right at that point and everything follows through the heat can only move from the left to the right in the positive x region so by cutting our problem in half we actually have an altered anything at all so that's something to think about but that is a an example of how powerful it can be to just notice a symmetry in the problem here the symmetry is that x equals zero is special and heat only ever flows out of a little region around x equals zero are never in so if we cut it so that there is no region on one side doesn't make any difference because no heat was flowing in there anyway so the guess worked great but what do we do if we can't guess our way to the answer well there is another lesson that we should just quickly learn from our solution here what happens when time goes to a arbitrarily large a very large values time goes to infinity well we can see that this will become e to the power of zero which is just one but here's another factor of time which is dividing this second part of our equation and so that will become divided by a huge number and disappear so in the end for very large values of time we will just have our bar at its colder temperature and that makes sense because we just injected a finite amount of heat into an infinite bar and when it's finished spreading out the temperature won't have changed by any finite amount from its original cold temperature there's a phrase for the part that or the part of a temperature distribution that exists in the infinite time limit when things have completely settled down it's just called the steady state and then the interesting bit that captured for us how things were different from the steady state at the beginning and that gradually decayed away and changed that's this whole part here now it would be called the transient in other words temporary part of our solution so our solution has a steady state part and a transient part that is very often going to be the case when we try and solve more general problems that we can't guess our way to now in order to think about how we might tackle general problems what i'm going to do is go and get one of our diffusion equations we'll have a hard stare at it so we had two of them one of them was the equation the heat equation and the other was our fixed second law which is for the diffusion of matter we were working with heat before so let's this time take a turn doesn't clearly doesn't matter which one i choose mathematically they're the same and that's whiz down and take a look at it take a hard look and figure out what might be a way into it if i were given an initial distribution of say gas spreading out into a chamber it's initially has some specific distribution or even just gas along a pipe to make it a one deep problem how would i solve it if i couldn't guess the form of the solution it would be tough or it seems like it would be very tough is there anything i could say to start to make some progress well i could restrict myself to a very artificial case and then hope to be able to generalize that's always a good technique to see that you can do something understand that and then try and broaden it what would be that very special and limited initial case it would be the following if i assume that the distribution the density of my material there is in time and space just as a product of something that only depends on time and something that only depends on space on x that is a huge restriction by the way our solution that we were just working with certainly doesn't meet that condition because we can see that x and time are interlaced with each other even just inside the exponential there we certainly couldn't have written our previous solution that way and that's a hint that this is a hugely constraining assumption but still let's go with it and see where it takes us it's going to help because the partial differentials the partial differential in x will ignore the time part now and regarded as just a constant and similarly the partial differential in time will ignore the space part let's write out what we get well that's that's what we get we find that our partials are now as promised just acting on the parts of the product that they care about and that does allow us to do a further simplification we can actually remove the partial differentials now and write it as total differentials because when a partial acts on something which is purely depending on the variable that it's interested in then it's the same as doing a total differential so that you know maybe that's helped a bit but it still looks pretty tricky now the next move seems like it's going to make things worse but it'll actually make it much better i'm going to divide both sides of my equation by the complete function and actually by the constant d as well so i'm going to divide both sides by capital x and capital t and see what we get there we are doesn't seem to have made things much nicer now i've got one over some functions but it in fact has made a profound difference because what we can see is that the object on the left is only a bunch of functions of x there is no mention of time at all on the left and over on the right remembering that capital d is just a constant we've got stuff that varies with time but makes no mention at all of x that's kind of interesting but how does that help it helps in the following way this equation has to be true for all values of time and all values of space because we're just taking the diffusion equation all of time and space for our problem and just substituting in a particular form of solution that okay it's a special form of solution but it's a perfectly reasonable thing to put down how can it be the case that this this line is true because if i fix time i'm allowed to vary time and space however i like and this has to stay true if i fix time and just vary the x coordinate then the right hand side stays fixed and i'm varying the x in the left hand side but it can't change because the right hand side stays fixed and similarly if i were to fix x and vary time in fact everything on the right would have to despite the fact i am changing the t variable that goes into it it can't change because the thing on the right wouldn't be changing so the only way that this can be true for all values of x little x and little t of x of space and time is if in fact the equation is equal to a constant both sides are just equal to some constant you might want to pause and think about that because it's not a completely straightforward idea but it follows from the fact that we've got all the x stuff on one side all the time stuff on the other and yet it must the equation must be true for all values of x and t what constant am i going to choose i'm actually going to choose the constant minus k squared i have to clearly put down some symbol um and so what we've discovered is this whole both sides must be equal to just some constant i could write a constant k i'm choosing minus k squared because i know that that will just make the following equations neater let's write them out what do we get when we now can take this apart into two separate equations one that's just time and one's just space okay there they are and this looks much more doable right so now two simple equations that i can just write down the answer to probably because they're pretty simple differential equations what is it that capital x needs to be in order to in order that the second differential of x is equal to minus k squared times the original function well actually it's sine or cos if you take the differential twice you get back from cos back to cos and from sine back to sine and you pick up a minus sign if there's a k squared out in front it must be that it was sine k or cos k so the general solution would be for example some combination of sine and cos we could write it as a sine uh let's do cos first a cos of kx plus b of sine of kx now about this time function what function uh can we take the derivative of and just get the same function itself it hasn't changed except that a constant has popped out well what function doesn't change when you take the derivative an exponential so we can write down that the solution to this in general must be that the time function is equal to the e to the minus oh i could put a a constant in front say c capital c um e to the minus k squared t all right so there we are we've we've we've done it we've done it for a really a really really simple case but if if we're dealing with a problem where the solution happens to be separable in that it's just time a thing that varies with time and a thing that varies with space if this is a value if this is the answer at least we know what the forms of those things can be um so let's just write out what we're saying in one line we're saying that one kind of solution at least to this diffusion equation one way to go would be well now actually i'm i'm now going to just write out these things multiplied by each other but i can see that i've got too many unknown constants um if i'm going to make the product of these things then uh that would be a cos kt uh excuse me kx plus b sine kx and i'm multiplying by some unknown constant c e to the minus k squared t but i can see that i didn't really need to have that third constant right because any freedom that i get by uh being allowed to choose this constant c i could have just absorbed into different choices of a and b which i'm also free to choose so that's a little bit once you multiply them together you realize you don't need the c so let's just delete that one but there we are that's it so that is one kind of solution any uh anything that fits that form will be a legit uh solution to our diffusion equation in fact if i can think of an initial condition in here's a way to ask it what kind of problems have we solved by doing this little analysis well let's set time t equal to zero or to any fixed number but let's set it equal to zero well then the exponential uh part will just vanish so we have just figured out rather limited thing which is that any problem which um at its initial uh point can be written as a cos term combined with a sine term so what i'm saying i'm saying that with by assuming a separable solution we've very impressively been able to solve any situation for heat or matter flow where the initial condition happens to be sinusoidal so let's paste in what that would look like to imagine that we had a pipe in which the uh the distribution of gas uh was sinusoidal what does that look like uh let's let's even move this down a bit so that's that's what we're saying the uh the density looks like so we're basically saying there's a about there's a high density of gas there and there's a high density of gas there and so on down this pipe in exactly a sinusoidal um oscillating way now that that's not very likely to happen right i can't think of a single initial condition for a diffusion problem where a sinusoidal uh oscillation is a good approximation to how things start out it's very very restrictive it's something but it ain't much how can we generalize well this is where i think we're going to leave it for this lecture but um here's the crucial thing that will allow us to break free from this specific example and do vastly more powerful things the differential equation that we were working with the diffusion equation is what's called a linear differential equation what that means is that if we have any solution to the equation and then we find a different solution we can add them together and it's still a solution why does that help well when we work this through we made up some constant k and for that constant k we had just this very simple solution and a corresponding very simple initial condition that could go with this that's one solution one one initial condition but k can be anything we like and if we were to add together solutions that have different values of the constant k that would still solve our diffusion equation that means that we can deal with an initial condition that's written as any sum of signs and causes with different values for k and suddenly flashback we're in Fourier series territory and so we'll capture this more properly at the beginning of the next lecture but by thinking of just this very limited case which shows us that signs and causes can be tackled and the fact we're allowed to add together different solutions we're in business we can now what we're going to find is that we can tackle any problem for which the initial condition can be described by a Fourier series but what we just spent four lectures learning or three plus Fourier transform is that we can describe pretty much anything with a Fourier series so we're going to be able to tackle very general problems because the diffusion equation allows us to add together different solutions but we'll see the power of that we'll see how it works in the next lecture so thanks for listening