Maximum projectile range from an elevated launch (source code)

= Maximum projectile range from an elevated launch
{title2=$X_{\max}=u\sqrt{u^2+2gh}/g$}

Under uniform gravity without <drag>, a projectile launched at <speed> $u$ from height $h$ reaches a maximum horizontal <projectile range> $u\sqrt{u^2+2gh}/g$. For horizontal position $X$, maximize $y=h+Xz-gX^2(1+z^2)/(2u^2)$ over $z=\tan\alpha$. The maximizer is $z=u^2/(gX)$ and its envelope meets the ground at the displayed distance. The optimum angle obeys $\tan\alpha=u/\sqrt{u^2+2gh}$.