Step 1:

Let $S$ be the given surface area of the closed cylinder whose radius is $r$ and height $h$.

Let $V$ be its volume.

Surface Area $S=2\pi r^2+2\pi rh$

$h=\large\frac{S-2\pi r^2}{2\pi r}$----(1)

Volume $V=\pi r^2h$

Substitute the value of h in the above equation

$\qquad\qquad=\pi r^2\bigg[\large\frac{S-2\pi r^2}{2\pi r}\bigg]$

$\qquad\qquad=\large\frac{1}{2}$$r(S-2\pi r)$

$\qquad\qquad=\large\frac{1}{2}$$[Sr-2\pi r^3]$

Differentiating with respect to r we get

$\large\frac{dV}{dx}=\frac{1}{2}$$[S-6\pi r^2]$

Step 2:

For maxima and minima $\large\frac{dV}{dx}$$=0$

$S-6\pi r^2=0$

$S=6\pi r^2$

From (1)

$h=\large\frac{S-2\pi r^2}{2\pi r}$

Substitute the value os S in the above equation

$h=\large\frac{6\pi r^2-2\pi r^2}{2\pi r}$

$\;\;=\large\frac{4\pi r^2}{2\pi r}$

$\;\;=2r$

$h=2r$

Step 3:

On double differentiation of V we get,

$\large\frac{d^2V}{dr^2}=\frac{1}{2}$$(-12\pi r)$

$\qquad=-6\pi r$

$\qquad=-ve$

$\therefore V$ is maximum

Thus volume is maximum when $h=2r$

(i.e)when height of cylinder =diameter of the base.