<s>[INST] Maximizing the volume of a cuboid with constraints (lagrange) fails? Given is the following (translated) problem:
You have $12$ meters of wire.
Try to build a wireframe model of a cuboid with sidelengths $x, y, z$ and maximize volume $V(x,y,z)=xyz$.
Show that this is the case iff all sidelengths are equal.
My attempt:
Using Lagrange with the constraint $g(x,y,z)=x+y+z-3$ leads to:
$$\nabla L(x,y,z,\lambda)=\begin{pmatrix}
           yz+\lambda \\
           xz+\lambda \\
           xy +\lambda \\
           x+y+z-3
         \end{pmatrix} \stackrel{!}{=}0$$
After solving I get:
$$x=y=z=1$$
$$\lambda = -1$$
I calculate the Hessian matrix afterwards and get:
$$H_L=\begin{pmatrix}
           0 & z & y & 1\\
           z & 0 & x & 1 \\
           y & x & 0 & 1  \\
           1 & 1 & 1 & 0
         \end{pmatrix}$$
Inserting previous values produces this matrix:
$$H_L=\begin{pmatrix}
           0 & 1 & 1& 1\\
           1 & 0 & 1 & 1 \\
           1 & 1 & 0 & 1  \\
           1 & 1 & 1 & 0
         \end{pmatrix}$$
Now the problem:
This matrix has eigenvalues $3$ and $-1$, which should mean it's indefinite and therefore has as saddle point/ no minimum or maximum.
Did I do something wrong or is it not possible to solve this problem with lagrange?
 [/INST] We have to consider the so-called Bordered Hessian that is the Hessian of the Lagrange function. Here, at the point $(1,1,1,-1)$, it is equal to
$$H_L=\begin{pmatrix}
0 & g_x & g_y& g_z\\
g_x & L_{xx} & L_{xy} & L_{xz} \\
g_y & L_{yx} & L_{yy} & L_{yz}  \\
g_z & L_{zx} & L_{zy} & L_{zz}
\end{pmatrix}=\begin{pmatrix}
0 & 1 & 1& 1\\
1 & 0 & 1 & 1 \\
1 & 1 & 0 & 1  \\
1 & 1 & 1 & 0
\end{pmatrix}$$
Since we have one constraint, i.e. $m=1$, and there are three variables, a sufficient condition for a local maximum for the constrained problem is that determinant of the $3\times3$ principal minor is positive and the determinant of the entire matrix is negative.
It is easy to verify that both conditions holds:
$$\left|\begin{matrix}
0 & 1 & 1\\
1 & 0 & 1\\
1 & 1 & 0
\end{matrix}\right|=2>0,\quad\left|\begin{matrix}
0 & 1 & 1& 1\\
1 & 0 & 1 & 1 \\
1 & 1 & 0 & 1  \\
1 & 1 & 1 & 0
\end{matrix}\right|=-3<0.$$
and therefore the point $(1,1,1)$ is a maximum for your constrained  problem.
</s>