# Homework Help: Maximize volume of a rectangular box

1. Mar 13, 2010

### theno1katzman

1. The problem statement, all variables and given/known data

Find the volume of the largest rectangular box in the first octant with three faces in the coordinate planes and one vertex in the plane x + y + 4z = 4

2. Relevant equations

Volume of a box with L being the length of a diagonal in that box = L3/(3sqrt3)

Shortest distance from any point (x,y,z) to a plane with normal vector [a,b,c]
abs(ax+by+cz+d)/(sqrt(a2+b2+c2))

3. The attempt at a solution

L = distance from (0,0,0) to plane x +y+4z=4
= abs(-4)/sqrt(18)
= 4/(3sqrt2)

V= (4/(3sqrt2))3/(3sqrt3)
= 32/81sqrt6

Now I realized that what I did here that was wrong was I assumed that the shortest distance to the plane was that diagonal. But it doesn't have to be, or does it?

Is there only one way that the box can have a vertex on that plane? I figured that you can change the shape of the box and a vertex will hit the plane somewhere else.

2. Mar 13, 2010

### vela

Staff Emeritus
Nope. Minimizing L would minimize V whereas you want to maximize the volume. Also, does that formula you're using apply to rectangular boxes in general or to just a cube? (I don't know, but I suspect it's just a cube.)
Right, the shape of the box is subject only to the constraint that the vertex lies somewhere on the specified plane.

This problem is one of maximizing a function subject to a constraint, which suggests you use Lagrange multipliers.

3. Mar 14, 2010

### theno1katzman

Ok here is the problem worked out again.
The vertex on the box that is located on the plane can be found by the graph if you were to draw this situation.
pt (4-x,4-y,1-z) using simple geometry.

Now the distance from the origin to this point is going to be the diagonal of this box, cube the diagonal and divide by 3$$\sqrt{3}$$ and you will get the volume.

Vx=$$\lambda$$gx

Vy=$$\lambda$$gy

Vz=$$\lambda$$gz

Taking those partial derivatives you will get 3 equations using the multipliers to tie them to each other, you get

16(x-4)2=16(y-4)2=(z-1)2

x=y so 16(x-4)2=(z-1)2
or 4(x-4)=(z-1) solving for z you will get z=4x-15

now I was told to use the constraint of the equation of the plane to figure out x, y and z, becuase I don't know how to find the values of them otherwise.
placing z and y in terms of x in the constraint
x + y + 4z = 4
yields
x + x + 4x -60 =4
and x = 32/9
y= 32/9
and z = 7/9

(z was actually -7/9 but I took the opposite of it because it can't be negative, this is the part of the problem that you may have a problem with)
and your answer for volume, multiply them together and you will get

Last edited: Mar 14, 2010
4. Mar 14, 2010

### vela

Staff Emeritus
Your explanation unfortunately omits a lot of details. I can't figure out what you did.
What is this?
What are the V's and the g's?
How did you get this?

5. Mar 14, 2010

### theno1katzman

Ok there is another way to get the volume of that box. The volume is going to be V=lwh. Length of the box is going to be 4-x. Width 4-y. And height 1-z.
V= (4-x)(4-y)(z-1)
= 16z-4xz-4yz +xyz-16+4x +4y -xy

The three partial derivatives set equal to zero
Vx =-4z +yz+4-y = 0
Vy =-4z +xz +4 -x =0
Vz = 16- 4x -4y +xy =0

If you use lagrange multipliers you can tie the equations together.
Like I said before,
lambda*gx = Vx
lambda = -4z +yz+4-y
(remember g(x,y,z) was x+y+4z=4)
lambda*gy = Vy
lambda =-4z +xz +4 -x
lambda*gz = Vz
4*lambda =16- 4x -4y +xy

Now the first two can be set equal to each other because they both equal lambda.
-4z +yz+4-y = -4z +xz +4 -x
This simplifies to x=y

Using that known information in Vz
16- 4x -4x +x2 = 4lambda=4(-4z +xz +4 -x)
This simplifies to
x2-4x+16z-4xz=0

But from the constraint equation of the plane x + y+ 4z=4
2x+4z=4 because x=y at that point
x+2z=2 divide by 2
x=2-2z
Plug that into above equation.
x2-4x+16z-4xz=0
now becomes
(2-2z)2-4(2-2z)+16z-4(2-2z)z=0
simplifies to 12z2-8z-4=0
factors to 4(3z-1)(z+1)=0
z=1/3
plug this back into constraint equation knowing that x=y
2x+4(1/3)=4
x=y=4/3
Volume of box = (4/3)(4/3)(1/3)=16/27

6. Mar 14, 2010

### vela

Staff Emeritus
You're being inconsistent. Here you said:
I'm not sure how you came up with 4-x, 4-y, and 1-z as the lengths of the sides, and then you flipped the sign of 1-z when you plugged it into formula for the volume.

Finally, at the end, you say:
So now you're saying V isn't (4-x)(4-y)(1-z) nor (4-x)(4-y)(z-1), but xyz.

7. Mar 14, 2010

### theno1katzman

I'm going to go back and fix those silly errors but other than that I presume the calculus to be correct?

The lengths of the sides of the rectangular box come from geometry and looking at the object. If you draw that plane x +y+4z=4 it intersects the y axis at (0,4,0) and that gives the length from the origin to the point 4. I split the length into y and 4-y where 4-y is the length of the side of the box. I did this rather than just saying that the length was y.
The width would be the same deal, using the x values, and would be 4-x.
The height would be found the same way, 1-z.

The points on the edges of that box that lie on the coordinate axes are as follows.
For the y axis, the point (0,4-y,0)
x axis (4-x,0,0) and z axis (0,0,1-x). Now that would make the vertex that lies on the plane (4-x,4-y,1-z)

The volume of that box is the (4-x)(4-y)(1-z) because of the distance from (0,4-y,0) to (0,0,0) is 4-y,
distance from (4-x,0,0) to (0,0,0) is 4-x,
distance from (0,0,1-x) to (0,0,0) is 1-z.

8. Mar 14, 2010

### vela

Staff Emeritus
So what you did was define new variables x', y', and z' such that x=4-x', y=4-y', and z=1-z'. Then V=xyz=(4-x')(4-y')(1-z'). You need to express g(x,y,z) in terms of the new variables, however, if you want to use this approach. Or you could just use V=xyz and redo your calculations.

9. Mar 14, 2010

### theno1katzman

If V=xyz and g(x,y,z) = x +y + 4z =4 Then to maximize the volume of the box, you would use three partial derivatives tied to each by the Lagrange multipliers.

Vx= lambda*gx
yz= lambda
Vy= lambda*gy
xz= lambda
Vz= lambda*gz
xy= lambda*4

yz=xz
y=x

and xy = 4yz
x2=4xz
x=4z

then, x + y + 4z =4 becomes 4z + 4z + 4z = 4
z = 1/3
then x = 4/3 and y=4/3.

This will give the volume of the box to be 16/27.

Now if I used the point (4-x,4-y,1-z).
I get equation for volume
V=(4-x)(4-y)(1-x) and equation for plane (4-x)+(4-y)+4(1-z)=4
which simplifies to x + y+ 4z = 8

Vx= lambda*gx
-4 +y+4z-yz= lambda
Vy= lambda*gy
-4 +x+4z-xz= lambda
Vz= lambda*gz
-16 +4x+4y-xy= lambda*4

Setting the first equation to the second will show that y=x like before.

Setting the third equation equal to four times the first will show that
16z-4xz-4x+x2=0

From the equation of the plane x+y+4z=8 (remember it changed from using the new point (4-x,4-y,1-z))
x=4-2z
Plug this into the above equation.
16z-4(4-2z)z-4(4-2z)+(4-2z)2=0

solving this for z
12z2-8z=0
4z(3z-2)=0
z=0 which can't be true. and z=2/3
now solving for x and y
x=4-2(2/3)
x=8/3
y=8/3

And then the volume (4-8/3)(4-8/3)(1-2/3) = 16/27

Now are we done? The volume was what they asked for. Did this maximize it?

10. Mar 14, 2010

### vela

Staff Emeritus
Yup, you're done.