Let L = Length
Let L = Width ( property of squares)
Let H = Height
Then the volume V = L*L*H = 50ft^3
The cost for the top and bottom is ($2/ft^2)(L*Lft^2 + L*Lf t^2) = ($2/ft^2)(2L^2ft^2)= $4L^2
The cost of the sides = 4*$7*L*H= $28L*H
So you want to minimize the cost c = $4L^2+ $28L*H subject to L*L*H = 50ft^3
Just get rid of one variable in the c equation, take the derivative of c and ....