Let r and h be the radius and height of the cylinder respectively. Then, the surface area (S) of the cylinder is given by,

Let V be the volume of the cylinder. Then,


Hence, the volume is the maximum when the height is twice the radius i.e., when the height is equal to the diameter.