Answer:
Let x be the width of the compartment,
⇒ The length of the compartment = x + 2
⇒ the depth of the compartment = x -1
Thus, the volume of the compartment,

The volume of the compartment must be 8 cubic meters.
⇒

⇒

⇒

If
and if

But, we can not take width as a complex number.
⇒ Width of the compartment = 2 meter.
Length of the compartment = 2 + 2 = 4 meter.
Depth of the compartment = 2 - 1 = 1 meter.
Here, the function that shows the volume of the compartment is,

When we lot the graph of that function we found,
as

But we can not take width as infinite.
Therefore, the maximum value of V(x) will be 8 at x = 2.