The sheet of metal we have has sides equal to a. Let the sides of the squares that are cut from all the corners be x.

Now we have a length equal to a – 2x, to fold on all the sides and create the box.

The volume of the box is (a – 2x)^2*x = (a^2 + 4x^2 – 4ax)*x

V = a^2x + 4x^3 – 4ax^2

To maximize V, we find its derivative.

V’ = a^2 + 12x^2 – 8ax

This is equated to 0

=> 12x^2 – 8ax + a^2= 0

=> 12x^2 – 6ax -2ax + a^2 = 0

=> 6x (2x – a) – a (2x – a) = 0

=> (6x – a) (2x – a) = 0

=> x = a/6 and x = a/2

Now, we have two values of x and we have to determine which value provides the maximum volume.

V’’ = 24x – 8a,

at x = a/2, V’’ = 12a – 8a = 4a.

As the second derivative is positive at x = a/2, we have a minimum value here.

The volume of the box is maximum at x = a/6 and the volume is equal to a^2*a/6 + 4(a/6)^3 – 4a*(a/6)^2

=> a^3 / 6 + a^3(4/6^3) – (4/36)*a^3

=> 2a/27

**The maximum volume of the box is 2a/27.**