We want to construct a right prism (a 3 dimensional rectangular box) which doesn't have a cap. The material in which is constructed its base costs 5 times the material its walls are made of. (cost is per unit of area).

I have to find the dimensions of the right prism that minimize its cost, considering that its volume must be V.

My attempt : I've the constraint $\displaystyle xyz=V$. I'm not really sure about the function I have to minimize. I've thought about $\displaystyle 5xz+2yz$ since the price of an area unit of $\displaystyle xy=5$ times the area unit of $\displaystyle xz$ and $\displaystyle yz$.

So I'd have to work out the critical points of $\displaystyle 5xz+2yz+\lambda (xyz-V)$ but I found a contradiction by doing so ($\displaystyle x=\frac{x}{2} \Rightarrow x=0, z=+\infty$).

So I know I made an error by chosing the function $\displaystyle f(x,y,z)=5xz+2yz$. I'd like a bit of help to chose the right function to minimize. Thanks in advance.