S is the total surface area of the closed right circular cylinder whose radius is r, height is h, and volume is V.
Then surface area `S= 2pir^2+2pirh`
`h= (S-2pir^2)/(2pir)` ------ (i)
Volume `V = pir^2h=pi[(S-2pir^2)/(2pir)]= 1/2[Sr-2pir^3]`
For extrema (maxima or minima) dV/dr=0
`rArr S = 6pir^2`
Plugging this value of S in eq.(i),we get
h (at V-extrema)=`(6pir^2-2pir^2)/(2pir) =2r `
For maxima, `(d^2V)/(dr^2)= -6pir` = negative
Therefore, V is maximum when height, h = 2r = diameter of the base.