WEBVTT
00:00:00.000 --> 00:00:09.980
DAVID JORDAN: Hello, and
welcome back to recitation.
00:00:09.980 --> 00:00:13.630
So in this problem, we're
considering a function
00:00:13.630 --> 00:00:18.970
f of three variables, f of x,
y, z, and it's differentiable.
00:00:18.970 --> 00:00:22.820
And we're not told
a formula for f.
00:00:22.820 --> 00:00:25.160
We just know that it's
differentiable at this point
00:00:25.160 --> 00:00:29.400
P, which is 1, minus
1, 1, and we're
00:00:29.400 --> 00:00:32.050
told that the gradient
of f at that point
00:00:32.050 --> 00:00:36.040
is this particular vector 2i
plus j minus 3k, at that point
00:00:36.040 --> 00:00:39.245
P. So all we understand
about f is how
00:00:39.245 --> 00:00:42.960
it looks around the point P.
00:00:42.960 --> 00:00:45.690
Now, we also have this
relation between the variables,
00:00:45.690 --> 00:00:48.280
so x, y and z aren't unrelated.
00:00:48.280 --> 00:00:50.240
They're related
by this constraint
00:00:50.240 --> 00:00:53.750
that z is x squared
plus y plus 1.
00:00:53.750 --> 00:00:56.220
So with this
information, we want
00:00:56.220 --> 00:00:59.460
to compute the gradient
of a new function g,
00:00:59.460 --> 00:01:02.870
and the new function g is a
function of two variables,
00:01:02.870 --> 00:01:07.990
and this function g is obtained
from f by just plugging
00:01:07.990 --> 00:01:09.590
in our relation for y.
00:01:09.590 --> 00:01:13.000
So we can use our
constraint to solve for y,
00:01:13.000 --> 00:01:19.730
and then this function g is just
f with that constraint applied.
00:01:19.730 --> 00:01:21.200
And what we really
want to do is we
00:01:21.200 --> 00:01:27.750
want to find the gradient
of g at the point (1, 1).
00:01:27.750 --> 00:01:31.550
So notice that when
g is equal to 1,
00:01:31.550 --> 00:01:34.680
1, that means that--
sorry, when the input of g
00:01:34.680 --> 00:01:40.350
is 1, 1, that means the
input of f is P. OK?
00:01:40.350 --> 00:01:43.837
So why don't you pause the video
and work this out for yourself.
00:01:43.837 --> 00:01:45.920
Check back with me and
we'll work it out together.
00:01:53.962 --> 00:01:54.670
OK, welcome back.
00:01:54.670 --> 00:01:55.650
So let's get started.
00:01:59.590 --> 00:02:03.110
So this problem may
not look like it's
00:02:03.110 --> 00:02:06.400
a problem about partial
derivatives with constraints,
00:02:06.400 --> 00:02:10.360
but that's what it's really
going to boil down to,
00:02:10.360 --> 00:02:18.689
which is to say that when
we want to compute-- so
00:02:18.689 --> 00:02:20.730
when we want to answer
this question by computing
00:02:20.730 --> 00:02:22.330
the gradient, the first thing
we're going to want to do
00:02:22.330 --> 00:02:24.460
is compute the partial
derivative of g
00:02:24.460 --> 00:02:26.180
and its variable x.
00:02:26.180 --> 00:02:28.260
And from the way we
set up the problem,
00:02:28.260 --> 00:02:34.390
that's just the
same as computing
00:02:34.390 --> 00:02:39.120
the partial derivative
of f with respect
00:02:39.120 --> 00:02:44.450
to x and keeping z constant.
00:02:44.450 --> 00:02:46.325
Now, remember, when we
do partial derivatives
00:02:46.325 --> 00:02:49.200
with constraints, what's
important about the notation
00:02:49.200 --> 00:02:49.950
is what's missing.
00:02:49.950 --> 00:02:52.000
The variable y is
missing, and that's
00:02:52.000 --> 00:02:54.840
because we are going to use the
constraint to get rid of it,
00:02:54.840 --> 00:02:57.260
and that's exactly
how we define g,
00:02:57.260 --> 00:03:00.710
so this is the key observation.
00:03:00.710 --> 00:03:02.790
So computing the
gradient of g is just
00:03:02.790 --> 00:03:05.387
going to be computing
these partial derivatives
00:03:05.387 --> 00:03:06.095
with constraints.
00:03:09.080 --> 00:03:16.040
So we'll do that in a moment,
and I'll also just write
00:03:16.040 --> 00:03:19.190
that the partial derivative
of g in the z-direction
00:03:19.190 --> 00:03:26.970
is partial f partial z,
now keeping x constrained.
00:03:26.970 --> 00:03:31.050
All right, so we need to compute
these partial derivatives
00:03:31.050 --> 00:03:31.933
with constraints.
00:03:34.820 --> 00:03:37.412
And so you remember
how this goes.
00:03:37.412 --> 00:03:38.870
The way that I
prefer to do this is
00:03:38.870 --> 00:03:40.328
to compute the
total differentials.
00:03:40.328 --> 00:03:44.405
So let's compute over here.
00:03:49.070 --> 00:04:03.365
The total differential df
is-- the total differential
00:04:03.365 --> 00:04:06.760
of f is just the partials
of f in the x-direction, f
00:04:06.760 --> 00:04:09.350
in the y-direction, f in the
z-direction, and each of these
00:04:09.350 --> 00:04:13.690
is multiplied by the
corresponding differential.
00:04:13.690 --> 00:04:16.570
And we don't know f, so we can't
compute the partial derivatives
00:04:16.570 --> 00:04:19.410
of it in general, but we do
know these partial derivatives
00:04:19.410 --> 00:04:20.700
at this point.
00:04:20.700 --> 00:04:23.590
And so in the problem,
we were given that this
00:04:23.590 --> 00:04:33.590
is 2dx plus dy minus 3dz.
00:04:33.590 --> 00:04:40.900
So this is just using the
fact that the gradient of f we
00:04:40.900 --> 00:04:49.410
were given is 2, 1 minus 3, OK?
00:04:49.410 --> 00:04:50.994
So that's the total
differential of f,
00:04:50.994 --> 00:04:52.326
and now we have this constraint.
00:04:52.326 --> 00:04:54.480
And remember, when we do
these partial derivatives
00:04:54.480 --> 00:04:56.890
with constraints, the trick
is to take the differential
00:04:56.890 --> 00:04:58.330
of the constraint.
00:04:58.330 --> 00:05:05.350
So we had this equation z
equals x squared plus y plus 1,
00:05:05.350 --> 00:05:07.730
and what we need to do
is take its differential.
00:05:07.730 --> 00:05:17.320
So we have dz is 2x dx plus dy.
00:05:17.320 --> 00:05:20.440
So that's our constraint.
00:05:20.440 --> 00:05:21.980
Now here we have
this variable x,
00:05:21.980 --> 00:05:24.150
but we're not varying
x in this problem.
00:05:24.150 --> 00:05:28.430
We're only focused on the point
P, and at the point P, x is 1.
00:05:28.430 --> 00:05:39.630
So, in fact, dz is
just 2dx plus dy, OK?
00:05:39.630 --> 00:05:46.830
So now what we need to do is we
need to combine the constraint
00:05:46.830 --> 00:05:53.180
equation and the
total differential
00:05:53.180 --> 00:05:56.370
for f into one
equation, and so this
00:05:56.370 --> 00:05:58.320
is just linear algebra now.
00:05:58.320 --> 00:05:59.840
So I'll just come over here.
00:06:02.580 --> 00:06:12.580
So we can rewrite our total
differential for the constraint
00:06:12.580 --> 00:06:23.994
as saying that dy is
equal to dz minus 2dx,
00:06:23.994 --> 00:06:26.410
and then we can plug that back
into our total differential
00:06:26.410 --> 00:06:27.480
for f.
00:06:27.480 --> 00:06:35.470
And so we get that df
is equal to 2dx plus--
00:06:35.470 --> 00:06:43.250
now I plug in dy here--
so dz minus 2dx, and then
00:06:43.250 --> 00:06:46.286
finally, minus 3dz.
00:06:46.286 --> 00:06:50.980
So altogether, I
get a minus 2dz,
00:06:50.980 --> 00:06:52.712
because this and this cancel.
00:06:52.712 --> 00:06:55.080
OK.
00:06:55.080 --> 00:06:58.920
We get a minus 2dz.
00:06:58.920 --> 00:07:04.170
So what does that tell
us about the gradient?
00:07:04.170 --> 00:07:08.420
So remember that
the differential now
00:07:08.420 --> 00:07:18.450
of g and its variables
is partial g partial x
00:07:18.450 --> 00:07:26.490
dx plus partial g partial z dz.
00:07:26.490 --> 00:07:28.722
And remember, the trick
about partial derivatives
00:07:28.722 --> 00:07:30.430
and their relation to
total differentials
00:07:30.430 --> 00:07:33.080
is that the partial derivative
is just this coefficient.
00:07:36.110 --> 00:07:39.370
So the fact that we
computed df and we
00:07:39.370 --> 00:07:43.960
found that it was minus
2dz, that tells us
00:07:43.960 --> 00:07:53.490
that dg-- so the thing
that we need to use
00:07:53.490 --> 00:07:57.720
is that g, remember, is just
the specialization of f.
00:07:57.720 --> 00:08:01.310
So dg is equal to
df in this case,
00:08:01.310 --> 00:08:05.620
because g is just a special
case of f with constraints.
00:08:05.620 --> 00:08:08.070
So when we computed
df here, we were
00:08:08.070 --> 00:08:11.270
imposing exactly the constraints
that we used to define dg,
00:08:11.270 --> 00:08:15.880
and so what this tells
us is that we can just
00:08:15.880 --> 00:08:23.210
compare the coefficients
here and so our gradient is
00:08:23.210 --> 00:08:27.110
0, minus 2.
00:08:27.110 --> 00:08:30.110
So the 0 is because there
is no dependence anymore
00:08:30.110 --> 00:08:31.740
on x at this point.
00:08:31.740 --> 00:08:33.086
There wasn't a dx term.
00:08:33.086 --> 00:08:34.710
There could have been
and there wasn't.
00:08:34.710 --> 00:08:39.370
And the minus 2 is because
that's the dependence on z.
00:08:39.370 --> 00:08:41.040
OK, so this is a
bit complicated,
00:08:41.040 --> 00:08:43.210
so why don't we
review what we did.
00:08:43.210 --> 00:08:46.480
So going back over to
the problem statement,
00:08:46.480 --> 00:08:56.250
we first needed to
realize that saying that g
00:08:56.250 --> 00:09:03.925
was a special case of f where
we use our constraints to solve
00:09:03.925 --> 00:09:08.390
for y, that's what put us
in the context of problems
00:09:08.390 --> 00:09:09.650
with constraints.
00:09:09.650 --> 00:09:13.671
So the fact that
the dependence on y
00:09:13.671 --> 00:09:15.837
was so simple that we could
just use the constraint.
00:09:15.837 --> 00:09:16.337
OK.
00:09:19.970 --> 00:09:21.770
So then, what that
allowed us to do
00:09:21.770 --> 00:09:24.610
is it allowed us to say that
the partial derivative of g
00:09:24.610 --> 00:09:27.840
in the x-direction is just
the partial derivative
00:09:27.840 --> 00:09:30.880
in the x-direction
subject to the constraint,
00:09:30.880 --> 00:09:33.650
and that's what we did here.
00:09:33.650 --> 00:09:36.776
And so then, the next
steps that we did
00:09:36.776 --> 00:09:38.400
are the same steps
that we would always
00:09:38.400 --> 00:09:42.910
do to compute partial
derivatives with constraints,
00:09:42.910 --> 00:09:48.570
and so we finally got
a relationship that
00:09:48.570 --> 00:09:50.860
said that, subject
to these constraints,
00:09:50.860 --> 00:09:54.890
df is equal to minus 2dz.
00:09:54.890 --> 00:09:57.640
And the point is that
g is just the function
00:09:57.640 --> 00:09:59.500
f with those
constraints imposed,
00:09:59.500 --> 00:10:05.510
and so dg and df are the same,
and so, in particular, dg
00:10:05.510 --> 00:10:07.360
is minus 2dz.
00:10:07.360 --> 00:10:10.295
And then, we remember
that you can always
00:10:10.295 --> 00:10:12.670
read off partial derivatives
from the total differential.
00:10:12.670 --> 00:10:14.140
They're just the coefficients.
00:10:14.140 --> 00:10:18.545
And so in the end, we got that
the gradient was 0 minus 2.
00:10:18.545 --> 00:10:20.789
And I think I'll
leave it at that.