The United States Postal Service charges more for boxes whose combined length and girth exceeds 108" (the “length” of a package is the length of its longest side; the girth is the perimeter of the cross section, i.e., \(2w + 2h\)). What is the maximum volume of a package with a square cross section (\(w = h\)) that does not exceed the 108" standard?
We want to maximize \(l\times w\times h\) subject to \(l + 2w + 2h \leq 108\). In general, this is a function of three variables. The problem allows us to make this a function of two variables by defining the cross section as a square. Now we have to maximize \(l\times w^2\) subject to \(l + 4w \leq 108\). We can make this a function of one variables by substituting the constraint into the function. Knowing that \(l = 108 - 4w\), we have to maximize\((108 - 4w)w^2\). So we will take the first derivative, set it to 0, and compare it to the endpoints of \(w\) which are \((0, 27)\). This is an open interval since a width of 0 or a length of 0 would result in a degenerate container.
\[ \begin{aligned} &\frac{d}{dw}\left((108 - 4w)w^2\right)\\ &= \frac{d}{dw}\left(108w^2 - 4w^3\right)\\ &= 216w - 12w^2 \end{aligned} \] \[ \begin{aligned} 216w - 12w^2 &= 0\\ 12w^2 &= 216w\\ 12w &= 216\\ w &= 18 \end{aligned} \]
Using the second derivative test we find: \[ \begin{aligned} &\frac{d^2 f}{dw^2}\left((108 - 4w)w^2\right)\\ &= 216 - 24w\\ &= 216 - 24\times 18\\ &= -216 < 0 \end{aligned} \]
As the value is less than 0, this extremum is a local maximum. So the dimensions of the package with the greatest volume subject to the constraints are \(18\times 18\times 36\) which has a volume of 11,664 cubic inches or 6.75 cubic feet.
We will now show that the above answer is the general maximum allowing for the cross section to be rectangular. The volume becomes a function of two variables. Therefore, we need to find the partial derivatives with respect to both, set them equal to 0, and solve. Once we have the values, we can use the second derivative test to check the extremum. Once again, we need to check at the endpoints, but as the endpoints for any of these dimensions would result in it or another dimension being 0, we can assume the extremum will not occur there as the volume would be 0.
\[ \begin{aligned} f(w, h) &= \left(108 - 2w - 2h\right)wh\\ &= 108wh - 2w^2h - 2wh^2\\ \frac{\partial f}{\partial w} &= 108h - 4wh - 2h^2\\ \frac{\partial f}{\partial h} &= 108w - 4wh - 2w^2\\ 108h - 4wh - 2h^2 &= 0\\ 54 - 2w - h &= 0\\ 108w - 4wh - 2w^2 &= 0\\ 54 - 2h - w &= 0\\ 54 - 2w - h &= 54 - 2h - w\\ \mathbf{h} &= \mathbf{w}\\ 54 - 2w - w &= 0\\ 54 &= 3w\\ \mathbf{w} &= \mathbf{18}\\ \mathbf{h} &= \mathbf{18}\\ \mathbf{l} &= 108 - 36 - 36 = \mathbf{36}\\ \frac{\partial^2 f}{\partial w^2} &= -4h = -4\times 18 =-72\\ \frac{\partial^2 f}{\partial h^2} &= -4w = -4\times 18 =-72\\ \frac{\partial^2 f}{\partial w\partial h} &= 108 - 4w - 4h = 108 - 72 - 72 = -36\\ D &= \frac{\partial^2 f}{\partial w^2}\cdot\frac{\partial^2 f}{\partial h^2} - \left(\frac{\partial^2 f}{\partial w\partial h}\right)^2\\ &= (-72)^2 - \left(-36\right)^2\\ &= 5184 - 1296\\ &= 3888 > 0 \end{aligned} \]
So \(D > 0\) and \(\frac{\partial^2 f}{\partial w^2} < 0\) so the point is a local maximum, and the optimum container volume has dimensions \(18\times 18\times 36\), as above.