$V = (24 - 2x)(18 - 2x)x$
$V = 2x(12 - x)(9 - x)$
$V = 2x(108 - 21x + x^2)$
$V = 216x - 42x^2 + 2x^3$
To maximize, differentiate and equate to zero
$\dfrac{dV}{dx} = 216 - 84x + 6x^2 = 0$
$x^2 - 14x + 36 = 0$
$x = 10.6 \text{ and } 3.4$
$\text{Use } x = 3.4 \text{ inches}$ ← answer