Solution (source code)

= Solution

Take positive dimensions measured in metres. The <volume> is $V=lwh$ and the external <surface area> constraint is $S=lw+2lh+2wh=12$. There is one base and four walls, with no lid. The <Lagrange multiplier> equations for $V-\lambda(S-12)$ are
$$
wh=\lambda(w+2h),\qquad lh=\lambda(l+2h),\qquad lw=2\lambda(l+w).
$$
The first equation implies $\lambda>0$. Multiply the first by $l$ and the second by $w$ and subtract; this gives $2\lambda h(l-w)=0$, hence $l=w=s$. The last equation gives $\lambda=s/4$. Substituting into the first yields $sh=(s/4)(s+2h)$ and therefore $s=2h$.

The constraint now reads $s^2+4sh=3s^2=12$. Thus
$$
\boxed{l=w=2\ \mathrm m,\qquad h=1\ \mathrm m,\qquad V_{\max}=4\ \mathrm{m^3}.}
$$
For a global check, apply the <arithmetic-geometric mean inequality> to $lw$, $2lh$ and $2wh$, whose sum is $12$. Their product is $4V^2\leq4^3=64$, so no feasible box has $V>4$. Equality holds exactly at the dimensions found above. This is the <maximum-volume open rectangular box at fixed surface area>.