Hi, everyone, and welcome to our lecture on double integrals. So up to this point, our discussion of calculus has several variables has been really confined to just the study of differentiation. We've seen multivariable functions, perhaps f of x, y, or even f of x, y, z. And we've looked at how to take partial derivatives. So now what we want to do is take the topic of integration and apply it to these kind of functions. So these multivariable functions. So we've been given some motivation before we define the concept of an integral for functions to several variables. We're going to renew some of the key features of the integral in a single variable function, and then we'll try to generalize that notion. So as a reminder, recall that the definite integral of a single variable function the integral from a to b of f of x dx, represented. At least when the function was positive, the area under a curve from A to B. If the function wasn't strictly positive, we talked about the net area of the function. So first comes the function, and then we take an interval X from A to B. And then we're after this number that captures some sort of geometric notion in two dimensions is the area, under a curve. Now let's generalize this to a function f of x y of two variables. So first we start with our function. Now we need the two dimensional analog of the interval. Again, remember we're hanging out in space, the graph of this function is the default magic carpet flying in space. So what would be the two dimensional analog of an interval from a to b? Well, let's take a two dimensional region in the xy plane. Remember when we draw the picture space, we have Z pointing up and X and Y are sort of the floor. So we want some region on the floor in the single variable case is an interval from A to B in the two dimensional cases is a region. I will call it D then we want to generalize our definite integral and so we want to find the double integral. Of our region D of our function f of x y, and we're going to take this dx d y, we have two variables now. So instead of just dx, we're going to do dx, and dy y and this notation, this object is called the double integral of f of x over a region D. Now a couple things about this. All these variables that I've used are dummy variables. What does that mean? The function doesn't have to be called f be called hrg. The variables do not have to be called x and y that could be alpha and beta, or s and t or whatever. And of course the region doesn't have to be D. It could be R or s. Or whatever we want. Okay, but this is usually the default we start with x and y. And we're going to assume just for simplicity, just like we did in the single variable case that the function is positive. And we'd like to sort of interpret what this number means. Remember the end of the day. This is a number. It has a geometric meaning what's the point? What's what does it tell us? In the single variable case we have the area under the graph. If we generalize that to a higher dimension, what do we get? Now we get the area under the graph again but it's a three-dimensional area. It has volume, so if I draw all the space underneath I go to a three-dimensional figure and I get the volume under the graph. That is what this number tells us when the function is positive and just like before if the function is negative. We start to subtract off the volume and really get the net volume. So this number what does this number actually tell us this is the net volume under the graph of the function and above the region D. The so this is the notion of the double integral. And now that we have defined this notion of a double integral, we must learn how to calculate its value. We're going to introduce the notion of an iterated integral. So let f of x, y be any function of two variables, we're going to let g of x and h of x be 2 functions of x alone. And we're going to let a and b be numbers, real numbers of course, then an iterated integral hard to say. Iterated integral is an expression of the form a to b, and then g of x to h of x, f of x, y, d y, dx. To explain the meaning of this collection of symbols, I'm going to drop parentheses around, you can see the iteration. We're really going to treat this as two integrals that are kind of nested together. We're going to use our skills of integral calculus to attack one of them. We'll simplify it and then we work our way inside out to get the other one. Let's do an example and put some numbers behind this and see what I mean by this sort of nesting effect. Let's compute the double integral the double iterated integral from 1 to 2, and then 4 to 3 of y minus x, dy all inside over dx. I can review this inside out. And the key here is these dy's and dx where they didn't play a major role last time they do now, this tells us that y is our variable. So we're going to work just with the inside and we're going to take the antiderivative of each piece. X in this case like we do with partial derivatives is a constant. So what is the antiderivative of y when y is the variable?. Well, that's y squared over 2. And what is the antiderivative of minus x, which is treated as a constant, that becomes minus x, y. And I'm going to keep my outside integral from 1 to 2. And since I have integrated the integral sign on the inside goes away and I now plug-in is important from y equals 4 to y equals 3. I usually write the variable that I'm going to plug in just so I don't get confused. I still have the dx. So the outside integral still there. I don't want to lose any of that and we continue as normal so we're just working. Inside an integral now, I plug in for y equals 3 and I get 9 over 2 minus 3x minus 16 over 2 minus 16 over 2 minus 4x, and this is all dx. We can simplify our numbers we have a we can combine like terms. I have 9 over 2 minus 16 over to that, of course is minus 7 over 2, and then I have minus 3x minus minus 4x is minus 3x +4x or 4x-3x is just x. And now I have completed the first inner integral of this iterated integral, and I get down to the single definite integral, which I've done many of these before. We integrate -7 over 2 to get -7 over 2 x, and x of course, becomes x squared over 2, and we plug in from 1 to 2. And we evaluate this to get negative 7 over 2 times 2, plus 4 over 2. 2 squared, minus, we plug in the top minus plug in the bottom, minus 7 over 2 plus 1 squared is 1, one half. Clean this up a little bit more, you get minus seven plus four minus, and then seven plus one is negative six over two. Of course minus 7 plus 4 is minus 3, and then 2 negatives make a positive 3, so we get 0, are these a little longer? Yes are they hard to do? No, they're just more of the same. So the key here is wanting to be consistent wants to be careful and just check your work as you go. One small mistake in the very first step can lead to the wrong answer down the line. Let's do another iterated integral. But now let's step things up a little bit. So let's have from 0 to 1, let's actually put non constant functions inside of these inner inner integral inside of the inner integral. And we'll evaluate this integral for the function 2xy, this multivariable function. Dy dx, I'm not writing the inner parentheses but you can imagine in your head, the inner parentheses that are there, sometimes there and sometimes they're not. As always we evaluate the inner integral first. Keep in mind that y is our variable. X in this case is treated as a constant. If you want to just kind of come off on the side and work with the integral you can if you want to keep writing the outer pieces, that is also fine as well. So we'll have our 0 to 1 and our dx, that's not going to change. We really just work with two x y, d y When I integrate with respect to y, 2x is a constant. Y is my variable antiderivative y becomes y squared over 2. So I have x y squared over 2 and I have the twos and they cancel. And I'm going to evaluate this at y equals a squared of x and y equals x plus 1. But I plugged them in and I don't lose any of the other pieces I still the integral from 0 to 1, x and y as x plus 1 becomes x plus 1 squared, minus x again. And then, square root squared is just x. All of that is dx. We can foil we can distribute, we can simplify this. This becomes x cubed plus 2x squared plus x minus x squared. All this is dx we take an anti derivative of this, maybe we'll even clean it up one more step, let's combine the like terms here. We get x cubed plus x squared plus x dx. Now I'll find the anti derivatives and evaluate this x cubed becomes one fourth x to the fourth plus one third x cubed plus one half x squared. Plug all of that in from 0 to 1. Basically plug in 1. When you plug in 0, all that cancels, you get a fourth plus a third plus a half and that is 13 over 12. So this number just like any other integral represents the net area of this curve over a region, defined by the bounds on my integral. Just a couple of properties a double integrals that also carry over from their single variable case. If I have the double integral over some region R, I'll change up the variables just so you get used to it have a sum of two functions. So dxdy, this becomes, you can distribute over addition, just like you did in a single variable case, you can treat this as two iterated integrals from gx, dxdy. So the ability to distribute over a sum does not change. Second property of an iterated. Integral says if I have a constant times, I function dxdy, order here won't matter and I'll talk about that in a second. But if I have a constant, well, that constant also pops out just like it did in the single variable case. One of the properties about double integral functions talks about inequality. So if I have multivariable functions, where I have one function that is greater than or equal to another one for all x, y and some region then I can integrate both sides of this inequality, I can look at the integral. This is true also in the single variable case, and it will preserve the inequality. So it was good to talk about inequalities because remember something as simple as like multiplying or dividing by a negative, does not preserve the inequality. So when you get a new mathematical operation you should ask, what does it do to inequalities integrating, whether it's double integral or single integral preserves inequalities. You don't have to worry about changing the sign around. Just one thing to note here, I wrote da sometimes this is a shorthand notation for dxdy, or dydx. The order doesn't matter as long as you have the variables that match for whatever variables the function is doing. There's a very useful theorem when computing double integrals that says that if I have a multivariable function f of xy on some region R in the xy plane, and will let R be defined as x y, where x is in some rectangle, a to b, and y is in some interval c to d. In your head this is set notation, but this is a fancy way just to say, in my xy plane, the space where my function and its graph lives. I have some rectangle from a, to b, c to d. So this is a rectangle on the floor, and I'm looking at the particular part of the graph above this rectangle. Well then Fubini's Theorem says basically what I said before that order of dydx doesn't matter. Let's see if we can write this down and it looks more scary perhaps writing it down. So this double integral in general we put da, but of course, that just means you can pick whichever side you want the region f of x y dxdy is equal to f of xy dydx. This says the order that you integrate in. Doesn't matter at all. Why would that be the case? Well remember what this number represents. This number represents the volume of the space underneath the graph. This is a volume. Does the volume change if I start going in one direction or the other, is like is the base times height or height times base? Does that matter? And the answer is no, because it has a geometric interpretation. The order at which you integrate things picking x first or y first or vice versa, doesn't matter. That's fantastic because it lets you sort of go the easier way let you pick the easier route on how to integrate these things. And one of the strategies is, well, if it's too difficult in the order presented, maybe it's simpler if I just switch the order. But to get introduced to these new notions, it's best to just keep doing examples. Let's do another one. Let's introduce some trig functions. So let's go 0 to pi. And how about 0 to 2? Let's go r sine theta, d theta dr d theta r. So like I said before x and y were dummy variables. Now I have r and theta. Why not? They're all fine. Let's treat the inner integral first, we're going to look at everything dr. I'm not going to lose the 0 to pi, I'm not going to lose the detail on the outside, I'll keep all that. I'm going to integrate with respect to r. So sine theta is a constant. It comes along for the ride. And I really just integrate r, which of course is r squared over 2, and I evaluate that from r equals 0 to r equals 2. Notice I use the variable in our mind myself where I'm plugging in, Keep that nice little 2 to keep things kind of simple. 2 squared over 2, which is 4 over 2, which of course is just 2 sine theta. And then when I get plugged in R0, I just get 0, so minus 0. Not going to write that, but it's there. I have the nice easy 2sine theta. What is the antiderivative of sine theta that becomes minus 2 cosine of theta for the reminder, the antiderivative of sine is a minus cosine. And I'm going to plug in from theta equals 0 to pi. And when I get that I get minus 2 cosine of pi. And then minus careful here minus minus 2, cosine of zero. Cosine of pi is negative 1. Cosine of 0 is 1, and I get negative 2 times negative 1 minus minus 2 just writing this out because of all the negative signs, 2 times you get to basically plus 2. Hey, we can do that's for all done. Nice, not to be outdone. There's nothing stopping you from introducing the notion of triple integrals, or even more integrals to go up the chain. You can certainly talk about a function of three variables, and it outputs a single number. The problem with this is even though we could set up the notion of triple integrals, and again, just integrate all day. You'll lose a little bit of the geometric intuition because remember, the domain now is three variables. So the picture we normally draw with xy and z. This is the domain of the function. I pick any point in space and I plug it into the function, and then I output another number. So the graph of this thing, I don't know how to draw this, like it lives in four dimensions, so I can't quite draw the picture. So if I talk about and I guess I could work this out the triple integral of f of xy and z, dx, dy, dz order won't matter. Just like Fubini's Theorem says for 200 rolls, but I can do this and I can still compute some number. This is trying to capture I guess you know what is the four dimensional analog whenever that means that there's a time and place for that mean something but after you go from area to volume, four dimensional volume. I don't know it doesn't have a really good natural intuition for our purposes, but you certainly can do it. There is one exception to that rule of course. And that is if I'm going to give this a new name to call it E, by the way, the domain, whatever you restrict to the finite domain, they call it E. It's some number, but the interpretation, it doesn't have a good interpretation. The one exception to that, is if you happen to integrate the very boring multi-variable function one. So you give me any point in space in this function, outputs a, one in that case. I'm going to integrate over some region E, remember, E is 3D. So it's like hold, some cube or something like that. Whatever it is, this is E, the integral of the triple, the triple integral of this, so dx, dy, dz. Let's see if you can think about what this actually one of the nice things about this kind of math is it generalizes nicely. So if I ever asked you something crazy in three integrals or something like that, you can say, well, what does it mean in the two dimensional case of the one dimensional case? And if you could find the pattern, it's probably true in 3D. So let's rephrase the question here. And let's just look at, well what happens in the region if I integrate the function one, dx, dy, like what does this actually mean? Or even perhaps easier, what happens if I do and single integral of one dx? Whenever you get a question or something you can't draw, try to study what happens in places where you can draw, in the single variable case, when I have from A to B. If I have the constant function one, so this flat line, and I integrate, I get back a rectangle underneath the curve, and I get back. What's the area of a rectangle of height one, it's just A, B. This turns out to be the length of the interval from A to B. This is just B minus A. You can even work it out, you get B minus A. In the double integral, that iterated integral case, we said before, what does this number represent? I have the magic carpet, but now it's a plane. It's just flat one, and I have some region D on the plane. Think of it like a cylinder or something like that. Or like a cylinder of height one, or cube of height one, what do you actually get back? Well, when you do bass, like times the highest of the highs is one, you just get the area of the object on the floor. This gives you the area of D. So in the very special case, when you're integrating one, it's really more a statement about what you're integrating over. It gives you how much of the thing you're taking over, one dimensions is length, two dimensions is area. So that sort of helps answer our question now about what is the three dimensional analogues, in the very, very special case where there is one, this will give us the volume of whatever three dimensional thing we are looking at. So you can triple integrals to get volumes of spheres, or other, like weird shapes you just don't know, this is another way to get those objects. Just for fun, can we call it fun? Let's call it fun. Just for fun. Let's do one triple integral, and we'll go dv, dv is the generic term for like dx, dy, dz, order does not matter. I want to integrate this multivariate. Variable function of xy and z. So zx minus y cubed, that's my function of three variables. And I want E to be the region in space. So I want all points xy and z, such that x goes from minus one to one, y goes from zero to two, and I want z is zero to one. So some sort of rectangular prism to work this out, order you pick does not matter. So for no good reason, let's go, dx, dy, dz, alphabetical seems just as good as any other. So z is going from zero to one, we're going to work our way outside in, y is going to zero to two, and we'll go from minus one to one. Put the function in here xz minus y cubed. And then, remember, the bounds have to match here. So dx, dy, dz, friendly reminder with these iterated integrals, everything is like inside out. So if I can do it twice, I could do it three times. If I could do it three times, I could do four times, nothing I want to, but I certainly could. So we work our way inside out. X is the variable, gotta pay attention to what that is. And we compute as usual. So we keep our two outside integrals, they don't change. We'll keep dy and dz. And we just play around the inside for now. X squared over two times z minus xy cubed. Again, Z and Y are constants. And we're plugging in X is negative one to one. And when I do this, I get zero to one, 0 to 2, Z over 2, minus Y cubed, for then parentheses, minus Z over two plus Y cubed, that's d y and dz. Don't lose these pieces at the end, clean that up a little bit, 0 to 1. So what do you notice the z over twos cancel, it's kind of nice. And you get -y cubed, -y cubed, which of course, is just -2 y cubed dy, dz, I lost one of my integrals in here, 0 to 2, here we go, and therefore, now, I have, let's integrate with respect to Y. I'm not going to lose the 0 to 1 dz, that comes along for the ride, and I get y over 4 minus, and then, 2 or 4 becomes 1/2, and unplugging and Y is 0, 2 Y is two, and I get zero to one, let's plug in two, so you get minus one half to the fourth is 16. And then, if you plug in zero goes to zero, this is all dz, have a nice, finally, single integral, negative half of 16, of course, is minus eight. I can bring that out, that's a constant. And I have from zero to one of the function one dz. If you want to use the geometric interpretation of what it means to integrate one, that's just the length of the integral from the interval from zero to one. That, of course, is one. So final answer is negative eight. So you can compute these triple integrals, but because the original function was not one, I don't really have a good geometric interpretation of this number. However, the process still exists. And if you take more advanced courses, these things might become more meaningful in terms of their geometric intuition. But for now, I care more about the steps, the anti derivatives, the derivatives that you use plugging in watching all these signs. Treating variables as constants as needed. There's a lot going on here, as an exercise, if you want, compute this going dz, dx, dy, like rotate the things and just show yourself, convince yourself that theorem will work, you should get negative eight, no matter which way you write the variables. All right, great job on this. We will see you next time.