
From the figure:
$D^2 = d^2 + h^2$
$0 = 2d + 2h \dfrac{dh}{dd}$
$\dfrac{dh}{dd} = -\dfrac{d}{h}$
Volume of cylinder:
$V = \frac{1}{4}\pi d^2 h$
$\dfrac{dV}{dh} = \dfrac{\pi}{4} \left[ d^2 \dfrac{dh}{dd} + 2dh \right] = 0$
$d \dfrac{dh}{dd} + 2h = 0$
$d\left( -\dfrac{d}{h} \right) + 2h = 0$
$2h = \dfrac{d^2}{h}$
$d^2 = 2h^2$
$d = \sqrt{2} \, h$
$\text{diameter } \, = \sqrt{2} \, \times \, \text{ height }$ answer