let the side of square be x
Then remaining dimensions of cuboid for volume is
length18−2x, width 18−2x and height x
Volume(v)=(18−2x)2xdvdx=(18−2x)2−2x(18−2x)dvdx=(18−2x)(18−2x−2x)=(18−2x)(18−4x)
Nowdvdx=0 at x=9,92
Now,
d2vdx2=−4(18−2x)−2(18−4x)
at x=92=4.5d2vdx2<0∴atx=4.5 that is side of square for which we will get maximum volume