.
The dimensions of the box are (12-2x) inches (each the length and the width of the base).
The height of the box is x inches.
The volume of the box is
V(x) = x*(12-2x)*(12-2x) = x*(144 - 48x + 4x^2) = 4x^3 - 48x^2 + 144x.
To determine the maximum of the function V(x), take the derivative
V'(x) = 12x^2 - 96x + 144
and equate it to zero
12x^2 - 96x + 144 = 0.
It gives
x^2 -8x + 12 = 0
Factor left side
(x-6)*(x-2) = 0.
The two roots are x= 6 and x= 2.
The volume at x= 6 is equal to zero, so this root, although provides the local minimum, does not give a real solution.
The volume at x= 2 is V(2) = 2*(12-2*2)*(12-2*2) = 2*8*8 = 128 cubic inches.
It is the real maximum and the real solution to the problem.
Plot V(x) = 4x^3 -48x^2 + 144x.