2

I am trying to find the largest possible area of a rectangular box having diagonal length L, by method of Lagrange Multipliers.

Here is my approach:

Let $f(x,y) = xy$ define the area of a rectangular box with length $x$, width $y$.

By Pythagorean Theorem, $L^2 = x^2 + y^2$, so that $L = \sqrt{x^2+y^2}$.

Define the constraint function $G(x,y) = \sqrt{x^2 + y^2} - L$

Computing the gradients,

$\nabla f(x,y) = (y,x)$

$\nabla G(x,y) = (x(x^2+y^2)^{-1/2}, y(x^2+y^2)^{-1/2})$

Then by method of Lagrange Multipliers,

$$ y = \lambda x(x^2 + y^2)^{-1/2} $$

$$ x = \lambda y (x^2+y^2)^{-1/2}$$

It is clear to me that one candidate for a critical point is when $x = y = 0$ (from the gradient of f), and $f(0,0) = 0$. With some algebra you can also determine that $x^2 = y^2$ so that $x = y$. But that's as far as I can go. As I don't have any numerical values, I assume I'm finding a general expression that determines the largest possible area of the box.

Any help appreciated.

  • 1
    The critical point $(0,0)$ is irrelevant, as it does not satisfy the constraint. As you say, you can obtain $x=y$: if you put $y=x$ into the constraint, which value of $x$ (and so of $y$) do you get? – Angina Seng Apr 15 '17 at 21:47
  • 1
    $(x^2+y^2)^{-1/2}$ is undefined when $x=y=0$. Physical considerations should cause you to reject any solution that has a zero side length, too. BTW, you could’ve saved yourself a bit of work by using the squares of the lengths to construct $G$. – amd Apr 15 '17 at 21:55
  • You get $\sqrt2x = L$? How do I know that's an extreme value? – TimelordViktorious Apr 15 '17 at 21:58
  • Or that $x = \frac{L}{\sqrt{2}} = y$... – TimelordViktorious Apr 15 '17 at 22:04
  • You know that you’ve found a critical point. How would you go about classifying it in general? Typically, you’ll need to look at the Hessian (second derivative) at this point in directions tangent to the constraint curve. – amd Apr 15 '17 at 22:08
  • Really? The surface given by $z=xy$ is a classic example of a saddle. – amd Apr 15 '17 at 23:33
  • Yeah, perhaps I am misunderstanding something about this question. The fact that that there isn't anything numerical to work with is kind of tripping me. I don't get why it would be a saddle since detH(c) = 0 for me. – TimelordViktorious Apr 15 '17 at 23:58

1 Answers1

3

Picking up from a little bit before where you left off, we can use the constraint to simplify the system of equations to $$y=\frac\lambda L x,x=\frac\lambda Ly$$ with solutions $\lambda=L$, $x=\pm y$. The variables $x$ and $y$ represent physical lengths, so the only solution we’re interested in is $x=y\gt0$, from which $x=y=L/\sqrt2$. This isn’t too surprising: the symmetry of both the objective function and constraint already told us that something interesting was likely to happen at $x=y$.

To determine the nature of these critical points, we examine second derivatives just as we might in elementary calculus. Here, we need to look at the behavior along the constraint curve, which we can do with the Hessian of the objective function. This is a quadratic form obtained by differentiating $f$ twice that we apply to the tangent to the constraint curve at the point of interest. $\nabla G=(2x,2y)$ and the tangent to a level curve is orthogonal to the gradient, so at $(x,y)=(L/\sqrt2,L/\sqrt2)$ a tangent vector is $(-L\sqrt2,L\sqrt2)$. We can use any vector that points in the same direction for this, so for simplicity we’ll use $(-1,1)$. Applying the Hessian to this vector we get $$H_f(-1,1)=\pmatrix{-1&1}\pmatrix{0&1\\1&0}\pmatrix{-1\\1}=-2\lt0$$ so there’s a local maximum along the curve at $x=y$.

amd
  • 53,693
  • Ah. Thanks so much for your help. Regarding the tangent vector, does any tangent vector work? Why is (-1, 1) tangent to the constraint curve y = x? – TimelordViktorious Apr 16 '17 at 00:00
  • 1
    @TimelordViktorious The constraint curve is $x^2+y^2=L^2$. The graidient at $(x,y)$ is $(2x,2y)$, and tangents are orthogonal to the gradient. – amd Apr 16 '17 at 00:03
  • I'm still not really sure if I completely follow how you determined (-1, 1). What exactly did you do in the last step with the matrix multiplication? – TimelordViktorious Apr 16 '17 at 00:17
  • @TimelordViktorious See the update. If $M$ is the matrix of a quadratic form $Q$, then $Q(\mathbf v)=\mathbf v^TM\mathbf v$. – amd Apr 16 '17 at 00:29