00:01
We may want to sometimes minimize or maximize functions and their functions of x and y.
00:05
There are people, techniques, a couple of ways we can do this.
00:08
Let's say we wanted to minimize, for example, a labor cost.
00:13
So let's say the labor cost is 3 halves x squared plus y squared minus 5x.
00:19
So it's this polynomial in x and y.
00:25
Alright, so this is our labor cost function.
00:31
Alright, so in order to figure out the information, the maximum, minimum, critical points, whether it's an extreme point or something like that, we need to take some derivatives.
00:41
Generally, we want to start with the first derivative.
00:43
So we'll take the idea that the gradient of the labor function is equal to 0.
00:53
And what that breaks down to is that we need the partial derivative with respect to x, which we'll just call l sub x.
01:04
We need that to be equal to 0.
01:07
What's the derivative with respect to x? well, first term has an x in it, so we'll take that derivative.
01:12
That's going to leave us with 3x.
01:15
2s will cancel.
01:16
Second term has no x, so that's 0.
01:19
Third term, negative 5x, so taking the derivative will give us negative 5.
01:24
Fourth term has no x, so it's 0.
01:28
Last term, the x goes to just 1, so we get 2y.
01:33
This needs to be equal to 0, the first derivative, partial derivative.
01:37
And then the first partial derivative with respect to y, we'll call that l sub y.
01:45
We want that to be equal to 0 as well, but what's that first derivative? well, that first derivative is 2y minus 8 minus 2x.
01:57
And so we have two linear equations that we need to solve.
02:01
We have 5 is equal to 3x minus 2y.
02:07
And we have 8 is equal to 2y minus 2x.
02:15
These are our two equations that we need to solve.
02:20
And so if we look at the second equation, we divide both sides by 2, so we get 4 is equal to 4y minus 2x.
02:28
Excuse me, 4 is equal to y minus x, which means that y we can say is equal to 4 plus x.
02:37
So that'll be our first part in finding solutions.
02:41
And so we'll just plug this back into maybe this equation.
02:46
And so we'll get 5 is equal to 3x minus 2y, and y we said was equal to 4 plus x.
02:57
And so that's going to give us 3x minus 8 minus x.
03:03
And this is all equal to 5 minus 2x.
03:09
Excuse me.
03:11
And so what does that give us? well, that will tell us that we have x minus 8 is equal to 5.
03:21
That must mean that x itself is equal to 13.
03:25
So x is equal to 13.
03:27
Y is 4 more than that, so y is going to be equal to 17.
03:31
So these are our critical points.
03:33
Well, this is our critical point, actually.
03:36
So this critical point, since it's only one point, our critical point x sub 0, y sub 0 is equal to 13, 17.
03:45
And we only got this one point.
03:49
So now we're going to go ahead and use second derivative test.
03:52
So this was the first derivative test.
03:55
Now we'll go ahead and use the second derivative test.
03:59
And we need, first of all, we need to determine what the hessian of the matrix is.
04:04
So a hessian is going to be equal to a matrix of partial derivatives.
04:10
The partial derivative square with respect to x, partial derivative with respect to x, then y, partial derivative with respect to y, then x, partial derivative with respect to y squared, y and then y again.
04:28
And so for us, if we already know, let's go up a bit, we already know the first partial derivative, so we just need to take that with respect to whatever variable.
04:36
And the first part of the matrix, we will have l sub xx.
04:41
So i'll take the derivative of l sub x with respect to x...