Using Lagrange Multipliers with a Function of Three Variables

A container in the shape of a rectangular box is open on top and has a fixed volume of 12 m\(^3\). The material used to make the bottom of the container costs $3 per square meter, while the material used for the sides costs $1 per square meter. What dimensions will minimize the cost of material?

Solution Let \(x\) be the width of the container, \(y\) its depth, and \(z\) its height. Then its volume is \(xyz=12.\) The cost function \(C=C(x,y,z)\), which is to be minimized, is \[ C(x,y,z) =3xy+2xz+2yz \]

We use Lagrange multipliers.

Step 1 The objective is to minimize \(C\) subject to the constraint \(g(x,y,z)=xyz-12=0\).

Step 2 The functions \(C\) and \(g\) each have continuous partial derivatives.

Step 3 We solve the system of equations \({\nabla }C(x,y,z) =\lambda {\nabla }g(x,y,z)\) and \(g(x,y,z) =0\). \[ \left\{\begin{array}{lllll} 3y+2z &=&\lambda yz \qquad {\color{#0066A7}{\hbox{\(C_{x}(x,y,z) =\lambda g_{x}( x,y,z)\)}}} \enspace \enspace {\color{#0066A7}{\hbox{(\(1\))}}}\\ 3x+2z &=&\lambda xz \qquad {\color{#0066A7}{\hbox{\(C_{y}(x,y,z) =\lambda g_{y}( x,y,z)\)}}} \enspace \enspace {\color{#0066A7}{\hbox{(\(2\))}}}\\ 2x+2y &=&\lambda xy \qquad {\color{#0066A7}{\hbox{\(C_{z}(x,y,z) =\lambda g_{z}( x,y,z)\)}}} \enspace \enspace {\color{#0066A7}{\hbox{(\(3\))}}}\\ xyz-12 &=&0 \qquad \enspace \enspace \enspace {\color{#0066A7}{\hbox{\(g( x,y,z) =0\)}}}\quad \enspace \qquad \enspace \enspace \enspace{\color{#0066A7}{\hbox{(\(4\))}}} \end{array}\right. \]

Now we use the facts that \(x>0\), \(y>0\), and \(z>0\) to solve the first three equations for \(\lambda\), obtaining \[ \lambda =\dfrac{3}{z}+\frac{2}{y}\enspace {\color{#0066A7}{\hbox{(\(5\))}}} \qquad \lambda =\frac{3}{z}+\frac{2}{x}\enspace {\color{#0066A7}{\hbox{(\(6\))}}} \qquad \lambda =\dfrac{2}{y}+\frac{2}{x}\enspace {\color{#0066A7}{\hbox{(\(7\))}}} \]

From these, we find that \[ \begin{eqnarray*} y &=&x \qquad \enspace\enspace\enspace {\color{#0066A7}{\hbox{From equations (5) and (6)}}}\\ z &=&\dfrac{3}{2}x \qquad \enspace \enspace {\color{#0066A7}{\hbox{From equations (5) and (7)}}} \end{eqnarray*} \]

If we substitute these two equations into \(xyz-12=0\), we find \[ \begin{eqnarray*} xyz-12& =&0 \\[4pt] x( x) \left( \dfrac{3}{2}x\right) -12& =&0 \\[4pt] \frac{3}{2}x^{3}& =&12 \\[4pt] x& =&2 \end{eqnarray*}

Then \(y=2,\) \(z=3,\) and the test point is \((2,2,3)\).

Step 4 The dimensions of the container that minimize the cost are 2 m by 2 m by 3 m. The minimum cost is \(C(2,2,3)=3 ( 2) ( 2) +2 ( 2) (3) +2 ( 2) ( 3) =$36.\)