if the base length is x and height is y
the volume= x^2y=32 so, y=32/x^2
now, the surface area= (area of x sided square){ below}+4xy(rectangular side with length y, breadth x)
=x^2+4xy= x^2+4x*32/x^2= x^2+128/x
so, after first derivative
f'(x)=2x-128/x^2
f'(x)=0 at x=4
f''(x)=2+256/x^3 (second derivative)
the second derivative is positive at x=4
so, the function has a minima at x=4,
y=32/x^2=32/16=2
so, the surface area will be minimum at x=4 and y=2