In Tuesday’s class we started but didn’t finish an example of maximizing a three-variable function subject to one constraint. For reference, here is the full solution to that example. The problem was the following:
The volume of such a box is $xyz$, so we are looking to maximize the function $f(x,y,z)=xyz$. The amount of material required to make such a box is equal to its surface area, which is $2xz+2yz+xy$. Since we are making our box from 12 square feet of material, we must therefore have $2xz+2yz+xy=12$. This equation is our constraint. Let’s denote the function on the right-hand side of this equation by $g(x,y,z)$.
As discussed in class, the critical points of $f$ subject to our constraint are the points which satisfy:
- $\nabla f = \lambda \nabla g$ for some number $\lambda$; and
As we computed in class, the first (vector) equation is equivalent to three equations (resulting from the coordinates of the vectors on both sides needing to be equal). As our class ended, we saw that we needed to solve the following system of four equations in four variables:
- $yz=\lambda (2z+y)$
- $xz=\lambda (2z+x)$
- $xy=\lambda (2x+2y)$
We ended class with the sad remark that there was no sure-fire way to solve such a system of equations. However, in this particular problem it can be done with a bit of elbow grease. Here is one way to do it.
First notice that if multiply the first equation by $x$, the second by $y$, and the third by $z$, we obtain the following three equations:
- $xyz=\lambda x(2z+y)$
- $xyz=\lambda y(2z+x)$
- $xyz=\lambda z(2x+2y)$
Notice that if $\lambda = 0$, then equations (1)-(3) imply $xy=xz=yz=0$, but then equation (4) is not satisfied. So we must have $\lambda\neq 0$. Equations (5) and (6) then together give
This equation simplifies to $(x-y)z=0$ (after a bit of algebra), and so either $x=y$ or $z=0$. Of course, if $z=0$ then the box has volume 0, so we can assume $z\neq 0$. We have therefore deduced that $x=y$.
Similarly, equations (6) and (7) together give
After a bit of simplification, this equation reduces to $x(y-2z)=0$. Again, we can assume $x\neq 0$, so this equation implies $y=2z$.
If we now plug in $x=y=2z$ to equation (4), we see that $12z^2=12$, and so $z=1$. Then $x=y=2$.
So, there is only one critical point, which must be the location of a global maximum in this situation (since the minimum volume is zero and there is clearly some maximum volume).
We can finally say that the optimal box is 2 feet wide, 2 feet long, and one foot tall. This box has a volume of 4 cubic feet, so that is the maximum of any open-top box we can make from 12 square feet of material.