 Hi. Good to see you guys. As always, I would like to say a few things about Lagrange multipliers. That's the subject of the lecture on Tuesday. When we talk about Lagrange multipliers, there is one important aspect which one has to realize. And that aspect has to do with whether the curve we are dealing with is bounded or not. The example which we discussed in great detail last time was the example where the curve was an ellipse. An ellipse is bounded. Now, what do I mean by boundedness? It's bounded because it is contained in a disk of a large enough radius. So in this case, I think this was 1 and this was 1 half. And this is negative 1, negative 1 half. So we can take a disk of radius 1, and this entire curve will be inside. Or if you want, take a disk of radius 2 even bigger. So for sure, it will be inside. In other words, there are no branches of this curve which go to infinity. An object is called bounded if it is contained entirely in a large enough disk or a ball if we are in a three-dimensional space. So this curve is bounded. And for bounded curves, the method works in the best possible way. In the best possible way, namely, we will be able to find a maximum and a minimum of our function. Our function will have a maximum point which was here and a minimum point which was here in our example. But if the curve is not bounded, then it may not have a maximum or minimum or both. So that's an important remark that I wanted to make. Because actually, on the homework, as you have probably already seen, there are some exercises where that is the case. So let me contrast this to the following curve. And this is actually exercise number 3 in 14.8. I know it's on the homework, but OK. It's my gift to you. OK, well, if you like it, I can do it again maybe next week or a couple of weeks. All right. So in this exercise, the curve is given by the equation x, y equals 1. So what is this curve? This curve, well, to understand that, it's best to rewrite this equation as in a more familiar form, y equals 1 over x. If you write it in this form, we see immediately that this is a graph of the function 1 over x. And that's what we call hyperbola. So that's actually something we learned a long time ago. And it looks like this. It has two branches, one here and one here. So this is a point 1, 1. And this is a point 1, negative 1, negative 1. And in this exercise, you're asked to find the maximum and minimum of the function f of x, y, which is x squared plus y squared. So this curve is not bounded. So while this was bounded, this is unbounded. Why? Because it's, well, intuitively, because it goes to infinity. It has branches which go all the way to infinity. More precisely, no matter how big a disk you take, it will not be contained. This curve will not be contained in that disk. There will still be some points outside. So it is not bounded. And that changes the equation, so to speak. It changes the game. So let's see what are the maximum and minimum. Let's apply blindly just Lagrange method and see what we get. So Lagrange method tells us that nabla f, we should look at the equation, nabla f equals lambda times nabla g. So in this particular case, the function f is x squared plus y squared. So this is 2x, 2y. And the function g is xy. Because the equation is xy equals 1. This equation. So we get lambda times yx. And then this corresponds to a system of two equations. 2x equals 2x is equal to lambda y. And then you have 2y equals lambda x. So from the first equation, we find that lambda actually is better maybe to, and of course, the third equation, which I forgot, which is xy equals 1. And so let's do this in the following way. So let's say that let's find y is 1 over x. And so let's substitute this in both of these equations. So we get 2x is equal to lambda times 1 over x. And here 2 1 over x is equal to lambda times x. And so from this, we can find that lambda is equal to 2x squared. And so then we substitute in this 2x squared. So we get 2 1 over x is equal to 2x cubed, which means that x to the fourth is equal to 1, which means that x is equal to plus or minus 1. So far so good? OK. So now we find two points. We find two points. 1 point is 1. 1x is 1. We use this equation to find that in this case y is also 1. And the second is negative 1. And then again, y is also negative 1. And then let's evaluate the value of the function f. f is x squared plus y squared. So we get value 2. And then here, we also get the value 2. So that looks like a puzzle because we just follow blindly the method. We find two points. So we think, well, perhaps one of them is a maximum. The other one is a minimum. But when we evaluate the function, we see that the values are the same. So what does it mean? Does it really mean that the maximum value of the function is 2 and the minimum value of the function is also 2? That would mean that the function is constant. It's equal to 2 everywhere. But this function is not constant. It's x squared plus y squared. For example, it is actually equal to 0 here. Or it's not even constant on the, that's not a valid argument because we have to look at the restriction of the function to our curve. But the restriction of the function to our curve is x squared plus 1 over x squared. So again, it's quite clear that the function is not constant. So what happens? So to see what happens, I mean, so far I just did this calculation blindly. So I didn't like, yes, what you would do without drawing the picture, you just do the calculation and then you see, oh gosh, I got the answers are the same. So that's strange, what really happened? So now let's find out what happened. So the best thing to do is to go back to how we actually derived the Lagrange equations in the first place. When we derived the Lagrange equations, we looked at the level curves of our function. In this case, the level curves are extremely simple. They are x squared plus y squared equals k. And this is, of course, the equation of a circle of radius square root of k. So the level curves are concentric circles of all possible radii. And there's more. There's more and more and more. So each of these circles represents the set of points for which the value of the function f is the same. So for example, the function takes the same value on this circle. It takes the same value on these circles and so on. So which means, in particular, that the function is the same here and here, right? And here and here, which are the points of intersection of that level curve with our curve x, y equals 1. So now if you just look at this, you see that the value of the function f increases as we go outward. As we go outward, the radius of the circle becomes larger. And because the function is essentially the square of the radius of the circle, it grows when the radius becomes larger. And likewise, it becomes smaller when the radius becomes smaller. But because the curve is unbounded, you see that this function doesn't have a maximum. Because any positive real value greater than the value at this point will actually be realized. And the value at this point is equal to 2. Any value will be realized. If you want a value, a million, the value million will be realized, or maybe twice a million will be easier. So then it will be like x and y equal to 1,000. You'll get twice, two times a million. So any value will be realized because the curve is unbounded. So then the question is, so that means that the function actually has no maximum. This function has no maximum and maximum value on this curve. So what about these values? Well, these values are realized at these two points, which I have marked in the beginning. And this, actually, you can see that these are the smallest possible values. Because this is exactly the points where the level curve for f touches our curve. The level curve for f is a circle. And it touches our curve of the hyperbola at this point and at this point. So this is really the smallest value, the minimal value. Because if you take a radius any smaller than this, you will lose contact. You will lose intersection with our curve. So therefore, this is really the smallest possible value. So I went through this argument in great detail on Tuesday. I will not repeat it. So that argument is valid for these two points. And this argument shows that these are indeed the minimal values. So it's not surprising that the two values are the same. So they just both are attained. Both give us the minimal value. Now, it could happen, for example, that I could just change the setup. And I could consider instead a curve where the top branch, the right top branch, would be going here. So it wouldn't be given by this equation. But it would be a union of two curves. One, say, would be x, y equal 1 in the third quadrant. And the other one would be x, y equals 2, for example. So then it would actually be higher. So in this case, if we apply Lagrange method, we would find, again, two points. But the values would be different. So in that case, again, we compare the values. So if, for example, as a result of this calculation, you could actually get 2 and 3, say, if you chose the function in a slightly different way. You could get a different value. And then it would be even more tempting for you to say, OK, this is maximum. This is the minimum. But actually, neither it would not be, I mean, this answer would not be correct. One of those two answers would be minimum, namely, the one which is smaller. But the function still wouldn't have a maximum because the branches go to infinity. So in other words, don't think that the fact that they're both equal is the only possible scenario for which indicates that the function doesn't have a maximum. You could even have two different values. But both of them, say, one of them would be minimum. One of them would be neither maximum, minimum, and no maximum. It's also possible. So these two are actually too minimum. Finally, there is a possibility that the function doesn't have either maximal value or minimal value on a given curve. For instance, let's take the function y. So let's say, let's take just half of the hyperbola. Let's take, let our curve be y equals 1 over x, and y greater than 0. And let's take as function f, let's just take y. We can do that, right? So in this case, clearly, there is no maximal value because it goes to infinity. Same reason. But there is also no minimal value for a slightly different reason. It's not because the function goes to minus infinity. The way it goes to plus infinity on this part. It goes to 0. So you might be tempted to say that the minimal value is 0. But you can't say that because that value is never attained. Value 0 is never attained. You get as close as possible to it, but it's never attained. So that means there is no minimal value because the 0 value is not attained. And any value which is above 0 is attained, but it's not the smallest one because you can always take one half of it and it gets smaller value. So this function has neither a maximum nor a minimum. So in other words, to summarize, it is boundedness which guarantees the existence of maximum and minimum. If you have a bounded domain, you will always have a maximum and a minimum. If the domain is not bounded or curve is not bounded in this case, all bets are off. Anything can happen. You might have only a maximum but no minimum. Only minimum and no maximum or neither. Finally, keep in mind the following thing. Here, I wrote this equation just by itself. I did not put any limits. I didn't say what are the ranges for x and y. So if there are no limits, it means that there could be arbitrary. That's why I drew the entire hyperbola. But there could be a variation on this problem where, let's say exactly, let's look at this problem and let's do the following variation on this problem where I would also say y equals 1 over x. But I would actually put explicitly the ranges, say x is between 1 and 2. And then I will ask, maximize and minimize, well, find maximum and minima of the function f of xy equal y. If I do that, then my curve is not the entire hyperbola or not the entire branch of the hyperbola, which is drawn over there. But only the part between 1 and 2. And the part between 1 and 2 looks like this. So this would be the two endpoints. So this is 2. And this is 1. This is 1. And this is 1 half. So in this case, you see the curve actually has boundary points. So it is just like when we minimize functions in one variable calculus on an interval, which includes the endpoints. So in this case, the maximum minimum could well be attained at the endpoints, which is what happens here. Here, the maximum does exist. It's at this point. Because since I impose this condition, I cannot go any further. In the previous example, I had the entire hyperbola, which went to infinity. It was unbounded. This guy is bounded. It is certainly sitting inside a large enough disk. This curve is bounded. So there is indeed a maximum and a minimum. And the maximum is when x is 1. And y is equal to, in this case, y is 1. So let's just write f is 1. And the minimum is at x equal to, in this case, f is 1 half. Any questions about this? So I tried to give you several representative examples to give you an idea of what are the possibilities. And you should keep these possibilities in mind when you do problems like this. When you solve problems like this. Usually, there is no way of telling, for an unbounded curve, there is no way of telling whether the points which you find are maximum and minimum, just from the algebraic analysis like this. You really have to visualize the picture. You have to use some ways to reason, to argue why it is maximum or a minimum. In this case, for example, let's say you don't want to draw the picture. You could argue as follows. You could say, OK, so both are the same, which means that, well, we know that function is not constant. Both are the same, so it could be either maximum or minimum. Which one is it? Is it a maximum or a minimum? Well, on this curve, I could find a point for very large x. So let's say x is a million. And y would be 1 over a million. So it's really small. So the value would be a million squared. So on this curve, I can find a point where the value is a million squared, which is greater than 2. So that means this is a minimum and not a maximum. So that's one way to argue even without drawing the picture. But you have to have an additional argument to say which one is it, maximum or minimum. OK. So let's move on to the next subject. And the next subject is integration. I promised you at the beginning of this course that we will, or maybe not promised. I promised not a good word, but I told you. I kind of gave a preview. And I said that essentially, you can break the material into two parts. One is integration, and the other one is differentiation. This is, in some sense, two opposite operations that we're doing calculus. What we've studied in the last few weeks was the differential calculus. We studied things related to differentiation, like Lagrange method, where to find the maximum and minimum, we had to take derivatives. We had to take partial derivatives, for example, and then solve some equations. And now, for the next few weeks, we will talk about integration. So today is the first installment of integration. So what do we need to know about integration? Well, first of all, I would like to recall, as always, what we learned about integration in one variable calculus. Actually, we already talked a little bit about this before, so I'll be very brief. In one variable calculus, we are used to calculating integrals of a function in one variable over an interval, say, from A to B. So there are several things that we learned in that regard. The first thing that we learned is that, in the case when the function is non-negative on this interval for x between A and B. So let's say this is A and this is B. So if the function is non-negative, then the graph of this function is going to lie entirely over this interval, or more precisely, the part of the graph above this interval or corresponding to this interval will lie above the x-axis. In other words, I want to avoid the situation where it goes. It's above and below the x-axis. I'm not really losing much generality by assuming that, because even if it were below, I could just add a constant, sufficiently large constant to the function, and raise it above the x-axis. And so then the integral would be different from the original integral by the integral of that constant. But the integral of the constant, we know. It's that constant times B minus A. So we don't really lose much generality by assuming here that the function is non-negative on this interval. And if it is non-negative, then actually, this integral represents the area on what we call, usually informally, under the graph. And when we say under the graph, we mean between the area of the region bounded by the graph, the vertical lines, y equal A, and y equal B, and the x-axis. Oh, yes, x equals. That's right. Sorry. Thank you. x equals A, and x equals B. This is y equals 0. And this is a graph, which is y equals f of x. So that's the first aspect, that this is the way integral gives us the area under the graph. That's number one. So you see, function is in one variable. The function is in one variable. But you get an area of a two-dimensional object. You start with a function in one variable, but you naturally get a two-dimensional region. Because you look at the graph, and the graph lives on the plane, you add one more variable, y, and then you use the graph as a boundary of this region. So you get a two-dimensional region, and it has an area. And that area is represented by the integral. So that's the first aspect. The second aspect of the study of the integrals is how do we define it? So the first aspect is, what does it represent? And the answer is, it represents the area. The second aspect is, how do you define it? And the way you define it is somewhat subtle. The way we define it is, we break this interval into smaller pieces, and then we approximate the function by the step functions like this, by just constant functions on each of these intervals, and so on. And that gives us the possibility to approximate the entire area, this entire area, as the sum of areas of all of those elementary rectangles. So let's say here, one rectangle will look like this. One of these rectangles will look like this, where this side will be delta x, and this side will be delta y, so it's actually not a good idea. Let's call it, it's just going to be f. Let's say this is a point xi in the partition. This is xi plus 1. This will be f of xi. And then the point is that we don't know a priori at the beginning, what the area of this complicated region is. But we certainly know what the area of this one is. And the area of this one is f of xi times delta x. Because it's a rectangle, and for a rectangle, the area is just the product of the sides. So this is the important thing which we have to know in advance. The area of the elementary piece. And after this, we take the sum. So let's call this area number i. And then we take the sum of this area is number i, from 1 to n. So let's say that there are n parts, n pieces, in this partition. And the size of each of them is delta x. That's this delta x, which I wrote here. So then this one, we take this as an approximation to the value, to the area. And then the point is that as n goes to infinity, as this piece has become smaller and smaller, this approximation for functions, let's find some good properties like continuous functions, is going to approximate this area better and better. And so the actual area, we will get in the limit when n goes to infinity. And that's this interval. And so you recognize f of x dx as coming from this expression, f of x delta x, which corresponds to the area of this elementary rectangle. So there are some methods in mathematics which allow you to show that this limit actually exists. And so this, therefore, justified this definition. And again, for that, you actually have to make some assumptions on the function f. But all the functions which we'll consider in this course will satisfy this assumption. So I'm not going to talk about this. All right, so that's the second aspect, the definition. And finally, the third aspect is how do you actually compute it? So I purposefully separate this to points, the definition and the calculation. Because the definition is rather complicated and in some sense esoteric because you are breaking something in smaller pieces and so on. So this is sort of the hard part of this story. But this is something which has been done. It has been proved that this process gives you a well-defined definition of the integral. And after that, we have to choose an efficient method to actually calculate this integral and, therefore, calculate this area. We are not going to actually calculate things by we're not going to calculate things by actually breaking into pieces and taking the sum and taking the limit. We're not going to do that each time. In fact, we have a much more efficient method for calculating this integrals, and that's called the fundamental theorem of calculus, of one variable calculus or a Leibniz-Newton formula. And that's the formula which tells you that to find this integral, you need to take the antiderivative, where f of x is f prime of x. So in other words, to calculate the integral, you have to perform the operation which is opposite or reverse to the operation of differentiation. And it is in this sense that we can say that integration is reverse or opposite to differentiation, something which is not at all obvious from the original definition by as an area or as a limit of these partial sums, but which is nevertheless one of the most important results here. And this is what we use in practice to calculate the integral. So I have summarized for you the story of a function one variable. And in this course, we are dealing with functions in two and three variables. So of course, we are going to have integrals for such functions as well. Integrals for functions in two and three variables. And the structure of the story is very similar to the structure which I have just outlined. It also has essentially three parts. One is, what does it represent? Two is, how do you define it? And three, how do you compute it? So let's talk about functions in two variables. Now functions in two variables. Function in two variables also has a graph. So let's say you have function f of x, y. Function in two variables also has a graph. And the graph now lives in three dimensions. So we draw a three dimensional coordinate system where in addition to our variables x and y, we introduce one more variable which we call z, right? So the next step is to realize what is the analog of this area under the graph. So here we are talking about the region which is bounded by the graph and the x-axis and this vertical lines. So there is a clear analog of this in the two dimensional case, right? Because in a two dimensional case, we can instead of the interval x from a to b, we can look at the rectangle where x is from a to b and y is from c to d, it's a rectangle. So let me draw it. So let's say this is x equal a. I mean this is x equal b and this is x equal a and then this will be y equals c and y equals d. So I'm talking about this rectangle. So this is a, this is b, this is c and this is d, right? I'm talking about this rectangle. Don't confuse this rectangle with this rectangle because they're both rectangles but they have totally different meaning. In this rectangle, the variable is one side and the other side corresponds to the function. And now we are just talking about the variables. Now we have two variables. So we have this rectangle on the xy plane. And now let's suppose that the function f of xy, our function, is non-negative on this rectangle. So that means that the graph of this function is going to lie above the xy plane if we look at the part of the graph corresponding to this rectangle. So what does it look like? So the way it's going to look is as follows. So this, let me draw first the kind of the walls of this picture. And then, so it's going to be something above, something curvy above this rectangle. So let's say, so it could look something like this. So this would be the part of the graph, part of the graph above this rectangle. And the graph could go, could continue but we will only be interested in what happens above this, above this rectangle. So now we clearly have a three-dimensional region. Three-dimensional region which is bounded by these walls and the walls correspond to, so this would be a dotted line. So the walls correspond to this vertical planes which are obtained by taking these segments and kind of moving them vertically up, right? So you got this three-dimensional region bounded by those walls by this rectangle at the bottom and by the graph of the function at the top. And this three-dimensional region is an analog for our function into variables of this two-dimensional region. And the integral of the function f will be defined, will represent the volume of this three-dimensional region. So we've got this three-dimensional region, three-dimensional region, which we'll often call it solid. We refer it as a solid. So kind of think of it as a piece of solid. And the integral, let me just write here. So the integral of the function f of x, y, dA, this will be the notation for this integral over this rectangle, let's call this a rectangle R. So this is R, will represent the volume of this solid. So you see, all dimensions get bumped by one. Here you have the function in one variable. So the bottom of this picture is one-dimensional. It's an interval, but the region is two-dimensional and it's represented by a single integral. Whereas now you have a function in two variables. So instead of one, you get two. You have a three-dimensional region or solid. The bottom of this region is a rectangle in your original variables, x and y. And the volume of this three-dimensional object, three-dimensional solid, is represented by a double integral, which is denoted like this, where dA sort of stands for the elementary area, just like dx was a notation for sort of the elementary length. So this is a notation, this is a notation which we'll use. And what I've explained now is the first aspect of the story, which is what does this integral represent? This integral represents the volume of the solid, provided that the function is above the xy plane. But again, that assumption we can make without loss of generality, because any function can be made so by adding a sufficiently large constant to it. Okay, now the second aspect of the story. How do you actually define it? And again, it's very much parallel to the definition here. You break the solid into smaller pieces. To do that, you first break the rectangle into smaller rectangles by choosing some step, delta x and delta y, right? So you kind of make a grid of rectangles with sizes, delta x and delta y. And for each of these very small elementary rectangles, you draw, let's actually, let's do this one. For each of them, you draw a sort of a skyscraper. Which goes all the way up to the graph, you see. So that's sort of like a skyscraper which sits at this cell of this grid. And for each of them, you do the same. And then the point is that the entire volume can be approximated as the sum of volumes of those skyscrapers. So this is precisely analogous to what we did in the one-dimensional case. Except now, instead of, I mean, in the one-dimensional case, the bottom was like a little interval and now the bottom is going to be a little rectangle. So there will be of sizes delta x and delta y. But otherwise it looks exactly the same. Otherwise it looks exactly the same, you see. And so here is going to be, the height of this is going to be, let's say if this is a point x i, y i in our partition, this, the height will be the value of the function f of x i, y i. And so now we just use the same formula except it's no longer area, it's volume. And it's not, it doesn't depend just on i but it depends on i and j. So I actually should have said x i and y j, the i, j's cell of that grid. So that would be volume i, j. And this would be f of x i, y j times delta x times delta y. And when we take the sum of all of these volumes where n and m go to zero, n and m being the two, the numbers of partitions for x and y, we will get a double integral. We will get our double integral. So exactly the same idea. Approximate by sum of volumes of this little, of this very thin skyscrapers. And when the partition becomes finer and finer, this sum will tend to the actual volume provided that these functions satisfy some natural, some natural properties like being bounded and continuous. So that's the definition. But again, we're not going to use this definition to actually compute things, right? We want to use a much more powerful method like the method which we have. I have to be careful when I open the boards. You never know what's behind. So we want to use a more powerful method for computation, like the fundamental theorem of calculus. In other words, we would like to do it by taking some anti derivatives of some sorts, right? And this is what I'm going to explain now, the computation. Any questions so far? Yes, very good. That's right. Thank you. We didn't, right? So it actually said double, going to be double summation. That's actually a very good point. I'm glad that you point this out because this illustrates one more clearly why it should be a double integral. Because this is really a double summation. Why is it a double summation? Because it is a summation over little rectangles in this grid. So this grid actually looks like this, you know? So you have, so there will be, you know, one, two, three up to N along this side and then one, two, three up to M along this side. And so it's really a double sum. And in the limit, this double sum becomes a double integral. Any other questions? Okay. So now we talk about how to compute this. And we again take as a hint, we take the formula from the one dimensional calculus, which is that we essentially have to take the anti derivative of our function. But if you have a function in two variables, it's not clear which anti derivative you should take because actually there are two functions. Sorry, two variables. We talked about, when we talked about derivatives, we saw that there are actually two partial derivatives with respect to X and with respect to Y. Likewise, there are two partial anti derivatives. You can take the anti derivative with respect to X and with respect to Y. And the point is that there is actually an analog of this formula in which you actually have to do both. You have to both first take the anti derivative with respect to one of the two variables and then anti derivative with respect to the second one. And that will give you the answer. That's the idea. So let me explain this. So the computation is given by the following formula that this integral F of X, Y, D, A over R can be written as what's called the iterated integral. Iterated meaning that we do something in one after another, certain procedure after one after another. We iterate a certain procedure. And that procedure is essentially taking the anti derivative, which we should do twice because there are two variables. So it's sort of very reasonable. And so the way it works is the following. We first take the integral of F of X, Y with respect to the variable X, say. And so the limits will be A to B. So we take this integral, assuming that Y is a constant. This should remind you of the notion of partial derivative. So in fact, when you do that, you will get, you will use, you know, for this, you will get, you can express this as the difference of values of a certain function of points B and A. And that function will be nothing but the anti-partial derivative with respect to X of this function. And as a result, you will get a function depending on Y because think of this as a family of integrals depending on Y. So you have integrated out X, but Y still remains as a parameter. So the resulting object is a function of Y. And then you just integrate this function of Y from C to D, D Y. So that's co-iterated integral because you iterate the procedure of taking anti-derivative or doing a one-dimensional integral. But you could also do it in the opposite order. So in that sense, it's kind of reminiscent of the Clairot theorem, which told us that we can apply partial derivatives in any order and we'll get the same result. Likewise, here we are doing partial anti-derivatives and we can apply them in either of the two possible orders giving us the same answer. So that would mean that first we integrate out D Y. As a result, we'll get something which will depend on X. So in this integral, Y is frozen and X is a live variable. So we're integrating, but then we start, after we integrate it, we start remembering about Y and we get a function of Y, which we then integrate. Likewise, here, Y is the live variable, which we integrate, but X is a parameter. When we integrate, when we make this integration, we get something which depends on X. It's a function of X, which we then integrate itself. With respect to X. So these are two different formulas for the same integral. And depending on the choice of the order, first X, then Y, or first Y, and then X. And the fact that you can write the integral like this is what's often referred to as a Fubini theorem. Fubini theorem. Again, this is something which we are not going to prove, but we're going to use it in practical calculations, just like fundamental theorem of calculus. We didn't really prove it, but we used it extensively to actually calculate one-dimensional integrals. So let's see how this works in practice. Okay. Okay. So let's do this example. Say suppose that the R is the rectangle where X is from zero to two and Y is from zero to one. And the function F of X, Y is X cube, Y cube plus three X, Y squared. Okay. So you want to compute the integral of F of X, Y, DA over this rectangle. And I'm just using Fubini's theorem, so I have to choose which way I want to integrate, which variable first goes first. And let's say I want to do first the Y variable. So that means that first I do the integral zero one from zero to one, X cube, Y cube plus three X, Y squared, DY. And then I do the integral respect to X from zero to two. Now, it is tempting to just continue this formula, writing this formula, but then you have to carry with you both integration signs and so on. So this is a sure way to make mistakes. So I think it's much better to do the first integral, do the inner integral first, get the result and then substitute it into the formula. It's a much more straightforward way, I think. You will see it yourselves when you work on this. So let's do the inner integral by itself. X cube, Y cube plus three X squared, X, Y squared, DY. From zero to one, use the fundamental theorem of calculus and assume that X is just a scalar, it's just a constant. So we have to take the anti-derivative of this, right? What's the anti-derivative of this? The anti-derivative of Y cube is one quarter of Y to the fourth. And this is just a constant for now. We have frozen it, just a constant for now. This is just a constant for now. We have frozen it, just like when we were doing partial derivatives. So just carry X cube. Next, take the anti-derivative of this. Again, thinking of X is a constant. You get X, Y cube. And now you have to evaluate it at zero and one and zero. So you get one quarter over X cube plus X. And now substitute it back. We have now calculated the inner integral. So let's just substitute it in this double integral. So we'll get one quarter X cube plus X dx, right? So we get one over, so now that's just easy. So that's just the usual way. So that's going to be one over 16 X to the fourth plus one half X squared from two to zero. So that's going to be 16 over 16. That's one plus one half. So that's three halves. Sorry, plus two, three. That's the answer, okay? Any questions? Yes? Single integral. The question is why do we write it as a double integral? Oh, you mean the notation for DA or for this? I see. So the question is why do we use this notation? Well, see, before, when we separated, we were writing say F sub X or F sub Y for partial derivatives. So now I see. So you probably mean to say is that when we would write it, we would use this other D. We would use this kind of curly D. And now we are using this D. Well, because the reason is that this is really just D of X. This is really like a differential. So here there is no ambiguity. Ambiguity arises when you have a function which depends on two variables. So then you have to say DF with respect to X or respect to Y, right? But here we're taking DX. X doesn't depend on anything. So there is no, we don't have to give any additional information about that. So it's just a differential. When you have a function, one variable, we still write just a straight D, right? So X is like a function of itself. So that's why DX. It's the same DX which we use in the differentials, actually. So it is with DX and not with DX. But for now, just think of it as an notation. Don't read too much into it, okay? Any other questions? Yes? Okay, well, I have to say that now we are studying integrals and not different. You should have asked me this question when we studied differentials. But since you asked me, I will answer it. But think of this. Think of this as a digression. Or think of it as a time machine. We are going back in a couple of weeks when we talked about differentials. So remember DF is F sub X DX plus F sub Y DY. So in principle, you could write DF DX. And this would be F sub X plus F sub Y DY DX. Right, so you could do that. So, and that, by the way, is related to the derivatives of implicit functions. So, but this is not the same, not the same as DF DX which is just the notation for F sub X. See here, there is an additional term. Because a differential has two terms, one related to FX and one related to FY. So you could divide, it's okay. You get this expression for what it's worth. And in fact, this is a good way to find DY DX. When you have X and Y constraint, for example, if you know that F is equal to zero or something, F equals some scalar, that gives you a way to calculate. That's how you get the formula DY DX is going to be negative of FX divided by FY. This is a formula we studied when we talked about implicit differentiation. Right, but this on the other hand with curly D is just a new notation for F sub X. So that's the difference. But in some sense, this is related because actually this is like, this is the same DX as this DX. But it's not like DF because this is not like DF. F is actually outside of the differential, right? This is just DX. And for DX we don't use like this doesn't exist. Only this exists, this does exist. Okay, yes? Can I explain again? Okay, I would love to, but I actually had something planned to talk about. So maybe in the office hours? All right. So, but maybe it might be that this, what I'm going to explain next is example from the book. So, but let me take a look maybe. Number two, huh? Well, example number two by the way is like, it's just like this one, right? It's just a slightly different function but it's actually very similar. But let me go, let me move on actually to a harder example, to a more difficult example. So what else can we do? So for now, for now the region of integration in this example and in example number two, is a rectangle, okay? But we are actually going to study more complicated regions because well, we know that on the plane there are many other regions as well. So, let me show you here. So, the next thing we're going to discuss is how to apply this to compute more, more general integrals for more general regions. So for example, suppose that you have the following region. It's defined by the following formulas. So let's draw this. So x is from zero to one and y for each value of x, y is confined between within this value and this value. So to sketch this region, what we need to do is we need to sketch the graphs of these two functions, y equals square root of x and y equals two minus x. So the first one is going to look like this because I only look at it on this region, on this interval. And two minus x will look like this. This is two, this is one. When we say that y, for each value of x, y is confined between square root of x and two minus x, geometrically, this simply means that it lives on this little vertical interval. And so our region is just built from these little vertical intervals. It is just this domain, this region. Shaded, this shaded region. So that's more complicated than the regions we have looked at so far, which were simply rectangles, be like a rectangle like this. So how do we approach this? How do we calculate the integral when the regions are given by such formulas? So the point is that, to compute that, we just slightly generalize our formula. We still do it as an iterated integral, but we first integrate over y, but we integrate with the bounds of integration, explicitly depending on x. Namely, we'll go from square root of x to two minus x. And then we'll put our function f of xy dy. You see, before the bounds of integration were, say, c and d, they were fixed, but now the bounds actually depend on x, because that's the way the region works. We integrate over, for each value of x, we have a certain segment or interval in y. And we are integrating over this interval, but the interval itself, the bounds of this interval, actually depend on x in this way. But so there is no problem because we are integrating over y, so it is okay if the limits of integration depend on x. You certainly wouldn't want to put something depending on y in here, but putting the limits, which are functions of x, only is okay. So the result of this calculation is something which depends on x, and it depends on x for two reasons. First of all, the function f dependent on x. So even in the old calculation, when the limits were constant, the result was a function of x. But now there is a second reason why it depends on x, because the limits also depend on x. After you compute this, you get a function of x, and then you integrate this function over the limits, over the region given for x. And that region already is independent of y, or anything else, it's just constants, zero, one. So that's the formula. It slightly generalizes the old formula, in that we now allow the limits to depend explicitly on one of the variables. So let me calculate this integral in a special case. Let's say fxy is 2xy. So let's do the inner integral from square root of x to two minus x. So you have 2xy dy. So that's, take the antiderivative of, same rule as before, take the antiderivative of this function. Antiderivative of this function is x times y squared, right? Because x is a scalar. And now you have to take it between two minus x and square root of x. So what do we get? We get x times two minus x squared minus x times square root of x squared. What do we get? We get four x minus four x squared plus x cubed minus x squared. So we got this. So we got x cubed minus four, yeah, minus five x squared. x squared plus four x, right? So you see the result is just a function of x. I mean, this calculation is not much more complicated than the previous calculation. The only difference is that in the previous calculation the limits were zero and one. Okay, so you substitute zero and one and you get a function of x. Now the limits are squared of x two minus x. But again, you just substitute and you get function of x. You were going to get a function of x anyway. You might as well allow the limits to depend on x. Also, right? So yes, very good question. Just I'll explain in a second. I'll just finish, let me just finish this example and I'll explain. So what's the end result? We just substitute this into the outer integral. So we get zero one x cubed minus five x squared plus x cubed, right? So this is going, oh, sorry, dx. So that's one quarter x to the fourth, fourth minus five, third, five over three x cubed plus one quarter x to the fourth from one to zero, which is one quarter minus five, five thirds plus one quarter x to the fourth. Sorry, one fifths. Oh, yes. All right. So all of you and just me, yeah? Okay, okay. You were right. So four x, right? So that's going to be two x squared plus two. Is that okay? Okay. And then I'll let you calculate this. Okay. Now, this actually begs the question which you asked, which is, is it possible that we would have at some point encounter integrals in which for both k, for both inner and outer integral, there would be some dependence of the limits on x and y. So let me answer this. The point is that this will never actually be, will never be necessary for the following reason. So the most general, let's look at the most general domain. The most general domain could look something like this. So the point is that I can always, I can always break it into what the book calls regions of type one by cutting it by vertical lines in a sort of a clever way. I break it here into five pieces and each of the five pieces can be represented as a region of this type. So all of them can be thought of in this way. Well, in this case, that would be like, it touches here, but it doesn't, this would be the, for example, for this one, it would be, so this would be some function y equals f two of x and this would be y equals f one of x. So here you would have y equals f two and here you would have y equals f one of x. So when you have this region, what are the, what is the description of this region? Description is that x goes from A to B, see no dependence on anything, right? But for each x, the values of y are bounded between f one of x and f two of x. For example, in this case, f one of x was square root of x and f two of x was two minus x. And any region can be broken into such. And so therefore then the integral, the integral would be equal to the sum of integrals. It goes without saying, of course, that if you take an integral over this entire region, double integral over this entire region, this would be the sum of the integrals over the small, the pieces. When you decompose it into a disjoint union like this of non-overlapping subregions, then the integral can always be found as the sum of the integrals of the parts. Integral of the whole thing is the sum of integrals of its parts. And then each of those guys, you can represent in this way. Then of course, the point is that sometimes it is more, it is advantageous to represent it not by cutting by vertical lines, but by cutting by horizontal lines. And this actually gives you a way to, gives you sort of a second way to evaluate your integral. And sometimes it can happen that one way the integral is very difficult to compute, but the other way is much easier. So let me give you an example of this. Here's an example. So suppose you have the region like this. So you have x, y, where y is between zero and x is between, no, sorry, x is between zero and one, and y is between zero and x squared. And you have to, you ask to compute the integral of the function square root of x cubed plus one, dA. So let's draw this region. So x between zero and one, and y between zero and x squared is a parabola, like this. So this is the region. This is one, this is one, and this is, right? Okay, so since it's written in this way, we can write it down as an iterate integral in the same way as we did in the previous example. So that means we would first be integrating x over x, right? So that would be, I mean, not the first, but I mean the outer integral with respect to x, but the iterate integral would be with respect to y. So that would be from zero to x squared square root of x cubed plus one, dy. So let's compute the inner integral. So the inner integral is, okay, so this function looks very complicated. But remember, we're now integrating over y. So this is a constant. So constant function now, because y, x is frozen. So the antiderivative is actually this constant, so to speak, because it's independent of y times y. And then you do it from zero to x squared. So you get square root of x cubed plus one times x squared. And now you have to integrate the result, which is very easy because you can introduce a new variable z, which is x, which is x cubed, right? And then dz is three x squared dx, so that this becomes one third of dz. And this becomes one third of z plus one dz, right? Which is very easy. I'm just trying to save time because I only have two minutes left. So this is easy, but don't do that on your meter. I have an excuse because I don't have enough time to fit and I want to explain something to you. So here is a tricky question, which you'll find on the homework. The tricky question is the following. Let's think of the same region, let's think of the same region, but from a different point of view, let's cut it by horizontal lines. If we cut by horizontal line, then the same region would be x, y, where now y is between zero and one and x is between what? It is between the square root of, it is between the square root of, so this y over, that's right, between square root of y, right? Right, and one, you see? If I do that, then the same integral will be written like this. So now this would be the outer integral would be respect to y. It's always the case, the variable which is between, for which the limits are independent of any variables, which are constant, like zero and one, this is the variable which is the outer variable, outer integration, variable of outer integration. And the inner integration will be from square root of y to one, right? And then with the function will be x, q plus one, same function. But now we have to integrate this with respect to x. And you see, this is much harder, right? This is hard, because it's not clear what the antiderivative is of this. See how much, now you can appreciate how much easier it is to calculate the antiderivative of this function with respect to y, because y doesn't know about x, right? So this is a constant. So you are doing the antiderivative of a constant function. That's why you get this very simple function, and then you luck out that you get x squared so it becomes much easier. But here you get a function of x, and it's not clear what the antiderivative is. You see, so you have to be aware of this, that there are two different ways to compute, and one way could be much easier than the other.