JOEL LEWIS: Hi.
Welcome back to recitation.
In lecture, you've been learning about how to solve
multivariable optimization problems using the method of
Lagrange multipliers, and I have a nice problem here for
you that can be solved that way.
So in this problem, we've got an ellipse, the ellipse with
equation x squared plus for 4y squared equals 4.
So that's this ellipse, and we want to inscribe a rectangle
in it, so here I mean actually a rectangle whose edges are
parallel to the axes.
So I want to inscribe a rectangle in this ellipse, and
among all such rectangles, I want to find the one with the
largest perimeter.
So I want to find the maximal perimeter of a rectangle that
can be inscribed in this ellipse.
So why don't you have a go at solving this problem, pause
the video, work it out, come back, and we
can work it out together.
So hopefully, you've had some luck working on this problem.
Let's get started on it.
So one thing we need to start is we need to figure out a way
to sort of describe these rectangles in a way that will
let us describe their perimeter, write down what
their perimeter is.
So a natural way to do that is to call this upper right-hand
corner of the rectangle, to call it the point x, y.
So x, y is going to be that upper right-hand corner of the
rectangle, and it's going to be ranging over the region
from this topmost point on the ellipse down to this rightmost
point on the ellipse, on this quarter arc of the ellipse.
So if that point is x, y, we need to figure out what is the
perimeter that we're trying to optimize.
So the perimeter here, P, which is a function of x and
y-- well, so x is this distance, so the length of the
horizontal edge of the rectangle is 2x, and we've got
two of those, so that's 4x from the horizontal sides.
And then this height is y, so the length of the vertical
side of the rectangle is 2y, so the perimeter is going to
be 4x plus 4y.
So that's our objective function that we're trying to
optimize, that we're trying to find the maximum of.
And we also have the constraint function g, which
is x squared plus 4y squared, and the constraint is that g
is equal to 4.
So we have the objective function P--
P of x, y-- and we have this constraint function g, and so
we want to write down some equations using Lagrange
multipliers whose solutions will correspond to the
possible maximum points of P.
So what are those equations?
Well, we need that the gradient of P is parallel to
the gradient g.
So that means that we need Px is equal to lambda times gx
and Py is equal to lambda times gy for
some value of lambda.
We need to find a value of lambda that makes this true.
And then also, our third equation is the constraint
equation, that g is equal to 4.
So what is Px equal lambda gx translate to in our case?
Let's just draw a line here.
So in our case, Px is the x partial derivative of 4x plus
4y, so that's just 4, and gx, we take the partial derivative
with respect to x of x squared plus 4y squared, and that's
equal to 2x, so 4 is equal to lambda times 2x.
And from taking the y partial derivatives, we have that the
y partial derivative a P is 4, Py is 4, and gy is going to be
the y partial derivative of x squared plus 4y squared, so
that's 8y, so 4 equals lambda times 8y, and we also have the
constraint equation x squared plus 4y squared equals 4.
So we need to solve these three equations, and we need
to figure out which values of x and y are the solutions.
So I think the simplest way to proceed here is to note that
from the first equation and the second equation, we can
eliminate lambda between them, and what we'll see is that x
has to be exactly four times as large as y for this to be
true, for both of these equations to be
true at the same time.
So we need x to be equal to 4y.
So from the first two equations, we have that x is
equal to 4y, and now we can substitute that in to the
constraint equation.
So if x is 4y, then x squared is 16y squared, so x squared
plus 4y squared is 20y squared.
So we have 20y squared is equal to 4.
And OK, so we can solve this for y.
We can divide by 20 and take a square root,
so we get that y--
well, so y squared is equal to 1/5, so y is equal to plus or
minus 1 over the square root of 5.
But remember, come back over here, we've taken x, y to be
the upper right-hand corner, this first quadrant corner of
our rectangle, so y is always positive.
So we had that y squared equals 1/5 and y is positive,
so there's actually only one root.
We don't need to consider the negative root.
So over here, we know that y is 1 divided by the
square root of 5.
OK, so that's y.
Now what's x?
Well, OK, so we solve for x in terms of y, so x is equal to 4
over the square root of 5.
So Lagrange multipliers, when we use the method of Lagrange
multipliers, we get this one possible point at which we
have to check to be the maximum.
But remember that when you're using Lagrange multipliers,
you also have to worry about the boundary of the region
that you're interested in.
So let's go look at our picture again.
So over on our picture, this point x, y moved along the arc
connecting the topmost point of the ellipse to the
rightmost point of the ellipse.
So we also have to look at the perimeters when the point is
the topmost point and when the point is the rightmost point.
Now, in those two cases, the rectangle is a sort of
degenerate rectangle, and when x, y is this point 0, 1, it's
sort of two copies of this vertical line, this minor
axis, and when x, y is the point 2, 0, then our rectangle
just looks like the major axis, which is
that horizontal line.
But we still have to check those cases to see whether our
function has a maximum and what it is.
So we need to compute the objective function value at
this point and we need to compute it at those endpoints.
So we need to look at P of--
so this is our point 4 over the square root of 5 comma 1
over the square root of 5, and we know that P of x, y is 4x
plus 4y, so that's equal to 20 over the square root of 5,
which we can also write as 4 times the square root of 5.
And we also need to check those two endpoints, so we
need to check the point P of 0, 1, so that's 4, and we need
to check the point P of 2, 0, so that's 8.
So in order to find out what the maximum value of P is, we
need to compare the value of P at the points given to us by
Lagrange multipliers and at the boundary points of the
region, which in this case are the endpoints of the arc.
So we need to compare the numbers 4 square root of 5, 4
and 8, and indeed, 4 square root of 5 is
the largest of these.
So this is the largest, so this is actually the
maximum value, OK?
So the maximum perimeter is 4 square root of 5 when
rectangle has its upper rightmost vertex at this
point: 4 over square root of 5 comma 1 over square root of 5.
So our rectangle's maximal perimeter is 4 root 5, and
that occurs when the upper right-hand vertex is at the
point 4 over root 5, 1 over root 5.
So to quickly recap, we wanted to apply the method of
Lagrange multipliers to this problem.
So we chose to keep track of our rectangles by their upper
right-hand corner.
And then that gave us-- the perimeter was 4x plus 4y.
That was our objective function.
And the constraint was that that upper right-hand corner
actually had to lie on the ellipse.
So then we set the gradients of the two functions equal and
solved the system of equations that we get by having those--
sorry, the gradients not to be equal, but to be parallel.
There's some constant multiple lambda that appears.
So we set the gradients to be parallel to each other and the
constraint equation to hold, and we solved those three
equation simultaneously for x and y.
And those equations gave us one point that we had to check
to be the maximum, and we also needed to check points on the
boundary of the region in question.
So here, those were just the two points 0, 1 and 2, 0.
So I'll end there.