Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Maximize volume of a rectangular box

  1. Mar 13, 2010 #1
    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]

    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.

    Thanks for your help.
  2. jcsd
  3. Mar 13, 2010 #2


    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Education Advisor

    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.
  4. Mar 14, 2010 #3
    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[tex]\sqrt{3}[/tex] and you will get the volume.




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


    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
    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
    about 9.83
    Last edited: Mar 14, 2010
  5. Mar 14, 2010 #4


    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Education Advisor

    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?

  6. Mar 14, 2010 #5
    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

    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
    Plug that into above equation.
    now becomes
    simplifies to 12z2-8z-4=0
    factors to 4(3z-1)(z+1)=0
    plug this back into constraint equation knowing that x=y
    Volume of box = (4/3)(4/3)(1/3)=16/27
  7. Mar 14, 2010 #6


    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Education Advisor

    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.
  8. Mar 14, 2010 #7
    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.
  9. Mar 14, 2010 #8


    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Education Advisor

    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.
  10. Mar 14, 2010 #9
    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


    and xy = 4yz

    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

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

    solving this for z
    z=0 which can't be true. and z=2/3
    now solving for x and y

    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?
  11. Mar 14, 2010 #10


    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Education Advisor

    Yup, you're done.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook