AI Assistant
Transcript
00:02:770Paolo Guiotto: Good morning.
00:10:580Paolo Guiotto: Nope.
00:11:850Paolo Guiotto: The topic of today is… constrained.
00:24:240Paolo Guiotto: Optimization.
00:33:770Paolo Guiotto: So basically, the problem is always the same, huh?
00:37:730Paolo Guiotto: So we consider…
00:47:960Paolo Guiotto: And optimization problem.
00:51:620Paolo Guiotto: That is, searching for minimum or maximum of a function f of…
00:59:240Paolo Guiotto: vector X, where X is in some domain D, and D is the domain of RD.
01:08:910Paolo Guiotto: But… We have seen that we already met these, circumstances.
01:15:490Paolo Guiotto: Well, we have to find minimum, maximum, on points which are not in the interior of the domain.
01:23:700Paolo Guiotto: So in that case, the condition gradient F equals 0 Does not tell anything about…
01:30:590Paolo Guiotto: is not of any advert to… for the search of point. So, when… When sake.
01:41:740Paolo Guiotto: The… Extrema.
01:48:740Paolo Guiotto: Not in the main, in the interior of D.
01:58:220Paolo Guiotto: the condition gradient F equals 0.
02:04:00Paolo Guiotto: Is basically useless.
02:10:449Paolo Guiotto: So, the problem is, we… when we met this kind of circumstances, we proceed by hand to remind this, no? Now, we want to find a sort of general method
02:23:60Paolo Guiotto: Because of several reasons. And at the same time, we want to consider a problem
02:33:260Paolo Guiotto: where the domain is described in a certain way for which there are actually no interior points. So, let's start with a problem.
02:44:40Paolo Guiotto: It's a simple, problem that we can…
02:47:540Paolo Guiotto: Easily solved, even without any use of differential calculus.
02:52:560Paolo Guiotto: That is the following. Among, all rectangles.
03:05:480Paolo Guiotto: Weed, fixed.
03:11:310Paolo Guiotto: Perimeto.
03:17:460Paolo Guiotto: determine
03:21:950Paolo Guiotto: That, or doza, that's one.
03:26:270Paolo Guiotto: with the… Maximum.
03:32:320Paolo Guiotto: area.
03:34:330Paolo Guiotto: This is what is called an isoparimetric
03:44:520Paolo Guiotto: problem.
03:46:910Paolo Guiotto: So, you look for the optimal, in this case, plain figure with fixed perimeter. Optimal in the sense that here, we want to maximize the area.
03:56:910Paolo Guiotto: This is a very elementary problem that actually, as I told you, does not require any use of differential calculus, because the problem is the following. We have a rectangle.
04:08:850Paolo Guiotto: let's call X and Y to,
04:13:890Paolo Guiotto: The two sides of the rectangle.
04:16:450Paolo Guiotto: So, what we have to find is the optimal rectangular.
04:22:360Paolo Guiotto: with maximum area and fixed perimeter. What does it mean? That perimeter P is equal to the sum of the sides, so it is 2X plus 2Y.
04:35:490Paolo Guiotto: And this quantity is, let's say, a data, it's node.
04:43:790Paolo Guiotto: So we assume that P is 1, P is 55, also.
04:48:970Paolo Guiotto: So, we have to find the area. The area is X times Y, so our problem can be formalized as
04:58:940Paolo Guiotto: finding for the maximum of X times Y,
05:02:950Paolo Guiotto: of pairs XY, such that they must be positive to be sides, and they must verify this condition. 2X plus Y must be equal to the constant P.
05:18:700Paolo Guiotto: So if you want, this problem is a problem where we have to find a maximum
05:24:860Paolo Guiotto: for a function f of the two variables.
05:28:360Paolo Guiotto: Only domain of points XY that verify an equation.
05:32:660Paolo Guiotto: So, an equation like GXY equal to zero.
05:38:20Paolo Guiotto: Now, the particular nature of this domain is that there are no interior points in general. You can see in the example, because in the example, our domain is in plane XY,
05:50:650Paolo Guiotto: is made of points for which 2X plus Y is P. So, you can say also X plus Y is P divided 2, so Y is P divided 2 minus X. So these points belongs to a straight line, which is about this one.
06:10:120Paolo Guiotto: 45 degree negative slope, and since we consider only X positive and Y positive, it is actually this
06:20:180Paolo Guiotto: portion of straight line. So this is our domain we have here.
06:26:50Paolo Guiotto: So, as you can see, there is no interior point here, because you take any point on this domain, and you take a little ball around that point, you see that it is never contained in the domain.
06:37:320Paolo Guiotto: So… In this case, interior of D is simply empty.
06:45:590Paolo Guiotto: So, this means that, if I say, even if I say, suppose that I have domain D is closing amount, the function is continuous, so I'm sure that there is minimum, there is maximum for this function. This comes from Beister's theorem.
06:59:500Paolo Guiotto: Okay, now once I know that if we want to make this closed, I just add an greater than equal, so I consider also the case when
07:09:420Paolo Guiotto: one of the two sides is zero, the other cannot be zero because of the perimeter constraint. So let's say that now our domain is closed and bounded, so compactor.
07:19:920Paolo Guiotto: the minimum, the maximum exists, we are interested in maximum, in particular, but I cannot say, so if XY is a minimum po… is the maximum point, then
07:31:340Paolo Guiotto: either gradient of F is 0, or the point belongs to the boundary, because in this case, the boundary of D is D, so there is not the first case. So condition gradient F equals 0 is irrelevant here.
07:48:20Paolo Guiotto: And in fact, for this case, for example, in our case, FXY is the function X times Y.
07:58:20Paolo Guiotto: And in particular, if you look at the gradient, you would get derivative with respect to X is Y, derivative with respect to Y is X. So the gradient is 0, so you have a stationary point if and only if both X and Y are 0.
08:12:410Paolo Guiotto: So it's the point XY is the point 0, 0. So the unique stationary point is here, it's not even in the domain.
08:22:160Paolo Guiotto: So…
08:23:250Paolo Guiotto: This, however, does not mean that there is no minimum, no maximum, because we know they exist, you know?
08:28:960Paolo Guiotto: And so, how can we determine this? So, we can say that, in this case, we could do by hands, no? Let's see what does it mean doing by hands here.
08:39:140Paolo Guiotto: So, in this case, I have to determine the maximum of X times Y over the XY positive.
08:48:890Paolo Guiotto: Such that X plus Y is equal to P half.
08:54:240Paolo Guiotto: Now, doing by hand here means that, if you mind, we tried to reduce this problem to a one variable problem. How? Since we know that there is this constraint, we could say that, for example, Y is P half minus X.
09:12:100Paolo Guiotto: and we plug this into the function. So, we actually are maximizing this. X times Y, which is P half minus X,
09:23:610Paolo Guiotto: Now, this is a maximization only in X. Where is X? X must be positive. This comes from this part of the condition, you see. X and Y both positive.
09:37:860Paolo Guiotto: And I have also a second condition, because Y positive here means that this quantity, P half minus X, must be positive, but P half minus X is positive if and only if x is less than P half.
09:52:730Paolo Guiotto: So, the second condition I get is this one.
09:56:630Paolo Guiotto: No? So let's say that this less or equal comes from this side here.
10:02:910Paolo Guiotto: So, my new problem is a one-variable problem that can be solved, and as I said, we don't actually need the differential calculus. If you want, we can just write the maximum. For this case, X is between 0 and P over 2.
10:21:730Paolo Guiotto: So this is minus X squared, plus, P half X.
10:29:320Paolo Guiotto: So, I can see this, as, a square, basically. This is, minus, what is, the double product is, 2 divided 4 here, X,
10:42:480Paolo Guiotto: minus P half square. If I do the square of this, I get minus X squared.
10:49:900Paolo Guiotto: Then I have the double product, which is minus.
10:52:940Paolo Guiotto: 2 times, no, sorry, P over 4 here, 2 times P over 4x, that is P half X, plus, because there is the minus in front of
11:05:170Paolo Guiotto: the square, and then I have another plus P over 4 square with minus, so I have to, I have to add this P over 4 square.
11:19:210Paolo Guiotto: So that function is equivalent to this one, so I am searching for maximum on X between 0 and P over 2 of this quantity, P over 4 square minus
11:35:740Paolo Guiotto: X minus P over 4 square.
11:40:180Paolo Guiotto: Now, you can see that this quantity is maximum when this quantity is minimum, because of the minus. You see?
11:48:810Paolo Guiotto: And when this quantity is minimal, since X is between 0 and p half, P over 4 is exactly at middle of this interval, so… and this vanish this quantity.
11:59:440Paolo Guiotto: So this quantity is maximum only when that quantity is 0, so when x is P over 4. And, so I get that the maximum point is X equals P over 4.
12:13:180Paolo Guiotto: So, I sold. If you do not trust me, you can just do the differential calculus method. So, call this function… well, I don't want to use phi, because
12:25:20Paolo Guiotto: It's going to be used later, so let's give another name, H…
12:29:400Paolo Guiotto: of X. So, you take an alternative.
12:33:630Paolo Guiotto: You take your H of X equal minus X… what is it? No, X times P half minus X, which is, by the way, a parabola that has zeros at 0 and P over 2.
12:50:900Paolo Guiotto: With negative second-degree coefficients, so the concavity is made like that.
12:57:820Paolo Guiotto: So we are on the interval for x between 0 and P over 2, so that you see the maximum will be somewhere.
13:05:640Paolo Guiotto: You can understand that it is in the middle because of symmetry, but however, when you compute the derivative, you get H prime equal P over 2 minus 2X, so greater or equal than 0 if and only if x is less or equal than
13:21:640Paolo Guiotto: P over 4.
13:23:500Paolo Guiotto: So this means that the function is increasing here, decreasing here, and this point, P over 4, is the maximum point. So we get the same answer, of course.
13:34:860Paolo Guiotto: So, X equals P over 4 is the maximum point for this function h. Going back to the function f, which is this one.
13:47:810Paolo Guiotto: So we have to consider a point XY. The Y is, P half minus X, so, D…
13:56:740Paolo Guiotto: maximum point for… F, X, Y.
14:03:420Paolo Guiotto: equal X times Y on The domain X plus Y equals P half.
14:11:590Paolo Guiotto: is the point with DX equals P over 4, and the y equal p half minus X minus P over 4.
14:24:310Paolo Guiotto: which is P over 4, B over 4.
14:28:610Paolo Guiotto: So this is, this says that the maximum area is obtained when the rectangle has
14:36:280Paolo Guiotto: the two sides, equal, both equal to P on F4, so in particular, it is a square.
14:42:500Paolo Guiotto: with the, side, the perimeter divided by 4, okay?
14:49:330Paolo Guiotto: Okay, so… This is how we would solve this problem.
14:55:830Paolo Guiotto: Of course, you see, this problem is particularly easy.
15:02:300Paolo Guiotto: It's so easy that we don't even need to use differential calculus, but let's say differential calculus is a powerful need to solve
15:10:790Paolo Guiotto: a problem like this. Now, what is the idea we can learn from this?
15:17:190Paolo Guiotto: Now, let's look at these… General structure, okay?
15:22:890Paolo Guiotto: So, what is… The… It's cute.
15:33:360Paolo Guiotto: idea.
15:38:230Paolo Guiotto: So we have to determine minimum or maximum of a function f of xy.
15:46:640Paolo Guiotto: on a domain which is defined by an equation. So, something like GXY Equal to zero.
15:56:130Paolo Guiotto: So what we did here is…
15:59:880Paolo Guiotto: We tried to reduce this problem into a problem of finding for the… searching for the minimum, maximum of a function of one variable.
16:09:650Paolo Guiotto: How we did that? We used the equation to solve the equation in one of the variables as a function of the other.
16:17:790Paolo Guiotto: So what we did is, suppose that we can say that the point XY solves this equation if and only if Y is a certain function of X,
16:29:870Paolo Guiotto: And since there is no privilege for X with respect to Y, this could be also a X function of Y, maybe with another letter.
16:42:300Paolo Guiotto: So let's say that we can explicit from the equation GXY equals 0, one of the two variables as a function of the other.
16:51:670Paolo Guiotto: So this would mean that we are, looking for minimum-maximum of F evaluated at point XY, but the Y is, for example, phi of X. So this is now an optimization in X.
17:07:290Paolo Guiotto: That we could solve.
17:09:450Paolo Guiotto: Okay.
17:11:440Paolo Guiotto: Now, we could stop here and say, okay, if you are able to do this, you can, you can proceed in this way.
17:19:130Paolo Guiotto: But the problem is that, in general.
17:22:160Paolo Guiotto: Solving equations is a very limited task.
17:26:829Paolo Guiotto: you can solve just a few number of equations. So, if I write something like, determine the minimum or the maximum of a certain function, FXY, it doesn't matter here what is the function, but let's focus on the domain. And I say X power 4 plus XY
17:46:280Paolo Guiotto: plus, sine x e to y equals 0. Do you know how to solve this equation?
17:53:890Paolo Guiotto: Do you know, do you see how to express Y as a function of X, or X as a function of Y?
18:02:680Paolo Guiotto: So, the problem here is that this method
18:06:460Paolo Guiotto: is based on a very limited possibilities that we have in solving equations. So it is not a general method. If we are able to do, yes, we can do. But if we are not able to do.
18:20:420Paolo Guiotto: What happens?
18:22:300Paolo Guiotto: How can we, how can we proceed?
18:25:620Paolo Guiotto: Now, I want to show you that.
18:28:970Paolo Guiotto: Assuming for a moment that we can do this operation, so rewriting the equation under the form y equals C of X,
18:37:800Paolo Guiotto: We will determine a condition that must be verified at minimum max points, that at the end, it won't depend on this function phi.
18:48:810Paolo Guiotto: So, at the end, it will become an implicit condition that does not depend on our ability of searching for this Y equals phi of X or X equals phi of Y. Okay, let's see how it works. So,
19:05:430Paolo Guiotto: Let's assume, huh?
19:11:810Paolo Guiotto: For a moment.
19:17:520Paolo Guiotto: That's… The equation G, X, Y,
19:22:680Paolo Guiotto: equals 0 can be, let's say, solved in the form that you can express y as function of X.
19:31:910Paolo Guiotto: Okay? I say that this won't be possible, in general, but let's say that this is possible.
19:39:980Paolo Guiotto: So, we say that the mean-max, of F, XY,
19:48:380Paolo Guiotto: when GXY is equal to zero, reduces to the min-max, mean max.
19:57:80Paolo Guiotto: of this function, which is a function of one single variable, because we said Y is T of X.
20:05:810Paolo Guiotto: And this is a minimum maximum of X.
20:09:810Paolo Guiotto: Now, if this function here, let's give a name. This is the function we call the H of X.
20:18:130Paolo Guiotto: If this function has a minimum or a maximum, at some point X, here this is the numerical function, its derivative at that point will be equal to 0.
20:29:190Paolo Guiotto: Okay? So… If… X stop.
20:36:720Paolo Guiotto: Is a minimum, or a maximum.
20:43:830Paolo Guiotto: function H, This is a real number, okay?
20:49:340Paolo Guiotto: Then the derivative of H at point X star will be equal to 0.
20:57:970Paolo Guiotto: Now, let's try to calculate this derivative.
21:02:420Paolo Guiotto: How is the derivative of a function of this type?
21:06:790Paolo Guiotto: So the derivative of H with respect to X It's just the ordinary derivative.
21:15:690Paolo Guiotto: with respect to X, I use this notation to say this is the classical derivative, one variable derivative of this function f of x ph.
21:27:520Paolo Guiotto: Now, the point is, how do we compute this derivative?
21:31:310Paolo Guiotto: Because F is a function of two variables. So, as you can see, this seems to be like a composition, because there is few of X.
21:41:760Paolo Guiotto: But actually, X depends on in two places from X. So, if I, for a second, cancel this.
21:49:760Paolo Guiotto: And they look only at,
21:52:450Paolo Guiotto: what I see as something, I would say that computing the data with respect to X is doing what?
22:02:540Paolo Guiotto: taking the partial derivative, exactly, you know? So, I would say that
22:06:910Paolo Guiotto: This is the partial derivative with respect to X of FXPX.
22:16:170Paolo Guiotto: But now, do the yonder, say.
22:19:980Paolo Guiotto: Johnson. Imagine that you looked only at least.
22:23:370Paolo Guiotto: You now see that, forgot this, so imagine that it's fixed.
22:27:700Paolo Guiotto: You look at this is functional
22:29:820Paolo Guiotto: Of the second variable, but it is not the…
22:32:510Paolo Guiotto: The second one is a function of X, so this seems to be a chain, no? F of phi of X. So, to compute the derivative of this, you would say, let's differentiate F, evaluating phi of X, times the derivative of the argument.
22:47:690Paolo Guiotto: Reminded chain ruler, no?
22:50:280Paolo Guiotto: So if you have something like derivative with respect to X, I don't want to use these letters, well, let's say F of phi of X. How would you compute this if f is a function of one single value? You would say it is F prime of phi of X
23:07:280Paolo Guiotto: times phi prime of X, right?
23:10:790Paolo Guiotto: Now, since the phi of X is in the second variable, differentiating F with respect to this variable means computing the derivative of F with respect to Y,
23:22:850Paolo Guiotto: At X phi of X, and I'm multiplying by phi prime of X.
23:27:370Paolo Guiotto: Now, we have these two quantities that comes as if we consider that function function of just one of these two variables.
23:36:860Paolo Guiotto: What if I consider together? Well, it turns out that the correct is the sum of these two quantities.
23:44:540Paolo Guiotto: I will return on this later. This is a consequence of the chain rule that works exactly in the same manner that you have here for one variable.
23:54:640Paolo Guiotto: It's a bit more complicated because it's made… there is a product of Jacobian Metis, however, we will return on this. Let's accept for a moment. Okay, so, imposing H prime at point X star…
24:10:370Paolo Guiotto: equal to zero.
24:12:170Paolo Guiotto: we obtain this condition, DX. Well, let's write in red.
24:18:790Paolo Guiotto: VX. F.
24:20:900Paolo Guiotto: at point X star, P, X star.
24:26:990Paolo Guiotto: plus DUI, F.
24:30:360Paolo Guiotto: at point X star P.
24:33:290Paolo Guiotto: X star.
24:35:750Paolo Guiotto: Times phi prime.
24:37:770Paolo Guiotto: of X star, this thing is equal to 0. We got this condition.
24:44:830Paolo Guiotto: Now, this condition is still a bit obscure, because we don't know what is this function ph, okay?
24:52:870Paolo Guiotto: However, what we can say is that, for example, phi of X star is what?
25:00:220Paolo Guiotto: is the point that corresponds to X in the constraint, huh? Because we said, when we put the X star here, let's just copy. Y star
25:12:500Paolo Guiotto: equal phi of X star is exactly the point where G of X star YSTAR,
25:21:480Paolo Guiotto: is 0. So we may say that this quantity is the ordinate of the point that corresponds to the abscessa X star.
25:31:580Paolo Guiotto: So, this is, say, the point Y star, which is the point, I repeat, on the domain, the domain is G of XY equals 0, whose abscess is X star.
25:45:220Paolo Guiotto: Now, the unique quantity that we have to determine here is this one.
25:52:780Paolo Guiotto: What is the derivative of this function, a known function, phi, at point x star? And how can we determine that?
26:00:960Paolo Guiotto: Well, we can determine by noticing that Since,
26:06:450Paolo Guiotto: Y is phi of X?
26:10:140Paolo Guiotto: If, and only if, G of XY, so G of X phi of X is 0.
26:18:750Paolo Guiotto: What we know about this function phi, is that it verifies this identity.
26:23:80Paolo Guiotto: for every X.
26:25:550Paolo Guiotto: So since it is a function, at the left, you have a function of x constantly equal to 0, by taking its derivative with respect to X, we will have something equal 0, no? The derivative of 0 is 0. So we have that derivative with respect to X,
26:42:260Paolo Guiotto: of this quantity, G of X, phi of X,
26:48:140Paolo Guiotto: This is constantly equal to zero.
26:51:830Paolo Guiotto: Now, this is the same type of quantity we computed above with F, you see? It's exactly the same, but when now we have G. So, we proceed in the same way. This derivative is the derivative with respect to X of G, evaluated at X PX.
27:10:520Paolo Guiotto: plus the derivative with respect to Y of G, evaluated at X PX times phi prime of
27:20:70Paolo Guiotto: Y, of X, sorry.
27:25:840Paolo Guiotto: This… and since this must be identical equal to zero, this is equal to 0.
27:31:460Paolo Guiotto: In particular, when we plug X star into this, we get this second condition. So DXG at point X star, remind that X star
27:44:240Paolo Guiotto: is the abscessa of point where we have the minimum or the maximum. Y star is the ordinate, so the point X star, Y star, is the minimum maximum point.
27:54:570Paolo Guiotto: plus DYGX star.
27:59:90Paolo Guiotto: Y star times P prime.
28:02:600Paolo Guiotto: of X star, this must be equal to 0.
28:07:540Paolo Guiotto: Now, the conclusion will come combining this second condition with the first one, that for convenience, I copy down here. So we add the same equation, but with F, basically. So DXF…
28:23:20Paolo Guiotto: X star. Y star?
28:26:200Paolo Guiotto: plus DYF.
28:28:970Paolo Guiotto: X star. Why star?
28:31:760Paolo Guiotto: times P prime, X star equals 0. Now, we use the first equation we have here to extract ph', and we plug into the second.
28:43:470Paolo Guiotto: If you do this, you will see that there won't be anymore any fee here.
28:50:440Paolo Guiotto: To do this, to extract phi prime.
28:54:450Paolo Guiotto: what we do. You see that phi prime is multiplied by that DYG at point X star, Y star. So what I want to do is carry the DX on the other side and divide by the YG.
29:07:390Paolo Guiotto: So I need that this be different from zero. So, let's write. If…
29:13:370Paolo Guiotto: The DYG at point X star.
29:17:720Paolo Guiotto: Y star is different from zero.
29:22:140Paolo Guiotto: I have that phi prime at point X star is equal to minus DXG at point X star. Y star?
29:34:220Paolo Guiotto: divided by DYG at point X star, Y star.
29:41:650Paolo Guiotto: And now I plugged this into this formula, Saul.
29:46:720Paolo Guiotto: Let's call them 1 and 2.
29:50:340Paolo Guiotto: So, from 1, I get this.
29:53:780Paolo Guiotto: plugging it.
29:59:360Paolo Guiotto: this.
30:01:690Paolo Guiotto: In… 2… we got… So, let's, see, since everything is now
30:12:110Paolo Guiotto: function of X star Y star. Let's forget this for a moment. So I just write the derivatives. So you see, it's written there. So I get DXF. I do not write evaluated point X star Y star. We will return later on this, we will write…
30:29:280Paolo Guiotto: betas, then we have DYF times that derivative, which is minus DXG over DYG. This equals 0.
30:41:790Paolo Guiotto: Now, let's put back in line this equation.
30:45:430Paolo Guiotto: And we get DXF.
30:48:840Paolo Guiotto: DYG, I'm multiplying by DYG.
30:54:670Paolo Guiotto: both sides. This is minus DYF.
30:59:850Paolo Guiotto: DXG equals 0.
31:03:750Paolo Guiotto: So we get this condition.
31:06:210Paolo Guiotto: Now, we reinterpret this condition.
31:09:880Paolo Guiotto: This condition can be seen as a scalar product between two vectors.
31:14:510Paolo Guiotto: Which are the vectors? One vector is the vector made by DX, F, and DYF, so this is the gradient of F.
31:24:140Paolo Guiotto: Scala product, be careful, because the second one is not the gradient of G, because the second one is DYG,
31:31:700Paolo Guiotto: minus DXG. This must be equal to 0.
31:37:640Paolo Guiotto: Okay, now these are two plane vectors, okay? So we are in plane, R2,
31:44:950Paolo Guiotto: And we have two vectors. One is the gradient of F, let's say that this is the gradient of F.
31:52:430Paolo Guiotto: And the other one is not the gradient of G, it's this vector.
31:56:20Paolo Guiotto: Okay, let's call it for a moment V.
31:59:290Paolo Guiotto: What this condition says, Scala product equals zero means…
32:07:920Paolo Guiotto: They are orthonal, exactly. So let's say that V is this one. So this is saying that gradient of F is perpendicular to vector V.
32:19:830Paolo Guiotto: But then this is remarkable in the plane. If you are perpendicular to the Then, you must be…
32:28:160Paolo Guiotto: Parallel to what?
32:31:160Paolo Guiotto: So there are only two directions in orthogonal direction in plane, no? So if I am perpendicular to that vector, if I compute the D, say, I am on a line.
32:46:110Paolo Guiotto: This red line, which is made by doing what? Look at this vector. Do you know how to build a perpendicular vector to that one?
32:57:450Paolo Guiotto: You know how to do to… if you have a vector, how to build a perpendicular vector to this given vector?
33:06:780Paolo Guiotto: You must flip the two coordinates and change one sign.
33:12:80Paolo Guiotto: So, for example, if I take the vector where I flip the order, which is this one, minus DXGDYFG, and I change a sign, for example, this one, now this vector here, which is, by the way, the gradient of G,
33:31:750Paolo Guiotto: is perpendicular to the vector of V.
33:35:670Paolo Guiotto: If you do the scalar problem, you see DYG times DXG minus DXG times DYG, you get zero. So these two are perpendicular.
33:45:820Paolo Guiotto: And moreover, since we know that at least one of the components of this vector is different from zero, this one is different from zero.
33:58:980Paolo Guiotto: Because we assumed that this vector is non-zero, okay? Cannot be zero, otherwise the two components should be equal to zero.
34:08:239Paolo Guiotto: So it means that since gradient F is perpendicular to V, in this case, because we are in the plane, gradient F must necessarily be parallel to this vector gradient G.
34:25:150Paolo Guiotto: There is no other possibility.
34:28:70Paolo Guiotto: Because there are only two perpendicular directions in the Cartesian plane.
34:32:500Paolo Guiotto: And this means that parallel means that they are proportional, so that means that there is the coefficient lambda, real.
34:43:520Paolo Guiotto: such that the gradient of F is lambda times the gradient of G.
34:50:909Paolo Guiotto: So what we discovered here, this is not a 100% correct proof, so that's why I've not written proof, but this…
34:59:430Paolo Guiotto: working a little bit could be made a correct proof. What we discovered is the famous Lagrange multiplier theorem.
35:14:780Paolo Guiotto: So let's try to… actually, there will be several versions of this, but let's say this is the first version.
35:22:880Paolo Guiotto: So, let's try to write properly, assumptions. So, let's see these main steps of the argument.
35:33:420Paolo Guiotto: It says that if we have a minimum-maximum point.
35:38:720Paolo Guiotto: And the dy of G, G is the constraint, so the function that defines the main is different from 0 at that point.
35:49:320Paolo Guiotto: Then, conclusion, the gradient of F must be proportional to the gradient of G, okay? So this is the philosophy. Let's write down this. So let…
36:00:400Paolo Guiotto: Well, we need some technicalities, so let F and G be differentiable.
36:09:450Paolo Guiotto: functions.
36:18:330Paolo Guiotto: let's say…
36:22:580Paolo Guiotto: Okay false.
36:25:910Paolo Guiotto: So… what we proved is that if X star Why start?
36:33:500Paolo Guiotto: Is a minimum, or a maximum, point.
36:40:630Paolo Guiotto: 4.
36:42:180Paolo Guiotto: F on the set where… is the set is the set where GXY is equal to 0.
36:51:750Paolo Guiotto: This is the domain, huh?
36:55:130Paolo Guiotto: And… the derivative Respect to Y of G, at that point, Is different from zero.
37:08:740Paolo Guiotto: Then…
37:12:40Paolo Guiotto: The gradient of F is proportional to the gradient of G, so then there exists a coefficient lambda such that the gradient of F at point X star Y star
37:24:270Paolo Guiotto: is, proportional lambda times the gradient of G at that point.
37:30:730Paolo Guiotto: X star, Y star.
37:34:620Paolo Guiotto: So this is what, basically, we informally proved.
37:39:950Paolo Guiotto: Now, if you look at this, what is the spirit of this, it is particularly similar to the
37:49:180Paolo Guiotto: What is it?
37:53:990Paolo Guiotto: Yeah, to the Fermat theorem. What this theorem says.
37:58:590Paolo Guiotto: If you have a minimum or a maximum point.
38:02:120Paolo Guiotto: for a function, which is, in this case, in the interior of D, which is not the case for our setup, because the set D is the set where GXY is 0, and in general, this set has no interior points. But in this case, it says, then gradient F is 0.
38:20:910Paolo Guiotto: This is saying, basically, the same thing, but when the domain D has 9 tier points, because if X star Y star is the minimum maximum point for F on that domain.
38:34:00Paolo Guiotto: And there are no interior points for such domain. With this additional condition, the YG at that point is different from zero, then gradient of F, you see is non-zero in general, but it is proportional to the gradient of G.
38:50:40Paolo Guiotto: So now we have the key, no, because we knew that the gradient of F is not necessarily zero.
38:56:970Paolo Guiotto: Is there any condition that this gradient must verify at these min-max points when they are not in the integer? This is the condition. It must be proportional to the gradient of the constraint. This is the message.
39:11:240Paolo Guiotto: Now, what we, before we use, let's still do some remark. We will now work a bit on this statement to carry the statement in a,
39:24:700Paolo Guiotto: In a better shape, in order that we use in a standard way, no?
39:30:250Paolo Guiotto: Now, this argument is based, if you go back to the beginning, on the fact that we said, suppose that we can represent solutions of the equation GXY equals 0 in the form Y function of X, so we can
39:47:410Paolo Guiotto: Explicit Y as a function of X from the equation.
39:51:460Paolo Guiotto: Since there is no heresy between X and Y, we could do the other way, no? X function of Y. Why not? Okay, so what happens if I…
40:02:370Paolo Guiotto: Fleetbacks and wives.
40:03:860Paolo Guiotto: Nothing, because the same argument can be repeated. Of course, you will have all formula changed, because now you have the function is function of Y, and not function of X. But let's say that the key condition, this one, flipping x with y, will mean that the derivative with respect to X
40:23:80Paolo Guiotto: of G at point x star west must be different from 0. If this happens, well, at the end, you get the same conclusion, because the conclusion gradient F proportional to gradient G is independent of the order of the two variables. So we have
40:39:420Paolo Guiotto: Also, if… D, DX…
40:45:140Paolo Guiotto: of G at point X star, Y star, is different from zero. So suppose that the DYG was zero, but if the DXG is different from 0, you can have the same conclusion.
40:59:550Paolo Guiotto: the same conclusion.
41:04:450Paolo Guiotto: Conclusion.
41:06:590Paolo Guiotto: phones.
41:08:530Paolo Guiotto: So, still, there exists a lambda.
41:12:180Paolo Guiotto: such that gradient F at min-max point is proportional to gradient G.
41:22:250Paolo Guiotto: Now, we can unify these two cases into a unique one.
41:26:980Paolo Guiotto: Because basically, if you put together, they say, if one of these two conditions is verified, at least one
41:36:300Paolo Guiotto: then you can say that at minimax point, the gradient of F must be proportional to the gradient of G.
41:42:420Paolo Guiotto: So, one of these two quantities, different from zero, means what? These two are the components of the gradient of G.
41:50:910Paolo Guiotto: So if one of them is different from zero, this means that the vector gradient is not the vector zero.
41:57:590Paolo Guiotto: So, the unified version is… So, unifying…
42:06:760Paolo Guiotto: these… Zoo?
42:10:640Paolo Guiotto: statements.
42:15:940Paolo Guiotto: We get a unique one.
42:19:950Paolo Guiotto: So, if the gradient of G, G is the constraint, I repeat, the constraint is the function that defines the domain at a mean-max point.
42:32:160Paolo Guiotto: is not zero.
42:36:130Paolo Guiotto: Then, the same conclusion holds. So, this means, then.
42:41:180Paolo Guiotto: the gradient of F at min-max point won't be necessarily zero, but will be proportional to the gradient of the constant.
42:52:860Paolo Guiotto: at that point.
42:56:150Paolo Guiotto: Now, under this form, the theorem is not yet fully satisfactory, because this says, if you already know that there is a minimum-maximum point, then this we accept, because exactly as in the Fermat theorem case, where is it?
43:13:420Paolo Guiotto: the Ferma theorem says if X max or X min is the minimum point, then this happens. But you must know that this point already exists.
43:23:230Paolo Guiotto: The Fermat theorem does not determine, does not show existence of minimum-maximum. It says something that should be verified by minimum-maximum point once you know they exist.
43:34:270Paolo Guiotto: So, you know, in this case, the use of tools ensuring existence is more important than what you do in one variable calculus. You never use the Weissler's theorem. Here, you are going to use a lot, because these are
43:49:50Paolo Guiotto: Weaker tools respect to tools you have in one variable calculus.
43:54:300Paolo Guiotto: Okay, so this says, if you already know that the minimum point exists, and this is not a big issue, the big issue with this statement is that
44:05:940Paolo Guiotto: And, moreover, you know that the gradient of the constraint at that point is different from zero, then you know that this is the condition that point must verify.
44:16:890Paolo Guiotto: Now, how do I check that gradient of G at minimum maximum point is different from 0 if I don't know who is the minimum maximum point? That's the positive.
44:26:630Paolo Guiotto: So now, we introduce a definition.
44:30:900Paolo Guiotto: That override this check, basically.
44:33:970Paolo Guiotto: So, given a function, given a function G, function G of XY.
44:43:840Paolo Guiotto: defined on domain D of R2, into R.
44:50:830Paolo Guiotto: we say… that.
44:56:800Paolo Guiotto: G.
44:58:980Paolo Guiotto: is a submersion
45:07:190Paolo Guiotto: if the gradient of G is different from 0 for every point X, Y, in the… Okay.
45:19:560Paolo Guiotto: Sorry, if the gradient is never zero on Z.
45:24:290Paolo Guiotto: So, in particular, if G is a submersion, we have that this condition is always verified wherever this point is.
45:34:120Paolo Guiotto: So we can say that if you know that G is a submersion, you know that the gradient is always different from zero, that condition is automatically verified, and therefore, the unit condition that remains is this last one.
45:46:870Paolo Guiotto: At minimum, maximum point, gradient F must be proportional to gradient G. And this is the final version of the
45:53:910Paolo Guiotto: Lagrange Theorem. So forget the previous versions, because they are, say, partial form of this statement, so this is
46:04:280Paolo Guiotto: Really, what you have to… remind us Lagrange Theorem.
46:09:440Paolo Guiotto: So, let F and G be defined on some domain V of R2.
46:16:830Paolo Guiotto: With values in R.
46:20:270Paolo Guiotto: B… differentiable.
46:25:260Paolo Guiotto: functions.
46:28:480Paolo Guiotto: With… G… a submersion.
46:38:810Paolo Guiotto: on D.
46:41:90Paolo Guiotto: So, with G, the constraint, which verifies this condition, the gradient is never zero on D.
46:47:830Paolo Guiotto: So, automatically, whatever is the minimum maximum point at star, west star, that condition will be 35.
46:55:800Paolo Guiotto: So… If X star… Why start?
47:04:400Paolo Guiotto: Ease.
47:05:490Paolo Guiotto: A minimum, or a maximum, point.
47:11:170Paolo Guiotto: 4F.
47:12:910Paolo Guiotto: on the domain where GXY is equal to 0, so on the domain which is the set defined by this equation.
47:22:900Paolo Guiotto: Then… There exists a coefficient lambda, such that the gradient of F at that point, X star, Y star.
47:32:320Paolo Guiotto: is proportional to the gradient of the constraint at this… the same point, X tie was that.
47:40:760Paolo Guiotto: Okay? So this is going to be exactly the analogous of Fermat theorem.
47:47:180Paolo Guiotto: The Fermat theorem applies to points, minimum, maximum points, which are in the interior of a certain domain. In that case, the condition is gradient f equals 0.
47:57:650Paolo Guiotto: This theorem applies to points which are not in interior of this particular domain, which have not interior points. So there are no interior points for these kind of domains.
48:08:880Paolo Guiotto: So the condition gradient F equals 0 is not of any help in searching for minimum-maximum points.
48:16:150Paolo Guiotto: So what is the condition gradient F must apply? If we know that G is a sommation, so gradient of G is always different from 0, then we have that this property holds. Gradient of F must be proportional to gradient of G.
48:33:250Paolo Guiotto: Okay, so, you want to take a break?
48:37:540Paolo Guiotto: Okay, let's take it back, and then we see how to use this tool.
48:46:610Paolo Guiotto: once.
48:53:180Paolo Guiotto: Okay, before we, restart, I, I say the,
48:59:140Paolo Guiotto: something a little bit… well, it is correct, as I wrote, but it is not necess… it is not needed that GBS submersion on the tier domain D
49:10:770Paolo Guiotto: It is enough that we, as I mentioned, on the domain where we have to find the minimum maximum. So, on the set, please modify this, on the set where GXY is equal to 0, which is the domain of our interest. It is there where we need that condition.
49:31:460Paolo Guiotto: Okay, now, this seems to be complicated, as we will see.
49:37:230Paolo Guiotto: It is not, particularly complex. The application of this is…
49:41:980Paolo Guiotto: pretty straightforward, with a little bit of tricks that we will see now. What I want to do here first is the example of reworking the same problem we solved at the beginning, so the isopramatic problem.
50:01:910Paolo Guiotto: But doing… applying the Lagrangian theorem. Let's see what… what happens, okay? So…
50:11:560Paolo Guiotto: Let's solve.
50:17:50Paolo Guiotto: sold the… the… Initial.
50:24:730Paolo Guiotto: ISO.
50:26:240Paolo Guiotto: Parametric.
50:31:00Paolo Guiotto: problem.
50:32:650Paolo Guiotto: with the… this… Yup.
50:39:460Paolo Guiotto: So…
50:42:00Paolo Guiotto: Okay, so we forget that, of course, we can solve by hand. So the problem is searching for maximum of X times Y on the set where XY are both positive, and X plus Y is equal to P divided 2. That's… that's the…
51:01:370Paolo Guiotto: Condition on the perimeter.
51:03:160Paolo Guiotto: So, in this problem, this function is what we call the FXY.
51:09:680Paolo Guiotto: And this function… well, actually, the function is X plus Y minus the constant P of F2 equal to 0. This is the constraint, GXY, because we used to write this as G equals 0, okay?
51:26:430Paolo Guiotto: Now, since Fermat theorem and Lagrange theorem are the same, they do not prove existence. Also, this one do not prove existence. It says, if…
51:38:30Paolo Guiotto: if X star, Y star is the minimum, maximum point. So you already need to know that this point exists. So let's discuss first existence.
51:55:10Paolo Guiotto: So, the domain of optimization is this one.
52:00:110Paolo Guiotto: So, the… optimization
52:12:270Paolo Guiotto: domain… is the set D,
52:19:90Paolo Guiotto: of points XY, such that X is greater or equal than zero, Y is greater or equal than zero, and X plus Y is equal to P half. Now, this is closed because it is defined by large inequalities or equalities, okay?
52:37:430Paolo Guiotto: Close the… Defined… Bye.
52:45:670Paolo Guiotto: Large.
52:48:70Paolo Guiotto: inequalities.
52:50:480Paolo Guiotto: And… by equalities.
52:59:40Paolo Guiotto: With continuous functions.
53:05:770Paolo Guiotto: It's a bit exaggerated for this size, but it's just to show you the general strategy.
53:12:360Paolo Guiotto: and bounded.
53:15:420Paolo Guiotto: Because you see that I have X and Y both positive, then from X plus Y equal P over 2, since this is the sum of positive number equal to something.
53:26:930Paolo Guiotto: Each of the two must be less or equal than P over 2, no? From X plus Y equal P over 2, since they are both positive.
53:37:170Paolo Guiotto: none of two must… can be greater than P over 2, otherwise the sum would be larger, no? So, from this, we get that X and Y are both bounded by P over 2.
53:47:550Paolo Guiotto: So, this is closed demand. We know that it is a segment, we know everything, but let's imagine that we cannot draw this set. So, now, the set is compact.
54:01:260Paolo Guiotto: The function f is clearly continuous, and therefore Weiss theorem applies, and we have that there existed both minimum and maximum of F on this domain D. So this concerns the existence. Now, let's determine…
54:20:680Paolo Guiotto: Determination.
54:22:830Paolo Guiotto: So let's determine these points.
54:26:220Paolo Guiotto: In particular, maximum bond.
54:28:570Paolo Guiotto: And here is where we use the Lagrange theorem.
54:32:770Paolo Guiotto: Now, to use Lagrange theorem, we must verify first if the constraint is a submergent on the optimization set.
54:42:440Paolo Guiotto: So… We apply…
54:48:990Paolo Guiotto: Lagrange Theorem.
54:52:950Paolo Guiotto: So, first,
54:58:80Paolo Guiotto: to use Lagrange Theorem, this is, say, a technical requirement. You need to verify first that the constraint, function G, is a submersion on that set, okay? So, first, we check…
55:17:200Paolo Guiotto: that G is a submersion.
55:25:500Paolo Guiotto: on the set where G is equal to 0.
55:31:300Paolo Guiotto: Now, what should you do? You should verify that gradient of G is different from 0 for every point of that set.
55:38:480Paolo Guiotto: Now, normally, instead of checking if gradient is different from 0, we look where gradient is equal to 0, okay? So we do the opposite. Now, gradient of G is equal to, first of all.
55:52:630Paolo Guiotto: G is X plus Y minus P half, so when you do the gradient, you get…
56:03:720Paolo Guiotto: The ingredient of that G is… 1-1, okay?
56:10:340Paolo Guiotto: So, from this, you see that, first, the partial derivatives of G are continuous, so G is differentiable. This is important, because
56:22:510Paolo Guiotto: It is a fundamental technical requirement that we have everywhere.
56:27:660Paolo Guiotto: Second, you see that gradient of G is never 0. It's the vector 1, so it's different from 0. Whatever is point XY,
56:38:30Paolo Guiotto: Even for XY in R2, but in particular, for every point XY of the set G equal to 0 of the optimization domain.
56:47:570Paolo Guiotto: So, this first check is verified. Second.
56:52:370Paolo Guiotto: We now can say that if X star
56:57:860Paolo Guiotto: was… well, we will not write these tasks, okay? We say just if XY.
57:03:620Paolo Guiotto: Ease.
57:04:900Paolo Guiotto: A minimum, or a maximum.
57:09:140Paolo Guiotto: for F. As for the Fermat theorem, the Lagrange theorem does not distinguish between minimum and maximums. It says they must verify this condition.
57:20:660Paolo Guiotto: then you are not sure that those points will verify the condition gradient F proportional gradient G are necessarily minimum maximums, exactly as those points that verify gradient F equals 0 are not necessarily minimum maximums, okay? So you will still have to do something, but
57:39:360Paolo Guiotto: This is helpful because exactly as for the Fermat theorem, it restricts a lot the search of minimum-maximums. So here we are. If XY is the minimum-maximum line for F on…
57:52:630Paolo Guiotto: the set where G is 0, which is our domain. Then, because Lagrange theorem applies, we verified the technical requirement, gradient F at point XY
58:07:200Paolo Guiotto: is proportional to gradient G.
58:10:880Paolo Guiotto: at point XY. So there exists a lambda such that this happens. So we have to understand what are points for which this happens. So, we already know that the gradient of G is a vector 11.
58:25:360Paolo Guiotto: What is the gradient of F? Well, actually, you should check also that F is differentiable. F of XY is X times Y.
58:34:690Paolo Guiotto: So, DXF… well, let's write directly the gradient. The gradient of F is…
58:46:270Paolo Guiotto: YX.
58:47:990Paolo Guiotto: So, clearly, I see that DXF, DYF, the two components are continuous, So F is differentiable.
59:00:530Paolo Guiotto: Okay, so the gradient F… Is this one. So this condition
59:07:250Paolo Guiotto: is vector YX is proportional to 11.
59:14:820Paolo Guiotto: So it means that,
59:17:510Paolo Guiotto: This can be written as a system, Y must be lambda, and X must be lambda.
59:24:990Paolo Guiotto: So, you don't know yet what… there is this lambda which is disturbing, we will see later that it can be eliminated. But this says that the point we are looking for
59:35:220Paolo Guiotto: has X the same of y, because, you see, both are equal to lambda. So point XY is equal to point lambda lambda
59:45:860Paolo Guiotto: 4… sum.
59:49:30Paolo Guiotto: Lambda.
59:50:250Paolo Guiotto: And how do we determine this lambda?
59:53:990Paolo Guiotto: Well, we did tell me because this point must be in the domain.
59:57:680Paolo Guiotto: Okay? So, now, lambda lambda.
00:01:420Paolo Guiotto: belongs to the domain, which is the set where G is 0, if and all if lambda lambda verifies the constraint.
00:09:420Paolo Guiotto: What is the constraint? It is X plus Y, of course, lambda must be positive, and X plus Y equals P half, no? So X plus Y equal P over 2 means lambda plus lambda equals P over 2.
00:26:160Paolo Guiotto: So this makes 2 lambda equal P over 2.
00:30:80Paolo Guiotto: So, lambda equals P over 4. And this means that point XY is point P over 4P over 4.
00:41:530Paolo Guiotto: Exactly the same result we obtained above.
00:46:440Paolo Guiotto: Now, well, actually, it is not yet finished, because this shows that
00:50:530Paolo Guiotto: If XY is a minimum, maximum point, then XY must be this one.
00:58:770Paolo Guiotto: So there is a unique,
01:02:380Paolo Guiotto: Candidate? Now you may wonder, we missed something, probably, here.
01:14:340Paolo Guiotto: Because, .0… No, these are not. So this point here is the maximum point.
01:28:990Paolo Guiotto: So there is a unique candidate.
01:31:540Paolo Guiotto: Okay. Now, this is a bit exaggerated, but let's do some other examples. Also, in the next one, we actually could do by hand, so still do not focus on the details.
01:46:260Paolo Guiotto: But on the procedure.
01:48:840Paolo Guiotto: So, 274. Here, we have to determine minimum and maximum.
01:54:560Paolo Guiotto: of this quantity, X plus Y,
01:57:810Paolo Guiotto: on the domain, which is defined by this equation, X squared plus Y squared equal 1.
02:05:60Paolo Guiotto: Also, this one could be solved by hands, let's say, but we will solve directly applying the Lagrange machinery. Now, the domain of this case is the set of points where x squared plus Y squared is equal to 1, so it is a circle, unitary circle, here.
02:22:930Paolo Guiotto: So this is the domain D. It is the set of points where X squared plus Y squared is equal to 1.
02:34:420Paolo Guiotto: Okay, so… Again, we prove, first, existence.
02:43:560Paolo Guiotto: Now, the domain D is clearly closed and bounded.
02:52:670Paolo Guiotto: So it is compact.
02:57:400Paolo Guiotto: the function F.
02:59:380Paolo Guiotto: Which is this one.
03:01:330Paolo Guiotto: is continuous.
03:03:290Paolo Guiotto: Therefore, vice versa's theorem applies, and there exists both minimum And maximum.
03:10:710Paolo Guiotto: of F on that domain, D.
03:13:950Paolo Guiotto: Now we determine… these bonds.
03:18:670Paolo Guiotto: To determine these points, we apply… Lagrange theorem.
03:27:300Paolo Guiotto: So the constraint is this one. We write as equation G equals 0,
03:33:170Paolo Guiotto: So we… right, the main D is,
03:36:950Paolo Guiotto: X squared plus Y squared minus 1 equal to 0. That's the function G of XY.
03:46:270Paolo Guiotto: We check where this is a submersion, so… We need… to prove… That.
04:00:650Paolo Guiotto: G is a submersion
04:08:520Paolo Guiotto: on… D.
04:12:720Paolo Guiotto: So, let's see where gradient of G is equal to 0. Now, gradient of G is easy, it is equal to…
04:23:340Paolo Guiotto: 2X to Y.
04:25:680Paolo Guiotto: So, in particular, the XG, the YG are both continuous.
04:31:370Paolo Guiotto: So G is differentiable.
04:35:230Paolo Guiotto: Now, gradient of G is equal to 0, so where the function is not submersive, if and only if vector 2X, 2Y,
04:45:110Paolo Guiotto: is vector 00, and this happens if and all if XY is
04:51:730Paolo Guiotto: 0, 0. Now, there is a point, a bad point, where the function is not submersive.
04:57:50Paolo Guiotto: But, is this point in the domain…
05:02:290Paolo Guiotto: No, because if you plug X and Y equals 0, you get 0 minus 1 equals 0, minus 1 equals 0, no. So this point is not in domain D. And so this means that on D, the gradient is never equal to 0. Gradient of G is different from 0 on D.
05:21:300Paolo Guiotto: So this means that G… is a submersion.
05:29:160Paolo Guiotto: on… Okay, so the technical requirement to apply the theorem is verified, so… If, XY.
05:42:290Paolo Guiotto: Ease.
05:43:460Paolo Guiotto: a minimum, Or a maximum.
05:48:40Paolo Guiotto: point.
05:49:510Paolo Guiotto: 4.
05:50:660Paolo Guiotto: F on D.
05:53:590Paolo Guiotto: Dan… There must be a scalar lambda such that the gradient of F at point XY
06:02:410Paolo Guiotto: must be proportional to the gradient of G at point XY.
06:08:60Paolo Guiotto: Now, this becomes a condition, or better, an equation, to determine points where this is true.
06:15:300Paolo Guiotto: The unique problem is that this is not an equation only for point XY, but it involves another
06:21:650Paolo Guiotto: Quantity, this color lambda.
06:24:380Paolo Guiotto: So this is, in principle, a bit disturbing, because, as you will see, this is a system of a number of equations.
06:32:850Paolo Guiotto: and the number of unknowns, which is larger than the number of the equations, because if you write, gradient F is what? F is the function X plus Y, so the gradient is
06:46:10Paolo Guiotto: 1-1.
06:48:660Paolo Guiotto: 11 must be proportional to the gradient of G, which is 2X to Y.
06:58:60Paolo Guiotto: So, if we impose this identity, it means that we get 2 lambda X equal 1, 2 lambda y equal 1. You see that there are two equations and 3 are no.
07:12:600Paolo Guiotto: the coordinates of point XY plus this factor lambda.
07:18:40Paolo Guiotto: So this is not going to say immediately, point, station… sorry, the minimum, maximum point must be this or that, because there is still the parameter in the middle, and we cannot give a unique solution here. There will be always infinitely many solutions, because the number of unknowns is
07:36:50Paolo Guiotto: Bigger than number of equations.
07:38:530Paolo Guiotto: In fact, here, you can see that lambda cannot be 0, that's for sure, because if lambda is 0, you get 0 equals 1.
07:46:520Paolo Guiotto: So lambda must be different from zero.
07:50:630Paolo Guiotto: And therefore, we get this. X equals 1 over 2 lambda, y equals 1 over 2 lambda.
07:59:470Paolo Guiotto: And lambda?
08:01:970Paolo Guiotto: Now, I have to remind that I have something to… yet to use, which is this point must be in domain D, and domain D is defined by an equation.
08:16:649Paolo Guiotto: That must be verified. So, I impose that point, 1 over 2 lambda, 1 over 2 lambda.
08:28:130Paolo Guiotto: belongs to Z.
08:30:840Paolo Guiotto: And this gives…
08:32:750Paolo Guiotto: So the equation for this is X squared plus Y squared equal 1, so 1 over 4 lambda squared plus 1 over 4 lambda squared, this is X squared plus Y squared, equal to 1.
08:46:550Paolo Guiotto: That's the equation.
08:48:359Paolo Guiotto: the characteristic equation of D. From this, we see that this is 2 over 4, so 1 half lambda… 1 over 2 lambda squared equals 1, so lambda square equals 1 half, so lambda is plus minus 1 over root of 2.
09:07:00Paolo Guiotto: And this now yields these solutions. So, plus, minus…
09:15:370Paolo Guiotto: Well, since the sine is the same, because lambda is the same, I would prefer to put plus minus out here. 1 over 2 root of 2, 1 over 2 root of 2,
09:29:590Paolo Guiotto: No, no, no, no.
09:31:229Paolo Guiotto: Because lambda is 1 over, so it's numerator. So root of 2 over 2, root of 2 over 2.
09:37:779Paolo Guiotto: These are two points, not four, okay?
09:42:189Paolo Guiotto: Now, which one is minimum, which one is maximum? Now, it's like we already did now, so we have two candidates, we just evaluate the function. F at root of 2 over 2, root of 2 over 2, F is X plus Y, so it is a…
09:57:260Paolo Guiotto: the sum of the two components, so it is, basically root of 2, while F at minus root of 2 over 2 minus root of 2 over 2
10:07:180Paolo Guiotto: is equal to minus root of 2. So this is the max point minimum point.
10:16:480Paolo Guiotto: And that's it.
10:18:730Paolo Guiotto: Okay?
10:21:480Paolo Guiotto: So, the advantage of this method, of course, here you could have done directly.
10:26:790Paolo Guiotto: you could have described the points of that set with a unique coordinate, because those points can be represented as cos theta, sine theta, so you reduce everything to a function of theta, okay? But this is particular.
10:43:900Paolo Guiotto: It's not a general method. As soon as you have a complicated constraint, you can't do that, okay?
10:51:50Paolo Guiotto: Now, let's do a remark.
10:54:860Paolo Guiotto: on this lambda.
10:57:160Paolo Guiotto: Now, coefficient lambda… is called… Lagrange… multiplier.
11:14:170Paolo Guiotto: And we actually don't need to, to involve this multiplier. Let's see how to solve the equation gradient F proportional to gradient G without involving this factor lambda. So, gapping a system
11:32:640Paolo Guiotto: With only coordinates involved, and not this coefficient.
11:38:440Paolo Guiotto: Now, we, may observe this now.
11:43:320Paolo Guiotto: The equation.
11:47:930Paolo Guiotto: Gradient F… equal lambda gradient G, means what?
11:56:240Paolo Guiotto: Means that the two vectors are, of course, linearly dependent, because one of the… one of the two is
12:03:700Paolo Guiotto: Proportional to the other.
12:06:70Paolo Guiotto: And there is a way to, to verify this, huh? So it means that the vectors gradient F, gradient G are
12:16:90Paolo Guiotto: linearly.
12:17:780Paolo Guiotto: dependent.
12:20:460Paolo Guiotto: Now, if I have two vectors.
12:23:240Paolo Guiotto: In general, what can I do with two vectors? Combining two vectors, I can generate a space at most of dimension 2, if they are linearly independent.
12:35:860Paolo Guiotto: But if they are linearly dependent.
12:38:970Paolo Guiotto: It means that one is proportional to the other, so when I do linear combination, I still get vectors which are proportional to gradient G, so a space of dimension 1.
12:49:650Paolo Guiotto: And I cannot get a space of dimension 0, because to get a space of dimension 0, the two vectors should be equal to 0. But for G, this is certainly false, because we have the condition that gradient of G is different from 0. So, we can say that this is equivalent to say that
13:08:740Paolo Guiotto: De… D… Vector!
13:15:280Paolo Guiotto: Space.
13:16:790Paolo Guiotto: generated.
13:18:870Paolo Guiotto: by these two guys, gradient F, gradient G, pause.
13:26:440Paolo Guiotto: Dimension.
13:31:230Paolo Guiotto: 1.
13:32:300Paolo Guiotto: But… Not two.
13:36:820Paolo Guiotto: Now… To have dimension 2,
13:40:880Paolo Guiotto: The two-factor must be linearly independent.
13:44:890Paolo Guiotto: Do you know, check, how you could check linear independence of the two vectors?
13:52:110Paolo Guiotto: This is linear algebra question.
13:57:240Paolo Guiotto: What?
14:02:210Paolo Guiotto: Now, there is a condition on the two vectors, in this case, which is the following. You take the two vectors.
14:09:240Paolo Guiotto: gradient F, gradient G, and you put as lines of a matrix.
14:15:50Paolo Guiotto: In this case, we have a matrix with two lines, and also two columns, because there are two variables. This is this matrix, DX, F, D, Y, F, DX,
14:29:450Paolo Guiotto: G, B, Y, G, right?
14:33:980Paolo Guiotto: Now, this matrix, so the two vectors, the two lines of this matrix, are linearly independent if and only if.
14:46:580Paolo Guiotto: There is a condition on the determinant.
14:52:200Paolo Guiotto: should be different from zero, okay? So, let's say that,
14:58:640Paolo Guiotto: So these two are linearly independent, if and only if the determinant is different from zero. They are linearly dependent, as in this case, if and only if the determinant of this matrix is zero.
15:14:810Paolo Guiotto: So, at the end, we get this, that the condition of the statement
15:19:940Paolo Guiotto: of Lagrange theorem, gradient F proportional to gradient G is the same of determinant of this matrix, the matrix made by the two gradients, gradient F, gradient G equals 0. And this condition does not involve any lambda.
15:38:550Paolo Guiotto: So, now we will use,
15:47:360Paolo Guiotto: Well, let's see an example, let's take at the end of the chapter. For example, here we have exercise 2915. They are very simple in the sense that,
15:57:720Paolo Guiotto: Calculations are not complicated.
16:02:260Paolo Guiotto: to 9.15.
16:05:520Paolo Guiotto: So, let's take the number 2.
16:09:00Paolo Guiotto: I have to find the minimum and the maximum, of this function.
16:15:860Paolo Guiotto: 2X squared plus Y squared minus X.
16:22:790Paolo Guiotto: on the domain where X squared plus Y squared is equal to 1.
16:31:600Paolo Guiotto: So… Let's start with the existence.
16:39:150Paolo Guiotto: So the domain D is the set where X squared plus Y squared is equal to 1, so it's again the unitary circle.
16:49:60Paolo Guiotto: So, it is closed,
16:52:890Paolo Guiotto: And bounded, this is trivial, so we don't need to justify this, no? It's, defined by an equation, it was a continuous function, so it's closed, it is bounded because it's norm equal to 1, so what do you want, both at this?
17:07:830Paolo Guiotto: F is clearly continuous, so biased as theorem applies and do exist both minimum and maximum.
17:18:740Paolo Guiotto: Of F, only.
17:20:320Paolo Guiotto: Now, let's determine these points.
17:24:260Paolo Guiotto: So we apply Lagrangier.
17:27:140Paolo Guiotto: we apply… like, branch DOM.
17:34:340Paolo Guiotto: we start… Checking…
17:42:630Paolo Guiotto: If…
17:44:790Paolo Guiotto: G. G is the constraint, so it will be the usual X squared plus Y squared minus 1.
17:51:830Paolo Guiotto: is a submission.
17:58:580Paolo Guiotto: on D, which is the sector where G is 0.
18:02:840Paolo Guiotto: We already chatted this, so… She… previous…
18:10:600Paolo Guiotto: exercise. It is the same case. Now we add also here the circle, so it's just copy and paste.
18:20:340Paolo Guiotto: So, now we know that, in particular, G is a submersion.
18:34:40Paolo Guiotto: Only.
18:35:880Paolo Guiotto: Now, let… XY… Indeed.
18:43:30Paolo Guiotto: B.
18:44:140Paolo Guiotto: Annie?
18:46:270Paolo Guiotto: Minimum.
18:47:780Paolo Guiotto: or maximum.
18:50:50Paolo Guiotto: Boeing.
18:52:820Paolo Guiotto: So, we should write gradient F proportional gradient G.
18:58:250Paolo Guiotto: then gradient F at XY is proportional to gradient G, but as we come to say, This is equivalent.
19:09:300Paolo Guiotto: Saying that the determinant of the matrix made by the two gradient is zero.
19:14:800Paolo Guiotto: So, determinant.
19:16:690Paolo Guiotto: of matrix, gradient F, gradient G is 0.
19:23:480Paolo Guiotto: This means that determinant of the matrix
19:29:10Paolo Guiotto: That's write the gradient of F. F is this one, so the derivative with respect to X is 4x minus 1,
19:39:980Paolo Guiotto: And the derivative with respect to Y is 2Y.
19:43:470Paolo Guiotto: Do you see? Don't look at me, look at the functions.
19:48:960Paolo Guiotto: The gradient of G is 2X, to Y.
19:55:20Paolo Guiotto: So now we have to impose this determinant equal to zero.
19:59:360Paolo Guiotto: we get an equation, so 4X minus 1 times 2y minus 2Y times 2X equals 0.
20:12:810Paolo Guiotto: So we can simplify factors like this. We cannot divide by Y, because Y is a variable, can be equal to 0. So we factorize Y, and this means that we have 4X minus 2X, 2X,
20:28:990Paolo Guiotto: minus 1, this equals 0. Now, we have this equation.
20:33:620Paolo Guiotto: How do we solve this equation in point XY? It's a product equals 0, so we must have only two possibilities. Either Y equals 0, or 2X minus 1 equals 0.
20:48:280Paolo Guiotto: Now, what are the solutions of Y equals 0?
20:55:260Paolo Guiotto: Yes, reminded this, we are looking for points, XY. We are looking for points XY with Y equals 0. So this means points X0, with the X for the moment arbitrary.
21:08:940Paolo Guiotto: Here, we have X equals 1 half.
21:12:590Paolo Guiotto: So we are looking for points XY with X equals 1 half, we have points 1 half Y with Y real.
21:22:620Paolo Guiotto: Now, what are these points?
21:24:890Paolo Guiotto: These points are points where gradient F is proportional to gradient G.
21:30:690Paolo Guiotto: Okay?
21:33:490Paolo Guiotto: We are not, so these are formally, this is only this part here.
21:39:880Paolo Guiotto: Okay? Remind that we are looking for points that are in deed.
21:45:710Paolo Guiotto: So we should check whether these points are indeed or not, because if they are not indeed.
21:51:590Paolo Guiotto: We do not care those points, so we have to verify when point X0 belongs to D. X0 belongs to D if and only if belonging to D means verifying the equation X squared plus Y squared equals 1. So, we impose the equation, we get X squared plus 0 square.
22:11:100Paolo Guiotto: equal 1, so X squared equal 1, so X equal plus minus 1. So you see, not all these points are in D. Only these two guys, plus minus 1, 0, belongs to D.
22:27:200Paolo Guiotto: And similarly, 0.1FY is in the if and only if we impose again the
22:35:810Paolo Guiotto: Condition, 1 half square plus Y squared equal to 1. This is 1 fourth…
22:42:950Paolo Guiotto: So this means, Y squared.
22:45:670Paolo Guiotto: equal 1 minus 143 over 4, so y is plus minus root of 3 divided 2.
22:56:30Paolo Guiotto: So this means that not all these points are indeed, but only 1 half and plus minus root 3 over 2 is the second coordinate. These are indeed.
23:08:20Paolo Guiotto: So now what is the point?
23:10:110Paolo Guiotto: We saved.
23:11:260Paolo Guiotto: If XY is indeed, and is a minimum, maximum point, then it must verify gradient F equal lambda gradient G, that means these points here, but these points are indeed if and only if they are plus, minus 1, 0,
23:29:200Paolo Guiotto: And 1 half plus minus root of 3 over 2.
23:34:300Paolo Guiotto: So, what are these points?
23:36:360Paolo Guiotto: These are points among which we have minimum-maximum. These are the candidates. So, out to the side. Now, we have the… our search has been reduced to just 4 points, so let's compute the value of the function f at plus minus 1, 0,
23:55:00Paolo Guiotto: F is different.
23:57:310Paolo Guiotto: Seems so, yeah.
23:58:870Paolo Guiotto: So, F10 is… What is it?
24:04:140Paolo Guiotto: is, 2… Minus 1, 1. F minus 1, 0 is, 3.
24:14:960Paolo Guiotto: F.
24:17:20Paolo Guiotto: Oh.
24:18:180Paolo Guiotto: F at 1 half per y. The function depends on Y squared, so I can compute at once for the two points. So this is,
24:30:70Paolo Guiotto: One of the four, Plus, the square of that is 3 fourths.
24:35:690Paolo Guiotto: minus… Xs, or minus 1 half.
24:40:600Paolo Guiotto: So it is 1 minus 1 half is 1 half.
24:45:830Paolo Guiotto: So, from these values, what is the conclusion?
24:49:580Paolo Guiotto: Who are the minimum points?
24:57:220Paolo Guiotto: So you see that the minimum value is this one. So the minimum points are 1 half plus minus root of 3,
25:04:760Paolo Guiotto: Huh.
25:05:940Paolo Guiotto: And the maximum points, we can…
25:09:280Paolo Guiotto: Say, there's a unique maximum point is minus one single.
25:15:290Paolo Guiotto: Now, what is 1-0? I don't know. It's a sort of stationary point, because it's like the gradient F equals 0. Here, it's not gradient F equals 0. It's gradient F proportional to gradient G, so we may introduce… the problem is over.
25:34:40Paolo Guiotto: So let's just give this definition.
25:37:870Paolo Guiotto: points… Well… gradient F is proportional to gradient G called…
25:54:600Paolo Guiotto: constrained…
26:00:160Paolo Guiotto: stationary…
26:05:790Paolo Guiotto: points.
26:08:560Paolo Guiotto: Okay?
26:10:620Paolo Guiotto: Now… the Lagrange theorem we have seen here, Was in the version 4…
26:21:10Paolo Guiotto: a function of, functions of two variables, F,
26:25:940Paolo Guiotto: And the constraint G are both function of X and Y.
26:29:810Paolo Guiotto: Now, this theorem extends, literally to the case where we have functions of a generic number of variables with the one unique single constraint. So, let's extend it.
26:45:650Paolo Guiotto: So… Lagrange…
26:54:340Paolo Guiotto: GRM.
26:56:440Paolo Guiotto: Extends…
27:00:870Paolo Guiotto: to… functions… of… variables.
27:09:620Paolo Guiotto: So we have, this statement.
27:14:560Paolo Guiotto: So, let… Well, we write just in the vector form. Let F be function of vector X, G…
27:25:940Paolo Guiotto: function of vector X.
27:29:260Paolo Guiotto: be differentiable.
27:32:270Paolo Guiotto: functions.
27:36:960Paolo Guiotto: Weed.
27:43:910Paolo Guiotto: G… a submersion.
27:51:990Paolo Guiotto: on the set D, where G is equal to 0.
27:56:960Paolo Guiotto: Which will be the domain of the problem.
28:00:990Paolo Guiotto: So this means that gradient of G is never 0,
28:07:160Paolo Guiotto: For every point X of that domain.
28:14:250Paolo Guiotto: Then… If… X star.
28:22:00Paolo Guiotto: Indeed.
28:23:890Paolo Guiotto: Is… any.
28:26:630Paolo Guiotto: Minimum.
28:28:290Paolo Guiotto: or maximum.
28:30:520Paolo Guiotto: point.
28:32:530Paolo Guiotto: 4.
28:34:470Paolo Guiotto: F.
28:36:120Paolo Guiotto: on D.
28:39:190Paolo Guiotto: then we have that gradient of F at point X star.
28:45:290Paolo Guiotto: must be proportional to the gradient of G at point X star.
28:51:470Paolo Guiotto: So there exists the lambda, Such that this holds.
28:57:230Paolo Guiotto: So, as you can see, the same conclusion.
29:00:330Paolo Guiotto: But here, remark, let's write this, I will, leave,
29:05:910Paolo Guiotto: With some exercise to do for tomorrow, trying to use this.
29:11:50Paolo Guiotto: So you see the same statement. The application of the statement is slightly different in general, because the condition gradient F proportional to gradient G still means that the two vectors, gradient F and gradient G, are
29:30:310Paolo Guiotto: linearly, dependent.
29:35:690Paolo Guiotto: But now, when I take the matrix made of the two vectors, gradient F, gradient G,
29:44:330Paolo Guiotto: This matrix has definitely two lines.
29:48:920Paolo Guiotto: But the number of columns is the same of the number of variables.
29:53:700Paolo Guiotto: is D, so this is a 2 by D matrix.
29:59:860Paolo Guiotto: So, for example, I have functions F and G functions of three variables. These are two lines and 3 columns.
30:08:690Paolo Guiotto: So you cannot say that the condition linearly dependent is determinant equal to zero.
30:16:550Paolo Guiotto: Because there is no determinant for a 2x3 matrix.
30:21:120Paolo Guiotto: Okay? So, the determinant condition holds only in the special case when these two. What is the condition in this case?
30:31:170Paolo Guiotto: So, now, the point is that,
30:35:240Paolo Guiotto: Do you remind of the rank of matrix?
30:41:620Paolo Guiotto: Who knows what they…
30:44:270Paolo Guiotto: Okay, so, since you do not remind and time is over, let's say… let's stay with the…
30:51:690Paolo Guiotto: a question open here. Tomorrow morning, we will restart… we have class tomorrow, right? Okay. We will restart from exactly this point, so please review this final part from the statement to here.
31:06:00Paolo Guiotto: And if you… it would be nice if you, could go back on linear algebra.
31:13:430Paolo Guiotto: and try to see when these two vectors are linearly dependent or independent, what is the condition on the metrics made by these two vectors. Let's see if tomorrow can respond to this.
31:29:450Paolo Guiotto: You can always go on ChatGPT and ask that it will give you the right answer, for sure. That's not… I'm not saying that it's bad, okay? The important is that you are able to understand what is the answer you get.
31:45:00Paolo Guiotto: Okay, let's stop here.