WEBVTT

00:00:00.000 --> 00:00:07.800
JOEL LEWIS: Hi.

00:00:07.800 --> 00:00:09.390
Welcome back to recitation.

00:00:09.390 --> 00:00:11.320
In lecture, you've
been learning about how

00:00:11.320 --> 00:00:14.080
to solve multivariable
optimization problems using

00:00:14.080 --> 00:00:15.747
the method of
Lagrange multipliers,

00:00:15.747 --> 00:00:17.330
and I have a nice
problem here for you

00:00:17.330 --> 00:00:18.830
that can be solved that way.

00:00:18.830 --> 00:00:21.950
So in this problem,
we've got an ellipse,

00:00:21.950 --> 00:00:24.610
the ellipse with equation
x squared plus 4 y squared

00:00:24.610 --> 00:00:25.320
equals 4.

00:00:25.320 --> 00:00:27.175
So that's this
ellipse, and we want

00:00:27.175 --> 00:00:30.510
to inscribe a rectangle
in it, so here I

00:00:30.510 --> 00:00:35.180
mean actually a rectangle whose
edges are parallel to the axes.

00:00:35.180 --> 00:00:37.660
So I want to inscribe a
rectangle in this ellipse,

00:00:37.660 --> 00:00:40.945
and among all such
rectangles, I want

00:00:40.945 --> 00:00:43.396
to find the one with
the largest perimeter.

00:00:43.396 --> 00:00:45.020
So I want to find
the maximal perimeter

00:00:45.020 --> 00:00:47.840
of a rectangle that can be
inscribed in this ellipse.

00:00:47.840 --> 00:00:50.940
So why don't you have a go
at solving this problem,

00:00:50.940 --> 00:00:53.480
pause the video, work
it out, come back,

00:00:53.480 --> 00:00:54.940
and we can work it out together.

00:01:03.200 --> 00:01:05.680
So hopefully, you've had some
luck working on this problem.

00:01:05.680 --> 00:01:07.440
Let's get started on it.

00:01:07.440 --> 00:01:09.645
So one thing we
need to start is we

00:01:09.645 --> 00:01:11.970
need to figure out a
way to sort of describe

00:01:11.970 --> 00:01:14.940
these rectangles in
a way that will let

00:01:14.940 --> 00:01:17.120
us describe their
perimeter, write down

00:01:17.120 --> 00:01:18.120
what their perimeter is.

00:01:18.120 --> 00:01:20.390
So a natural way to
do that is to call

00:01:20.390 --> 00:01:24.070
this upper right-hand corner
of the rectangle, the call it

00:01:24.070 --> 00:01:27.700
the point (x, y).

00:01:27.700 --> 00:01:30.340
So (x, y) is going to be
that upper right-hand corner

00:01:30.340 --> 00:01:32.550
of the rectangle, and
it's going to be ranging

00:01:32.550 --> 00:01:36.450
over the region from this
topmost point on the ellipse

00:01:36.450 --> 00:01:39.470
down to this rightmost
point on the ellipse,

00:01:39.470 --> 00:01:42.070
on this quarter
arc of the ellipse.

00:01:42.070 --> 00:01:44.990
So if that point
is (x, y), we need

00:01:44.990 --> 00:01:46.950
to figure out what is
the perimeter that we're

00:01:46.950 --> 00:01:47.810
trying to optimize.

00:01:47.810 --> 00:01:53.030
So the perimeter here, P, which
is a function of x and y--

00:01:53.030 --> 00:01:56.400
well, so x is this
distance, so the length

00:01:56.400 --> 00:01:58.945
of the horizontal edge
of the rectangle is 2x,

00:01:58.945 --> 00:02:00.760
and we've got two
of those, so that's

00:02:00.760 --> 00:02:04.440
4x from the horizontal sides.

00:02:04.440 --> 00:02:08.960
And then this height
is y, so the length

00:02:08.960 --> 00:02:11.410
of the vertical side
of the rectangle is 2y,

00:02:11.410 --> 00:02:17.580
so the perimeter is
going to be 4x plus 4y.

00:02:17.580 --> 00:02:21.290
So that's our objective function
that we're trying to optimize,

00:02:21.290 --> 00:02:24.130
that we're trying to
find the maximum of.

00:02:24.130 --> 00:02:27.200
And we also have the
constraint function

00:02:27.200 --> 00:02:34.410
g, which is x squared
plus 4 y squared,

00:02:34.410 --> 00:02:37.330
and the constraint is
that g is equal to 4.

00:02:37.330 --> 00:02:41.100
So we have the objective
function P-- P of x, y--

00:02:41.100 --> 00:02:44.200
and we have this
constraint function g,

00:02:44.200 --> 00:02:47.610
and so we want to write
down some equations using

00:02:47.610 --> 00:02:50.950
Lagrange multipliers whose
solutions will correspond

00:02:50.950 --> 00:02:55.100
to the possible
maximum points of P.

00:02:55.100 --> 00:02:56.340
So what are those equations?

00:02:56.340 --> 00:03:00.730
Well, we need that
the gradient of P

00:03:00.730 --> 00:03:03.660
is parallel to the gradient g.

00:03:03.660 --> 00:03:09.950
So that means that we need
P_x is equal to lambda times

00:03:09.950 --> 00:03:15.260
g_x and P_y is equal
to lambda times g_y

00:03:15.260 --> 00:03:17.020
for some value of lambda.

00:03:17.020 --> 00:03:19.350
We need to find a value of
lambda that makes this true.

00:03:19.350 --> 00:03:21.940
And then also, our third
equation is the constraint

00:03:21.940 --> 00:03:23.840
equation, that g is equal to 4.

00:03:23.840 --> 00:03:27.690
So what does P_x equal lambda
g_x translate to in our case?

00:03:27.690 --> 00:03:29.560
Let's just draw a line here.

00:03:29.560 --> 00:03:35.200
So in our case, P_x is the x
partial derivative of 4x plus

00:03:35.200 --> 00:03:40.750
4y, so that's just 4, and g_x,
we take the partial derivative

00:03:40.750 --> 00:03:43.430
with respect to x of x
squared plus 4y squared,

00:03:43.430 --> 00:03:49.610
and that's equal to 2x, so 4
is equal to lambda times 2x.

00:03:49.610 --> 00:03:52.080
And from taking the y
partial derivatives,

00:03:52.080 --> 00:03:57.690
we have that the y partial
derivative of P is 4, P_y is 4,

00:03:57.690 --> 00:04:03.310
and g_y is going to be the y
partial derivative of x squared

00:04:03.310 --> 00:04:11.740
plus 4 y squared, so that's 8y,
so 4 equals lambda times 8y,

00:04:11.740 --> 00:04:16.060
and we also have the
constraint equation x squared

00:04:16.060 --> 00:04:19.756
plus 4 y squared equals 4.

00:04:19.756 --> 00:04:21.505
So we need to solve
these three equations,

00:04:21.505 --> 00:04:24.120
and we need to figure out
which values of x and y

00:04:24.120 --> 00:04:27.050
are the solutions.

00:04:27.050 --> 00:04:30.430
So I think the simplest
way to proceed here

00:04:30.430 --> 00:04:33.530
is to note that from
the first equation

00:04:33.530 --> 00:04:37.100
and the second equation, we can
eliminate lambda between them,

00:04:37.100 --> 00:04:40.760
and what we'll see is that x
has to be exactly four times

00:04:40.760 --> 00:04:44.130
as large as y for
this to be true,

00:04:44.130 --> 00:04:46.830
for both of these equations
to be true at the same time.

00:04:46.830 --> 00:04:50.200
So we need x to be equal to 4y.

00:04:50.200 --> 00:05:02.620
So from the first two equations,
we have that x is equal to 4y,

00:05:02.620 --> 00:05:06.090
and now we can substitute that
in to the constraint equation.

00:05:06.090 --> 00:05:10.140
So if x is 4y, then x
squared is 16 y squared,

00:05:10.140 --> 00:05:15.720
so x squared plus 4 y
squared is 20 y squared.

00:05:15.720 --> 00:05:20.812
So we have 20y
squared is equal to 4.

00:05:20.812 --> 00:05:22.270
And OK, so we can
solve this for y.

00:05:22.270 --> 00:05:24.420
We can divide by 20
and take a square root,

00:05:24.420 --> 00:05:29.470
so we get that y-- well, so
y squared is equal to 1/5,

00:05:29.470 --> 00:05:33.010
so y is equal to plus or minus
1 over the square root of 5.

00:05:33.010 --> 00:05:37.630
But remember, come back over
here, we've taken (x, y)

00:05:37.630 --> 00:05:40.980
to be the upper right-hand
corner, this first quadrant

00:05:40.980 --> 00:05:45.190
corner of our rectangle,
so y is always positive.

00:05:45.190 --> 00:05:49.520
So we had that y squared
equals 1/5 and y is positive,

00:05:49.520 --> 00:05:50.940
so there's actually
only one root.

00:05:50.940 --> 00:05:52.773
We don't need to consider
the negative root.

00:05:52.773 --> 00:05:56.960
So over here, we know
that y is 1 divided

00:05:56.960 --> 00:06:00.140
by the square root of 5.

00:06:00.140 --> 00:06:01.810
OK, so that's y.

00:06:01.810 --> 00:06:02.450
Now what's x?

00:06:02.450 --> 00:06:04.890
Well, OK, so we solve
for x in terms of y,

00:06:04.890 --> 00:06:11.580
so x is equal to 4 over
the square root of 5.

00:06:11.580 --> 00:06:15.930
So Lagrange multipliers, when
we use the method of Lagrange

00:06:15.930 --> 00:06:20.010
multipliers, we get
this one possible point

00:06:20.010 --> 00:06:23.030
at which we have to
check to be the maximum.

00:06:23.030 --> 00:06:25.850
But remember that when you're
using Lagrange multipliers,

00:06:25.850 --> 00:06:28.227
you also have to worry about
the boundary of the region

00:06:28.227 --> 00:06:29.310
that you're interested in.

00:06:29.310 --> 00:06:32.450
So let's go look at
our picture again.

00:06:32.450 --> 00:06:36.250
So over on our picture,
this point (x, y)

00:06:36.250 --> 00:06:40.852
moved along the arc
connecting the topmost point

00:06:40.852 --> 00:06:43.060
of the ellipse to the
rightmost point of the ellipse.

00:06:43.060 --> 00:06:45.540
So we also have to
look at the perimeters

00:06:45.540 --> 00:06:48.930
when the point is
the topmost point

00:06:48.930 --> 00:06:50.920
and when the point is
the rightmost point.

00:06:50.920 --> 00:06:52.970
Now, in those two
cases, the rectangle

00:06:52.970 --> 00:06:56.350
is a sort of degenerate
rectangle, and when (x, y)

00:06:56.350 --> 00:07:00.380
is this point (0, 1),
it's sort of two copies

00:07:00.380 --> 00:07:05.000
of this vertical line, this
minor axis, and when (x, y)

00:07:05.000 --> 00:07:08.000
is the point (2, 0),
then our rectangle

00:07:08.000 --> 00:07:11.890
just looks like the major axis,
which is that horizontal line.

00:07:11.890 --> 00:07:14.130
But we still have
to check those cases

00:07:14.130 --> 00:07:17.760
to see whether our function
has a maximum and what it is.

00:07:17.760 --> 00:07:20.230
So we need to compute
the objective function

00:07:20.230 --> 00:07:23.080
value at this point and
we need to compute it

00:07:23.080 --> 00:07:25.050
at those endpoints.

00:07:25.050 --> 00:07:29.890
So we need to look at P
of-- so this is our point

00:07:29.890 --> 00:07:32.390
4 over the square
root of 5 comma

00:07:32.390 --> 00:07:35.730
1 over the square root of 5,
and we know that P of x, y

00:07:35.730 --> 00:07:40.470
is 4x plus 4y, so
that's equal to 20

00:07:40.470 --> 00:07:43.790
over the square root of 5,
which we can also write as 4

00:07:43.790 --> 00:07:46.120
times the square root of 5.

00:07:46.120 --> 00:07:48.140
And we also need to check
those two endpoints,

00:07:48.140 --> 00:07:52.692
so we need to check the
point P of 0, 1, so that's 4,

00:07:52.692 --> 00:07:57.720
and we need to check the
point P of 2, 0, so that's 8.

00:07:57.720 --> 00:08:00.910
So in order to find out what
the maximum value of P is,

00:08:00.910 --> 00:08:03.370
we need to compare
the value of P

00:08:03.370 --> 00:08:06.800
at the points given to us
by Lagrange multipliers

00:08:06.800 --> 00:08:11.470
and at the boundary points of
the region, which in this case

00:08:11.470 --> 00:08:12.920
are the endpoints of the arc.

00:08:12.920 --> 00:08:16.360
So we need to compare the
numbers 4 square root of 5, 4

00:08:16.360 --> 00:08:21.090
and 8, and indeed, 4 square root
of 5 is the largest of these.

00:08:21.090 --> 00:08:24.640
So this is the largest, so this
is actually the maximum value,

00:08:24.640 --> 00:08:25.190
OK?

00:08:25.190 --> 00:08:38.310
So the maximum perimeter
is 4 square root of 5

00:08:38.310 --> 00:08:50.440
when rectangle has its upper
rightmost vertex at this point:

00:08:50.440 --> 00:08:57.330
4 over square root of 5 comma
1 over square root of 5.

00:08:57.330 --> 00:09:00.360
So our rectangle's
maximal perimeter

00:09:00.360 --> 00:09:02.870
is 4 root 5, and
that occurs when

00:09:02.870 --> 00:09:06.180
the upper right-hand vertex is
at the point 4 over root 5, 1

00:09:06.180 --> 00:09:07.170
over root 5.

00:09:07.170 --> 00:09:12.220
So to quickly recap, we wanted
to apply the method of Lagrange

00:09:12.220 --> 00:09:14.050
multipliers to this problem.

00:09:14.050 --> 00:09:18.320
So we chose to keep
track of our rectangles

00:09:18.320 --> 00:09:20.170
by their upper
right-hand corner.

00:09:20.170 --> 00:09:24.880
And then that gave us-- the
perimeter was 4x plus 4y.

00:09:24.880 --> 00:09:26.240
That was our objective function.

00:09:26.240 --> 00:09:28.573
And the constraint was that
that upper right-hand corner

00:09:28.573 --> 00:09:30.590
actually had to
lie on the ellipse.

00:09:30.590 --> 00:09:36.170
So then we set the gradients
of the two functions equal

00:09:36.170 --> 00:09:38.090
and solved the
system of equations

00:09:38.090 --> 00:09:42.880
that we get by having those--
sorry, the gradients not to be

00:09:42.880 --> 00:09:44.350
equal, but to be parallel.

00:09:44.350 --> 00:09:48.160
There's some constant
multiple lambda that appears.

00:09:48.160 --> 00:09:50.420
So we set the gradients
to be parallel

00:09:50.420 --> 00:09:54.170
to each other and the
constraint equation to hold,

00:09:54.170 --> 00:09:57.920
and we solved those three
equation simultaneously

00:09:57.920 --> 00:10:00.270
for x and y.

00:10:00.270 --> 00:10:03.180
And those equations
gave us one point

00:10:03.180 --> 00:10:04.920
that we had to check
to be the maximum,

00:10:04.920 --> 00:10:06.680
and we also needed
to check points

00:10:06.680 --> 00:10:08.770
on the boundary of the
region in question.

00:10:08.770 --> 00:10:14.280
So here, those were just the
two points (0, 1) and (2, 0).

00:10:14.280 --> 00:10:16.140
So I'll end there.