Answer
$y=\frac{h}{2}$.
Work Step by Step
Step 1. Using the figure given in the exercise, the height of the exit beam of water is $y$.
Step 2. Let $-g$ represent the acceleration due to the Earth’s gravity. We have the vertical velocity $v_y=\int (-g)dt=-gt+C$, where $C$ is a constant.
Step 3. Since at $t=0$, $v_y(0)=0$, we have $C=0$ and $v_y=-gt$.
Step 4. The vertical distance is given by $s=\int vdt=\int (-gt)dt=-\frac{1}{2}gt^2+D$ where $D$ is a constant.
Step 5. Since at $t=0, s=y$, we have $D=y$ and $s=y-\frac{1}{2}gt^2$.
Step 6. When the water hits the ground, we have $s=0$ and $t=\sqrt{2y/g}$.
Step 7. Knowing the exit velocity (horizontal) as $v_x=\sqrt{64(h-y)}$, the range (indicated in the figure of the exercise) will be $R=v_xt=\sqrt{64(h-y)} \sqrt{2y/g}$.
Step 8. Letting $D=R^2=\frac{128}{g}(hy-y^2)$, we can find the maximum of $D$ by letting $D’=0$ which gives $h-2y=0$ or $y=\frac{h}{2}$.
Step 9. We can confirm it is a maximum by checking $D’’=-2\lt 0$. Since $R$ reaches a maximum when $D$ is a maximum, the optimum height for the maximum range is $y=\frac{h}{2}$.