[Math] Using Lagrange Multipliers to find the largest possible area of a rectangular box with diagonal length L.

multivariable-calculus

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.

Best Answer

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$.