I need to find minimum of objective function $Q=f(x,y,z)$ inside a cube region. Hence the constraints are in the form $0 \leq x \leq 1$ and $0 \leq y \leq 1$ and $0 \leq z \leq 1$. Should the Lagrangian be
$$ L = Q + \lambda_1(x) + \lambda_2(1-x) + \lambda_3(y) + \lambda_4(1-y) + \lambda_5(z) + \lambda_6(1-z) $$
All the examples I've seen have constraints on one side, such as $x\leq 1$, but what to do when the constraints have inequality on both sides? In general, how do I constraint the $Q$ for minimization inside 3D object such a cube.
addition:
An example $Q= n-z-x-y+x^2+y^2$ where $n$ is a number. and I want to find its min in a cube, hence constraints are the sizes of each of the three edges as given above. Just need to know how to write the constraints.
There is no one Lagrangian that will solve this problem. The minimum could be:
That's $1 + 6 + 12 + 8 = 27$ different cases. In general, you would have to solve each case, and reject all solutions that are not in the cube or on its surface. But perhaps your $Q$ allows some simplifications. Is $Q$ fixed? Or perhaps the second derivative matrix is positive definite?