Answer
$20\;cm$
Work Step by Step
In the part (a) of this problem, we have formulated that
$x=2\sqrt {h(H-h)}$
Now,
$\frac{dx}{dh}=\frac{1}{\sqrt {h(H-h)}}(H-2h)$
For maximum value of $x$
$\frac{dx}{dh}=0$
or, $\frac{1}{\sqrt {h(H-h)}}(H-2h)=0$
or, $H-2h=0$
or, $h=\frac{H}{2}$
or, $h=\frac{40}{2}\;cm$
or, $h=20\;cm$
Therefore, a hole should be made at a depth $20\;cm$ to maximize $x$