# Multivariable Calculus: Final Review (cont.)

## Final Review (cont.)

Transcript: I guess last time on Friday we went over the first half of the class very quickly. And so today we are going to go over the second half of the class very quickly.

And so that was stuff about double and triple integrals and vector calculus in the plane and in space. As usual, what is on the final is basically what was on the other tests, exactly the same stuff. Well, not the same problem, unfortunately. The first thing we learned about was double integrals in the plane and how to set up the bounds and how to evaluate them. Just to remind you quickly, the important thing with iterated integrals is when you integrate a function f of x, y, say dy dx for example, is that you have to draw a picture of a region. Unless it is completely obvious you should really draw some picture of the domain of integration.

And once you have that picture you can use it to find the bounds. Remember the general method is that we first look at the inner integral, here integral of f dy. And in this inner integral the outer variable here, x, is fixed. That means we are slicing our region by a vertical line corresponding to a fixed value of x. We fix a value of x. And what we have to find out is the bounds for y, so the value of y at this point, the value of y at that point. Let me call that y some bottom of x, in general depends on x. And this one will be y at that top, and it also depends on x. And then the bounds for y would be this. And then, when you look at the outer bound, things are different.

Because there you expect to have just numbers, no longer functions of anything. And what you do is look at the shadow of your region. We are doing it by shadow so you just project to the x-axis. If you project to the x-axis your region will look like this. Its shadow is going to be this integral form, some minimum value of x to some maximum value of x. And that will give us the bounds for the outer integral.

And then, to evaluate, we evaluate the usual way. Speaking of evaluation, what you need to know for the final, well, essentially the same kind of evaluation techniques that we were supposed to know for the other tests. That means the usual functions, substitutions, basic trig, stuff like that. Well, I don't expect that you would need integration by parts, although I still hope that some of you remember it from single variable calculus. If there is a need to integrate some big power of cosine or sine then the formula will be given to you the way it is in the notes. And, of course, we know also how to set up these integrals in polar coordinates.

And then the area element becomes r dr d theta. And because you integrate first over r, well, first of all you should remember the polar coordinate formulas, namely x equals r cosine theta and y equals r sine theta. And second you should remember that what we do, when we have our region, is for a fixed value of theta we look for the bounds for r, just like before, so the way we are slicing the region is now we are actually shooting rays straight from the origin. And, in a given direction, we are asking ourselves how far does my region go? You have to find a bound and you have to find whatever the value of r will be out here as a function of theta.

And ways to do that can be geometric or they can be by starting from the x, y equation of whatever curve you have and then expressing it in terms of r and theta and solving for r. For example, just to illustrate it, we have seen that one of our classics has been the circle of radius one centered at one, zero. This guy, you have two different ways of getting its polar coordinate equation. One is to argue geometrically that you have a right angle in here.

And this length is two, this angle is theta, this length is r, so the polar equation is r equals two cosine theta. The other way to do it, if somehow you are missing the geometric trick, is to start from the x, y equation. What is the x, y equation of this guy? Well, it is x minus one squared plus y squared equals one. If you expand that you will get x squared minus two x plus one plus y squared equals one.

The ones simplify. X squared plus y squared becomes r squared minus two x becomes r cosine theta equals zero. That gives you, when you simplify by r, r equals two cosine theta. Two ways to get the same polar equation. I should say this is an example, in case you were wondering what I was doing. We have also actually seen how to change variables to more complicated coordinate systems. Let's say u, v coordinates. But, of course, you can call them whatever you want. The main thing to remember is that you have to look for the Jacobian which will give you the conversion ratio between dx dy and du dv. For example, if you know u and v as functions of x and y then you will write du dv equals absolute value of the Jacobian partial u, v over partial x, y times dx dy.

Or, if it is easier for you, you can do the Jacobian the other way around. And this Jacobian, remember, is the determinant by a two by two matrix that you obtain by putting the partial derivatives of u and v with respect to x and y. Then, when we have that, we can change the integrant, f of x, y, into something involving u and v possibly. And then we have to find the bounds. And to find the bounds perhaps the easiest is to draw a picture of a region in u, v coordinates.

Maybe you have some picture in the x, y plane that might actually be really hard to draw and maybe in terms of u and v the picture will become much simpler. It might just become a rectangle. Of course, if you see immediately what the bounds are in terms of u and v, and they turn out to be very easy, then maybe you don't even have to draw this picture. But if it is not completely obvious then that might be a helpful way of figuring out what the bounds will be when you switch from x, y to u, v.

We have seen some problems like that and there are more in the notes in case you need more. Questions? Yes? That is the second time you've asked for something real quick in these review sessions. You are in a hurry. Take your time. Partial u, v over partial x, y is just going to be the determinant of u sub x, u sub y, v sub x, v sub y. That is the definition. That is pretty direct. And, of course, a general common sense thing that applies to actually all the integrals that we are going to see, there are two things in an integral. One is whatever you integral is called the integrant.

It could be a function here. It is a vector field in some of the flux things and so on. There is another thing which is the region over which you integrate. And the two have strictly nothing to do with each other. When you are given a piece of data in the statement of a problem, you have to figure out whether that is part of a function to be integrated or whether that is part of the region of integration. If it is the region of integration then it will go into the bounds of the integral and maybe in the choice of the coordinate system that you use for integrating.

While the function that you are integrating goes before the dx dy and not into the bounds or anything like that. I know it sounds kind of silly but it is a good safety check. Ask yourselves, when you have a piece of data, where in my formula should this go. Yes? I case you want the bounds for this region in polar coordinates, indeed it would be double integral. For a fixed theta, r goes from zero to whatever it is on that curve. So it would be zero to two cosine theta of whatever the function is r dr d theta. And the bounds on theta would be from negative pi over two to pi over two. We have seen that one several times, so hopefully by now it is clearer.

OK. Let me move on a bit because we have a lot of other kinds of integrals to see. Other kinds of integrals we have seen are triple integrals. And I am not doing things in the order that we did them in the class just so you can see parallels between stuff in the plane and in space. When we do triple integrals in space, well, it is the same kind of story, except now we have, of course, more coordinate systems.

We have rectangular coordinates, we have cylindrical coordinates and we have spherical coordinates. And cylindrical coordinates only mean that we are, instead of x, y and z, we are replacing x and y by the polar coordinate in the x, y plane, so the angle theta and the distance r. So R is somehow the distance from the z-axis and z is the height. Usually you don't have to choose between rectangular and cylindrical until somewhat late in the process, especially if you integrate first of all z, because then the choice will come up mostly when you try to figure out what are the bounds for the shadow of your region. I mean the z part looks exactly the same in rectangular and in cylindrical. Spherical is, on the other hand, a little bit more annoying because it looks quite different.

You should think of it as doing polar coordinates not only in the horizontal direction but also in the vertical direction at the same time. You have this angle phi. That measures the angle down from the positive z-axis. And you have rho which is the distance from the origin. And if I project to the z-axis, r becomes rho sine phi and z becomes rho cosine phi. I hope that you all know these two formulas, but if you ever have a small somehow memory lapse during the final then you should consider drawing this kind of picture because it will let you check very quickly which one is sine, which one is cosine. Now, of course, we have to have formulas for dv in all these coordinate systems. Here, for example, that might be dz r dr d theta or r dr d theta dz or anything like that.

Here it might be rho squared times phi times d rho d phi d theta. And the general method for setting up bounds is pretty much the same as in the plane, just there is one more step. If you are doing rectangular or cylindrical coordinates with z first, for example, that is the most common. Well, if you do z first then you have to actually start by figuring out for a given value of x and y or r and theta what is the portion of a vertical line above x, y that lies within my region? That will go from z on the bottom of my solid which depends on x and y to z at the top of my solid which also usually will depend on x and y.

And so that will give me the bounds for dz. And then I will be left with the shadow of my region in the x, y plane. And that one I will set up like a double integral over there. Strictly-speaking, if you are curious, we could also change to weird coordinate systems using Jacobian with three variables at the same time. But we haven't seen that so it won't be on the final. But it would work just the same way, just with more pictures to do.

And, in fact, I just wanted to say this rho squared sine phi is actually the Jacobian for the change of variables for rectangular to spherical coordinates. OK. Let's not think too much about that. Applications. Well, we have seen how to use double integrals to find the area of a volume of a piece of a plane or a piece of space, and find also the mass. Remember, area is just double integral of one dA, volume is triple integral of one dV. Sometimes if it's the volume between the x, y plane and the graph of some function, you can just set it up directly as a double integral.

But there is no harm in doing it as a triple integral if you feel better about that. And mass will be double or triple integral, depending on how many dimensions you have, of whatever density function you have, dA or dV. Then there is how to find the average value of some function. Well, let me do the three-dimensional case. You will just replace volume by area and dV by dA and so on, if need be. That would be one over volume of the solid times the triple integral of f dV, or if it's a weighted average, one over mass times the triple integral of a function times density times dV. If you don't have a density or if the density is constant then that reduces to that one.

In particular, we have seen the notion of center of mass. The center of mass is just given by taking the average values of the coordinates, x bar, y bar, z bar. It is just this formula but taking x, y or z as the function. There are moments of inertia. For example, the moment of inertia about the z-axis is the triple integral of x squared plus y squared density dV. Or, if you have just a two-dimensional object, it is the same formula, but, of course, with dA. And then we call that the polar moment of inertia because we thought of it as rotating the plane about the origin, but the origin is just where the z-axis hits the x, y plane so it is really the same thing. And we have also seen gravitational attraction in space, and I will let you look at your notes for that. It is just one formula to remember.

Questions about iterated integrals, things like that? Yes? The formula that you should know for gravitational attraction is that if yu have a point mass at the origin and you have some solid centered on the z-axis that is attracting it then the force will be given by G times the mass times the triple integral of density times cosine phi over rho squared times dV. And, of course, you will actually do that in spherical coordinates because it is easier that way.

That is the formula I have in mind. But, see, all these formulas just give you examples of things to integrate. And how to set up the bounds and so on does not depend on what you are actually integrating. It is done always using the same methods. Let's move on to work and line integrals. We have seen how to do that in the plane and in space. And it looks very similar somehow. Remember, you have to know how to set up and evaluate a line integral of this form. Let me do it in the plane this time.

If you are in the plane you have two components, and then this becomes the line integral of M dx plus N dy. If you have a space curve then you will have a third component here. You will add that guy times dz. Now, how do we evaluate that? Well, it is very different from there because here we are just on a curve so there should be only one degree of freedom. One variable should be enough to know where we are. We will have to express x and y in terms of --

Well, I should and z optionally if there is one, in terms of a single parameters. And that might be just one of the coordinates. If you are told y equals z squared, that is easy. You just substitute y equals x squared and dy equals two x dx into everything, and you are left with an integral over x. Maybe it will be something in terms of time or in terms of an angle. We express everything in terms of a single parameter, and that will give us a usual single integral. Any questions about that? Yes?

If you cannot parameterize the curve then it is really, really hard to evaluate the line integral. Well, you might be able to evaluate it numerically into a computer, but that is the easiest way to describe a curve. Indeed it could be that in the plane you have an equation in terms of x and y given by some completed formulas defining some curve. Then actually there are ways you can use basically differentials and constrained partials to figure out what the tangent vector to the curve is and so on.

But we haven't really seen how to do that. That would be a really nice topic for tying together the end of the second unit that we discussed last time, constrained partials, with this stuff. But that is not going to be part of our topics. Basically, all the curves we have seen in this class, there is a way to express the position of a point in terms of a parameter. We haven't seen any curves that are so complicated that you cannot do that.

The other thing we have seen is that there are some special cases of vector fields where we don't actually have to compute this thing because maybe we know that it is the gradient of some potential function. And then we have a fundamental theorem that gives us a way to compute this without computing it. We've seen about gradient fields and path independence. The thing to check is whether the curl of our vector field is zero. And remember in the plane that is one condition, Nx equals My.

In 3D in space that is actually three conditions because you have to check all the mixed partials of the various components. If the curl of f is zero that tells us we are likely to have a gradient field. Strictly-speaking, I should mention and F is defined in a simply-connected region. Then F is a gradient field. That means that we can find a potential function. You can write F as the gradient of little f for some potential function little f. And we have seen how to find the potential. In fact, we have seen two methods for that. And we have seen them twice.

We have seen them once for functions of two variables, once for functions of three variables. They look very much the same. I encourage you to compare your notes for the two side by side to see where they differ. Where they differ, roughly-speaking, well, I never know if it is the first or the second, but one of the two methods was to compute a line integral. In the plane, what we did is we set up and evaluated a line integral along our favorite path from the origin to a point with coordinates say x1, y1. And then we had to evaluate the line integral for the work done along this path. And that will give us the value of potential at that point. If we are doing it with three variables, that method remains very similar. The only difference is now we have to go also up in space to some point x1, y1, z1.

And so we actually sum three pieces together. But on each piece it is the same story, only one variable changes. Here it is only x that changes, it is only y that changes, and on the third one only z would be changing. That is one possibility. And the other possibility for finding the potential is that we start with the condition that the first component of our vector field should be equal to f sub x for the unknown potential function.

What we do is integrate with respect to x, and we will get our potential function up to an integration constant. And that integration constant typically depends on the remaining variables that might be y or equal in space y and z. And then what we have to do is take the partial of this with respect to y and compare it to what we want it to be, namely the y component of a vector field, and match them to get some information about this guy. And if we have three variables then there is a third step because there you will still have an unknown function of z that you need to get by comparing the partials with respect to z.

I see a lot of very quiet faces somehow. Well, hopefully that is because you know that stuff. If it is because you are hopelessly confused then please review a lot before the final, but I really hope that is not the case. And so, in particular, what we have seen is once we have the potential then we can use the fundamental theorem of calculus to tell us that if we have a line integral to compute for work along a curve that goes from some point P zero to some point P one then the line integral for the work done by gradient F is actually going just to be the change in value of a potential.

And, in particular, that does not depend on how we got from P zero to P one. That is why we say that we have path independence. Next topic is flux in plane and space. Flux looks quite different in the plane and in space because, in the plane, it is just another kind of line integral, while in space it is a surface integral. If you were in four-dimensional space it would be a triple integral. Generally, you do flux for something that is somehow a wall that separates regions of space from each other.

In the plane, the way we do it is we have a curve C and we look at its tangent vector, let's call that T, and we rotate it by 90 degrees clockwise. That is our convention to get a unit normal vector that points to the right of the curve as we move along the curve. That is our convention for orienting curves. And we are always going to be using that one. N equals T rotated 90 degrees clockwise. In particular, that means that n ds, which will be what we integrate against when we try to compute flux, will just end up being dy, negative dx.

Concretely, when we have to evaluate a line integral of F dot n ds, geometrically we could try to take the dot product of our field with the normal vector and then sum the length element along the curve. And, in some cases, for example, if you know that the vector field is tangent to the curve or if a dot product is constant or things like that then that might actually give you a very easy answer.

But, in general, the most efficient way to do it will be to say that if your vector field has components, I don't know, let's call them P and Q, then that will be just the line integral of PQ dot dy, negative dx, which means negative Q dx plus P dy. And, from that point onward, you evaluate it exactly the same way as you would for a work integral. But, of course, the geometric meaning is very different. It is the same meaning that we have always seen for flux. It measures how much a vector field goes across the curve.

Now, if we are in space then you take flux for a surface, not for a curve. And the way it will work is that you have to choose an orientation of a surface, which just means choosing one of the two possible unit normal vectors. And then you will do a surface integral for F dot n dS. That is the surface i element. The setup for this surface integral is that first we have to express n and dS in some way. One possibility is that we can express the normal vector n dS geometrically. That is, for example, what we do when we look at, say, a horizontal plane or a vertical plane or a sphere or a cylinder.

Then we have some geometric idea of why the normal vector is what it is and we have some formula for dS. Or, we can use one of the standard formulas. Basically, we have seen two formulas that work in fairly generate situations. One of them says -- If S is given by an equation z equals some function of x, y then you can just say n dS equals minus f sub x, minus f sub y, one, dx dy. And I need to rewrite that because I am running out of space. But, while I erase, I would like to point out the most important there in here.

When I say n dS equals blah, blah, blah times dx dy, dx dy is not the same thing as dS at all. If you make that mistake you are going to get into trouble the next time that you try to buy real estate in a region which hills or cliffs or things like that. dS is the area on the slanted surface. dx dy is the area on the map that shows the x, y plane. And these are not the same thing. In particular, you cannot just take one piece of it and not the other piece. Let me give you formulas for n and for dS separately just to convince you. That way, if you feel that you need them, then you will have them.

N is minus f sub x, minus f sub y, one, but scaled down to unit length. This is not a unit vector. It is actually divided by the length of this guy which is fx squared plus fy squared plus one. And dS is that same vector times dx dy. And so the square roots cancel out when you multiply them together. But it would be completely wrong to just say I will replace n dS by minus f sub x, minus f sub y and one. Then I end up again with the dS and I do something else with dS. That is a pretty bad conceptual mistake because it gives you the wrong answer. Another option more general than that.

If we have not seen how to solve for z, how to express z as a function of x and y, well, maybe we still know some normal vector to the surface. Then there is another formula for n dS which is up to sine, N divided by N dot k dx dy. And, see, that projection formula works also if you have to project to another coordinate plane. For example, if you want to project to the x, z coordinate plane, the relation between n dS and dx dz is given by N over N dot j, because j is the direction perpendicular to the xz plane. But this one is more useful. What is a good example of that?

If you have a slanted plane given to you, you can easily find its normal vector. That is just given by the coefficients of x, y, z in the equation. Another situation where that might happen is if your surface is given by an equation of a form of g of x, y, z equals zero. If that is the case then you know this is a level set of g. And we know how to find a normal vector to the level set, namely the gradient vector is always perpendicular to the level set.

You would take the gradient of g to be your big N. OK. Now, these are basically all the integrals we have seen how to set up. Now we have a bunch of theorems relating them. Let me think about how I am going to organize that. Let me try like this. This part of the board will be work, this part of the board will be about flux and the left part of the board will be about things in the plane and the right one will be about things in space. What have we seen? Well, we have seen Green's theorem for work.

That doesn't work so well because that is too small, so I am going to actually use more blackboards to do that. This side will be space, this side will be the plane and we are going to start with theorems about work. And we will see theorems about flux pretty soon. We have two theorems about work. In the plane that is called Green's theorem. In space that is called Stokes' theorem. Green's theorem says if I have a closed curve in the plane going counterclockwise enclosing entirely some region R then the line integral along C for the work of F is equal to the double integral of a region inside of the curl of F dA.

Concretely, if my components of F are called M and N that is the line integral of M dx plus N dy is equal to the double integral of R of N sub x minus M sub y dA. This side here is a usual line integral. This side here is a usual double integral in the plane. And somehow their values end up being magically related. Well, not quite magically. We actually have seen how to prove it. And now the analog of that in space is Stokes' theorem. Stokes says if I have a closed curve in space, now I have to decide what kind of thing it bounds. And the answer is it will have to bound some surface, but I have a choice of surface.

I choose my favorite surface bounded by C. I guess I will just draw it like that. And I have to choose a compatible orientation. Remember, we have seen this right hand rule for choosing how to orient the surface. I believe, in this case, if I take C like that then the normal vector has to go up. And then it tells me how to compute the work done by F along C. Namely, that becomes the double integral over that surface S of curl F, which I will write as dell cross F dot n dS. This line integral is a usual line integral, but if for some reason we don't want to compute it directly we can actually replace it by a surface integral over any surface bounded by the curve.

It might be that a problem will tell you which surface you have to consider. It might be that you will be left to choose the simplest possible surface you can think of that is somehow having this curve as its boundary. And so now, remember, curl of a vector field in space is going to be another vector expression. It has three components. And the way you compute it is not by remembering the actual formula, which is really complicated by, but by instead computing the cross-product between dell and F.

You set up the cross-product. And, of course, it is a highly symbolic cross-product. I mean it is not an cross-product of actual vectors but it works the same way. Both of these formulas basically relate work on a curve with what happens to the curl on the surface that is enclosed by this curve, that is bounded by this curve. And in this one you have less freedom of choice because you don't have somehow a z direction in which you could move your surface. There is only possible choice of surface. There is only one thing that is enclosed by this curve in the plane. In both cases, these things tell you that you can think of curl as measuring how much the field fails to be conservative. See, if your field was conservative --

If a curl was zero then the right-hand side would just be zero. And that would be fortunate because if a curl is zero then your field is less conservative. That means it comes from a potential. That means when you go along a closed curve, well, the change of value of a potential should be zero. Another way to say it is path independence tells you no work. And, of course, if you have a vector field that is not a gradient field then the curl is not necessarily zero and then you get a more interesting answer.

Finally, let's move onto the theorems about flux. That is Green for flux and that is the divergence theorem. Flux theorems. Here I say that will be divergence. And here it will be Green again. Green's theorem for flux says I have a closed curve that goes counterclockwise around some region. In particular, counterclockwise means that the normal vector will be going out of the region. And then it tells us that the flux out of the region, through the curve C, so that will be the line integral of F dot n ds is equal to the integral of a region inside of div F dA. And remember the divergence of M, N is just Mx plus Ny. This one here, the divergence theorem, tells you something similar but now for a region of space bounded by a closed surface.

So if you have some region of space and you call its boundary surface S and you let n be the normal vector that goes out of the region R. You orient S outwards. Then the flux out of the region through S is going to be the same as the triple integral over the region of divergence F dV. Remember, the divergence of a vector field with components P, Q, R is Px plus Qy plus Rz. What do these two theorems say? Well, they say essentially the same thing. They say the total flux out of a region is equal to the integral of divergence over whatever is inside. And the reason for that is, again, we have seen for a velocity field that divergence measures how much things are expanding or how much stuff is being created.

It tells you the amount of sources per unit portion of the region. When you sum that over everything, you get the amount of fluid that is being, you know, the total amount of sources inside here, and that tells us how much stuff has to go out per unit time. That is basically the interpretation. In a way, I would be tempted to say that this table of four theorems is somehow the crucial point of 18.02.

And you would do well to remember them. However, I would like also to point out that these theorems are completely useless if you don't know how to compute any of the integrals that are in there. So all the stuff that was around there before is actually somehow more fundamental. And if you don't know how to compute the double or triple integrals then this is of little use to you. That is the end. I guess I have to wish you happy holidays. (APPLAUSE)

Thanks. Well, if you keep clapping there will be an encore. Do you want more theorems? No. OK. (LAUGHTER) I will be available if you have questions now and at my office at various times between now and the final. Enjoy your holiday break.