# Recitation 9

Flash and JavaScript are required for this feature.

Instructor: Prof. Gilbert Strang

The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources for free. To make a donation, or to view additional materials from hundreds of MIT courses, visit MIT OpenCourseWare at ocw.mit.edu.

PROFESSOR STRANG: So I'm ready for anything, hope I am. Questions about any topic. Yes.

AUDIENCE: [INAUDIBLE]

PROFESSOR STRANG: I feel this is like a White House press conference. I think there's always somebody in the front row who gets to ask the first question, and then gets to say thank you Mr. President at the end, and then I'm off. Yes. I'm tempted by the way to ask you all, are you going to vote next Tuesday and of course I'd like to know who you vote for, and I'd like to give you my advice. But I don't know that that's proper. If anybody wants advice, they can email. But please vote. Please vote. Yeah. Alright, question here and then we'll have, well, yeah.

AUDIENCE: [INAUDIBLE]

PROFESSOR STRANG: Oh, OK, so those were just posted. Like, I see. 3.3 number two.

AUDIENCE: [INAUDIBLE]

Alright, the second question is does it possibly sit over in the divergence-free world? Is the divergence of, now I'll call it w. equal zero? So the answer was no to that question but now I think the answer to this question will be yes. Because what's the divergence of this thing? It's the x derivative of that, which is certainly zero, plus the y derivative of that, which is certainly zero. So the answer is yes. So there's no potential but there is a stream function, right? Because the stream function comes in with this test. So let's remember what, just from today's lecture, what was the stream function? From dw_1/dx+dw_2/dy=0, that'll be satisfied if w_1 is the y derivative of the stream function, and w_2 is minus the x derivative. Because then this matches the x derivative of this plus the y derivative of this, which is the divergence; on the right-hand side I would get zero. So there's got to be an s, and what is it? Probably not hard to find. Let's see. Here w_1 is zero, so that tells me s doesn't depend on y at all. w_2 is x, so x is supposed to be minus the x derivative of the stream function, so what is the stream function now? Have I got room to put it here? Just about. What will work? So again, here's w_1. The y derivative of s is zero. w_2 tells me that the x derivative of s is minus x. So all I'm looking for is a function that only depends on x, has no dependence on y, and its derivative should be minus x. So what's the function? Minus a half of x squared. Yeah, so this gives me s equal minus a half of x squared. Alright, so you're saying that, so there is a stream function, right. And what does that travel along? That travels along steam, that means that the flow buzzes along streamlines. And what are the streamlines? They're the lines where s is constant. Equipotentials were the lines where u is constant, but here we don't have a u in this problem. Streamlines are lines where the s is constant, so minus 1/2 x squared is constant, what's the picture look like? Picture then, for that, well, and you know what the flow is doing at a typical point here. Say x=3, y=1. Let me draw the little arrow. With a big chalk Which way is the flow going?

Well, the x component is zero, the y component is x. So the flow is going up there, right? Here the y component's x. This whole line is all traveling up with the same velocity. If I drop a leaf there, it buzzes up that straight line. So that's the streamline. And its velocity is, that's x equal -- if, say, the velocity is three then this speed is three. It's going up that line. So that's a streamline. And sure enough, on that line minus 1/2 x squared is a constant. So you see we're not talking parabolas here because our curve is not y equals minus 1/2 x squared, it's minus 1/2 x squared equal constant. Yeah, that's what we want. So, but now having got so far, let me take x=1, say. What's the flow like on that? So there's a streamline with s equal constant. And the velocity on that is zero, so nothing is going in that -- horizontally. And now it's one, so the flow is slower up this line. OK, slower flow. This was faster flow. And then the question that's in that homework problem is, is there any rotation in this flow? We think about rotation, we have an image of rotational flow. And that could be the next example, we could figure out. A flow that goes around in circles, right? Those would be the streamlines. So this would be like pure rotation, shall I call it. But I don't have that there. I just want to draw the other picture, in which the streamlines are circles. To have another nice, clean, beautiful example. OK, but here we don't have. Our streamlines are straight lines, and yet we have rotation. That's the point here. Why do I say we have rotation? Because the test for rotation was that original test of looking at, which I just wrote the answer to be no here. So if it's not a gradient, the reason is there's some rotation. Gradient fields don't have any rotation. The rotation is this thing that comes out, yeah it's this difference. dv_2/dx, it's the difference between those that tells us the rotation. And that was not zero, right? For this example dv_1/dy was zero, because v_1 is zero. dv_2/dx was one, because v_2 is x. So there's some rotation here. And in other words the test for being a gradient is no rotation. This fails that test.

But how is it rotating? How can it be rotating when the all the flow is just traveling vertically? I guess I give you this example because it meant something to me. My image of rotation was this simpleminded type of flow. You know, like a phonograph record or something. This would be called a sheer flow. A very important type of flow. And actually, you'll realize that if x is negative then the flow in the second component, the velocity, is now negative. So it would be the streamline, the flow would be going down this way. And this point wouldn't move at all. This would be, well I don't know if it's a streamline, it's a stagnant streamline, right? x=0. On that line, there's no velocity. [0, 0]. So this is all just staying there. These lines are moving, this line moving faster, this line would be moving even faster. This line's going the other way. Faster and faster the other way. It's a important flow. You know, in earthquakes and things like that. This happens, when one plate shears with respect to another. So that's shearing. The word shearing means that a line that was -- that line after a while is tilted. This is going faster than this. Yes.

AUDIENCE: [INAUDIBLE]

PROFESSOR STRANG: Right, being a constant.

AUDIENCE: [INAUDIBLE] That's true. Ah, well, OK. Let's see. Well, how do I fix that?

AUDIENCE: [INAUDIBLE]

PROFESSOR STRANG: Yes. That's a good question. Should I have allowed in my stream function, I mean that's a stream function. Because it satisfies the equations that stream functions are -- I could have thrown in a constant, yeah. So your pointing out a difficulty makes me think I should have thrown in a constant. So if I throw in constants then I could get other lines, yeah. Thanks, that's a good point. I just want to see, do you see rotation in this flow, in this shear flow? And I think you do. If you think about it. Suppose you put a little leaf, or a little penny or something right there. OK, is it going to turn? It'll flow along, but as it flows, is it going to turn? In other words, is there some difference in the speed on one side compared to the other? I mean, it's what makes a curveball curve, right? When the pitcher throws the ball, he imparts a spin to it, and that gives a different pressure on the two sides of the ball, and the ball moves. I think that's going to happen here. Maybe you see it, and I'm just talking. I mean, this side is going faster than this side. So the net result is that even though the thing is traveling up and down, it's turning. It's turning because the right-hand side is going faster than the left-hand side. So it does have a rotation. This quantity, this difference between dv_1/dy and dv_2/dx, which is the component of the curl, maybe the sign should be the opposite, maybe I think it should be minus this plus this or something. Point is that it's not zero. So there is curl, there is rotation. OK. I was going to ask about this picture, too. And then I'll open to more examples.

I just feel examples are good. Simple velocity fields, like 0x. Just to think through, OK, what does that mean? Is it curl free? Another way of saying is it a gradient field would be to say is it curl free? Irrotational is the right word here. Test one, is it irrotational, answer no. Is it divergence-free, is it source-free, the answer was yes, for this example. If we pick another example I could reverse those, or another example -- I can probably come up with an example here. Let's see, what if I wanted the streamlines to be circles, what would be a good velocity field that goes in circles? Let's see. At a typical point, if I want the velocity to be going that way, here's the vector, the position vector, the radial vector that goes -- so what are the components of this vector? Just [x, y]. So now if I want the velocity field to go other way, what would be a good thing with rotation? [-y, x] would sound good. v=[-y, x]. So are we expecting this to be a gradient of anything? I'm not. We've built in rotation here. I'm expecting the curl of this thing, this quantity, I think I take the x derivative -- I look at the y derivative of this and compare it with the x derivative of that. And they're not the same; in fact one is minus one and the other's plus one. So I've got rotation here. I've got sort of two, is the component of the curl. So let's just write it down. dv_2/dx, this vorticity that measures the turning speed is one from dv_2/dx, minus one is two. So it's not a gradient of anything. If the x derivative of u is minus y, then the y derivative can't be plus x, no good. OK, what about, is it divergence-free?

Do I need a source to keep this flow going? Well, what's the test? In other words, is there a stream function for this guy? I think probably there is. What's the test to know if there is a stream function? I take the divergence, I'm over on the right-hand side of my picture now. I take the divergence. Divergence of this v is the x derivative of that plus the y derivative of that, good, zero. So there is a stream function. And what is it? Well, I'm pretty sure that these streamlines are circles, I think the stream function is going to be x squared plus y squared. Yep. Then, am I right that the y derivative of that will be 2y. That's not looking too good. What do I want here? Here's my v, which is the same as w. And what I'm looking for is to get these guys correct. So -- and I should be able to do it. And what would s be? I haven't got s quite right. I think if I multiply by negative 1/2, that might have done it. Yeah, because now the y derivative is now minus y. Great. And the x derivative of s is minus x, and then I should take a minus that, so I should want a plus x, which is what I've got. So those are the streamlines. Circles. So I have circle, the flow is going around in a circle. I don't have to -- I don't need any source to keep it going. But it's not a gradient. So this is like a sample test, to take a simple flow field, apply the two tests, and I guess we should complete with an example that passes both tests. Right? Let me open to any other question, and then we could cook up an example that passes both tests before we stop. I'll stop talking first, though. Just listen for a question on any topic. Or is it useful just to take fields like this and go through those steps? It probably is. It's certainly good for me.

OK, what's a field that will satisfy everybody, that will be a gradient field and also divergence-free, so that we'll have solutions to Laplace's equation. Let's see. Well we had some solutions to Laplace's equation there. You know if I make it linear it's real easy. If I make it quadratic -- huh. Can I anticipate a little what's coming Friday? I so recommend to come to Friday's lecture, but -- so what's coming? What did we do today? We discovered that we got solutions to Laplace's equation from all, by real and imaginary parts of all these guys. Those were terrific. And then we could take combinations of those. So here's what's coming Friday. When I take combinations of these guys I get some function of this magic complex -- of this magic combination x+iy. Some function, any function. Any reasonable function, and we'll say what reasonable means, of x+iy, its real part and its imaginary part are going to be great. This is like the center of a big, big part of mathematics. Functions of x+iy. And by nice I mean that these series converge. So that we have really a nice function. Let me take the first function that comes to mind. e^(x+iy). So let me take this to be e^(x+iy). OK. Right. So you remember, I'm aiming to get solutions to Laplace's equation, because that will give me automatically the two pieces both working. So I claim that the real part of that, and the imaginary part, those are my twins, u and s, both solve -- so u is going to be the real part of this function. And s is going to be the imaginary part of it. And I claim that those will both solve Laplace's equation. We can plug it in and see that it does. And that they will have, they're twinned by the Cauchy-Riemann equations. So how am I going to simplify that, so that I can identify what's the real part of that thing and what's the imaginary part? This is actually, that's a good question.

I don't know how much you've run into i, in the past. Are you happy with something like that? How could you find the real part of it, how could you simplify it? How else could I write e to the something? Exactly. Think of it as the product of two, so the key fact about exponentials is that that's the same as e^x times e^(iy). The exponents add, so that's the first thing always to think about as a possibility. Now, what am I going to do? I still want to get a real part. This is clearly all real, right? e^x is real. So it's this part that's going to give me the two pieces. So this is going to be e^x times -- now, what do I put for e^(iy)? cos(y), good. Plus i*sin(y), good. And now I can read off, no problem. What is this real part that I was looking for? e^x*cos(y). And the imaginary part is just what's multiplying the i, it's the e^x*sin(y). OK, so what's my claim? I claim that that function solves Laplace's equation. And this one too. And that they're twinned. And that they give streamlines and equipotentials that meet at right angles, it's another pair. Plug that into Laplace's equation. So let me do u_xx+u_yy, just to satisfy that it is going to come out zero. So what's the xx derivative, the second x derivative of that function? Take its derivative with respect to x, and then do it again, and what do you have? Same. Didn't change. e^x is just -- and now what about the second y derivative? So now e^x is just a constant. What's the second derivative of cos(y)? Negative cos(y). Right. Because the first derivative is negative sine, the second derivative is negative cosine. So the second derivative is e^x, it didn't change, times cos(y) with a minus sine. And you see what -- did I write sine? I meant to write cosine. Cancel that from the tape. OK, right. Yeah. So the second x derivative was just e^x, e^x, cos(y) didn't move. Sorry. That was frightening. OK, and then now here's the second y derivative. In other words, it gives zero. Gives zero, and this one would too.

Now, I don't really have an idea of what the picture is like. But it's important. We've got a flow field here, and it's from e^z, e^(x+iy). Exponential has gotta be an important function. So it's got to be somehow interesting. What do you think -- so what would the -- what would the equipotential lines looks like? Oh, boy. e^x*cos(y) equal a constant. My gosh. e^x*cos(y). So let's see. I don't know how to draw this picture, but one thing I know is that if I changed y by 2pi, I would get another copy of this curve, right? If I changed y by -- every time you see cosine or sine, you think hey, that's periodic. If I change it by 2pi. So I'm thinking that y between zero and 2 pi, so here's y=0. And y=2pi, I'm thinking that my flow probably somehow stays in a strip. Like that. And then the whole thing just repeats, and repeats, and repeats. So I'm thinking, really this is flow in an infinite strip. Infinite pipe or something like that. You can imagine that there could be applications. But I still haven't drawn the curve. I just think, let's see, what would it look like when y is a little -- suppose I'm trying to draw the picture of e^x*cos(y)=1, whatever. OK, I'll just attempt to draw that curve. Just, so if y was a little bit off of zero, the cosine would be, yeah, how's it going to go? If y is just a little off zero, tell me any points on this curve? I can see that e^x is going to be a big number. Is (0,0) on the curve? Good. Got one point. Alright. Now, suppose y is a little bit more than zero. So suppose y goes up a little bit. Then what? (1,0) or something? Yeah. I suppose (1,0)? No, no. So if y goes up a little, then x would go out a little bit.

So what's happening? So cos(y), so the cos(y) is going to drop from one to zero, right? To start with. Then, if this cos(y) is dropping from one to zero then this e^x has got to climb up, to to keep the product one. So I'll move out. So somehow it'll move out. I think maybe when y reaches pi/2, then the cosine has got down to zero. We could work on this for a while. Or we could let MATLAB draw it. But I think that we would see these -- and I could do better. I'm feeling pretty humiliated to not have a better picture here. Suppose y is a little less than zero, do we get anything interesting there? Oh well, the cosine is an even function. So I think the thing might, is it just going to turn around like that? So that y and minus y -- for a certain x, the y value and the minus y will both be on the curve because the cosine doesn't know whether it's the cosine of of a plus or a minus. Yeah, I think we would get curves of that sort. And then the other curves, s equal constant, the streamlines will somehow go vertically. Maybe I'll just not use the whole time to work on that particular curve. We'd have to prepare it. The point is, you see how incredibly easily we produce solutions to Laplace's equation that you wouldn't have thought of, and I wouldn't have thought of. So that would be one way to produce solutions. I might even repeat this one in class Friday, or I might not. Let me suggest another couple of possibilities that I will do in class. Can I just give you a couple of other functions f. In fact, I'll just erase that one and put in some other ones. Suppose I took the function 1/(x+iy).

So that's a function of this magic combination, x+iy. What's its real part and what's its imaginary part? Do you know how to split that guy into real and imaginary? There's a little trick, if you remember from learning complex numbers. Do you remember the trick? The problem is that this thing is down in the denominator, right? We don't want it there. Because we can't split the real and imaginary parts down there. So I would like to rewrite it in a way that gets something real down in the denominator, moves all the i stuff up in the numerator where I can separate it. How do I do it? Multiply both sides by, both top and bottom, by x-iy. Good. So what does that put down here now? That's a number times its conjugate and that's going to produce x squared. Minus or plus? Plus y squared, right. The number times its conjugate is the length squared. And now we just have x-iy, and now it's obvious what the u is. This is real now, so the u is just x over x squared plus y squared, and the s is the minus y over x squared plus y squared. That's a very interesting flow. That's an interesting flow, and we could do its picture and so on. And in fact it would be a nicer picture than the one we stopped on.

What should I notice about this flow? Of course, the flow is automatically irrotational; the curl is zero because there is a potential. A gradient of a potential, the gradient of a potential is going to be free of rotation. And there will be streamlines, all those good things. There's one bad point about the flow, though. Which is where? At (0,0). The whole thing falls apart, at the origin this falls apart. So this is a great flow except at the origin, it's very problematic. It's singular at the origin. So if we drew the pictures we would see something strange. This is going to zero at the origin. So, yeah, we have trouble at the origin but an important flow otherwise, yep. And I'll just mention the third but I won't do anything with it. Because it's such a neat one that I have to save it for Friday. The other natural function to think of is the logarithm. The logarithm of x+iy. Split that into u and s. What kind of a thing do we have here? What kind of singularity? Yeah, let me just do two moments on this example, and then leave it for Friday because the whole class has to see it. Is there a singularity for this guy? Is there a point (x,y) where the logarithm is not great? At the origin, again. We'll again have a singularity at the origin. Something strange is happening at the origin. And what we'll find is there's a delta function there. We're feeding in, we have a source right at the origin and then it's flowing out on, I think on radial lines. I think the streamlines go out from the origin and the equipotentials go around the origin. Yeah, it's a great example. So that's another one to come. OK, so examples like these are -- I mean generations of thinking went into solutions of Laplace's equation. And 2-D particularly where we have this special combination. I wish we had such a combination in 3-D but we simply don't. We can discuss Laplace's equation in 3-D of course, very important. But I mean, wave equation, this fact that we're talking to each other, is got the Laplacian in 3-D, but there's no x+iy magic.

OK, that's some u's and s's and v's and w's. What else is on your mind? Questions? I could ask this question, oh, here's something I did not do in class. I think I wrote down the divergence theorem. So can we start by doing that? Let me write down the divergence theorem, with your help. And then use it. So what does the divergence theorem -- we're in 2-D. So this is 2-D, just the similar theorem. So what does the theorem say, that if I take the divergence of some w, some vector field, then if I integrate that over some region -- so I have some region here and at every point there's a flow w. And I look at the divergence of w and I integrate that, dx dy, so that's a double integral over a region, I will get, what's the right-hand side? What does the divergence measure? So I'm really asking like just memory, what is the divergence, it's an identity. It's integration by parts in some way, as we'll see. But what do you remember for the divergence theorem? You get what? It measures how much flux out, right? So when we measure the flux out by integrating around the boundary, how much is getting through the boundary? And what's the flow through the boundary? I take w, but that's a vector. And I'm looking for what component of w? The normal component, the component of w, w dot n, the component of w that's headed out. n is defined to be, whatever the boundary is -- here I've made it look like a circle but I shouldn't have. Let me make it a little wobblier or something. So the normal component at any, there, look at that point. The normal direction through the boundary, down in that crazy point, is this way. So the normal is going this way here. Here, it's going over this way. It's perpendicular to the boundary, OK? And then we integrate around the boundary. Alright. So that's the identity of that, that's the divergence theorem.

Now, let's see. Could you, yeah. So we have a minute. You want to take a particular w and see if this would be correct? How about w=[0, x], our first example? Suppose I tried w=[0, x]. I just want to see if the divergence -- what the flux is through the boundary. What what region shall I take for the -- so the divergence theorem has two inputs. It has a flow field. And let me take w to be [0, x], just so it's a shear. And a region. And of course the integral might not be that much fun to do, unless we make the region nice. What do you take as a nice region for -- actually, it doesn't matter what the region is. Take any old region. For the moment. What's the answer? For this particular flow, w=[0, x]? Zero. That's the cool part. If the answer's zero then work is suspended. And why is it zero? Because the divergence of this particular w, the x derivative of that plus the y derivative of that, is zero. This has divergence everywhere zero. So integrating is no problem at all, so that would be zero, for this flow field. For this divergence-free field. Zero for that because div w is zero. But is that correct? What does that tell me, these flows are -- we saw what the flow is like. Say there's the origin. It doesn't have to be a circle, it looks like a circle. Do you see why the flux is zero? There is flow through the boundary, right? Flow is going buzz, buzz, buzz up this line and out. And it's coming in here. So there that's what we discovered. This [0, x] is vertical flow. It hasn't gotten any horizontal component. It's got a vertical component, it's going out. And would we want to do this right-hand side? I don't think so, right. This right-hand side is asking me what, I have to find the normal direction on this, whatever curve that is. I have to take its dot product with the flow [0, x], so this is some quantity. And then I have to do this ds which I haven't even mentioned, ds is arc length around. I'm integrating around these pieces. But yet somehow we have some idea from that picture that the total flux is zero. How would you say it in words, if I say here's the flow field. There's a region, funny shape. The flux is zero through that boundary. And if I asked you why, what would you say? I mean, a math answer would be use the divergence theorem. But why from this picture does it look like we have zero flux?

What comes in goes out, yeah. What's coming in the bottom here is going out the top. That's basically it. So we would get zero for that one. So I think the homework, the suggested homework maybe includes an example where the divergence isn't zero. And then you actually have to do these integrals. Just as practice for what do those integrals mean. Maybe I won't go through one now, but that's good practice. Take some simple w, but one with a non-zero divergence and then see if you can do either or both of the integrals that are supposed to come out equal. That's a good one Now, there's one thing I could -- any questions, or discussion? You guys are seeing these examples come up; it's the only way I would know to learn this subject is take simple v's and w's. And see what you can do with them. We've got the general principles, but then apply them to specific flows.

AUDIENCE: [INAUDIBLE] PROFESSOR STRANG: Yes, thanks

AUDIENCE: [INAUDIBLE]

PROFESSOR STRANG: This theorem?

AUDIENCE: [INAUDIBLE]

PROFESSOR STRANG: Yeah if it was, well let's draw a funny shape. See what we think. I mean, with this flow, right? Let me just say, if the flow has some difficult divergence and the region is some mess, nobody's going to be able to do it. I mean, yeah. So don't think that these can all be done. The equality, it's like integrals in calculus. No problem to think of integrations that are just beyond human capacity. But the formulas still hold. Suppose my region was even like this? Would that still be, do we still see flow in equals flow out for this particular flow? I think, yeah, the flow's going this way. So it's coming in here, it's going out again. That contributes. Back in again here, and out again here. Yeah, I think our instinct would be correct there, yeah. All sorts of examples. I was going to, well, I'll maybe do it in class. This divergence theorem is the fundamental theorem of 2-D calculus, you could say. Or one of them. And to write these things and see what they lead to, yeah. I'll tell you what I was going to do. I was going to apply this to the vector field u times w. So u is a scalar, w is a vector, and therefore uw is a vector. It's got two components, uw_1, are you willing to do that one? So I apply this not to w itself, but to u times w. Which has two components, uw_1 and uw_2. OK, so I should take the divergence of uw. I mean, that's a vector field, uw, this guy. And I'll get the uw dot n. And it just turns out that this is the right way to do it. To see the fact that gradient and divergence are transposes of each other. Yeah, yeah. I maybe I won't do that calculation now, I'll just say that if you take the divergence theorem and you apply it to this guy, [uw_1, uw_2], and write out what it means, you get a very interesting formula. I'll just leave that there. So I'm ready for a final question if there is one, or otherwise keep going Friday with these Laplace equation solutions. Play with some vector fields. That's my best advice. And I'll see you Friday.