Projectile range under a ceiling (source code)

= Projectile range under a ceiling
{title2=$R_{\max}=\sqrt{8H(u^2/g-2H)}\quad\text{if }H\leq u^2/(4g)$}

A <projectile> launched from and returning to the floor beneath a horizontal ceiling of height $H$ has maximum <projectile range> $\sqrt{8H(u^2/g-2H)}$ when $0\leq H\leq u^2/(4g)$. For higher ceilings the maximum is $u^2/g$. This assumes uniform <gravitational acceleration>, no <air resistance> and fixed launch <speed> $u$.

Indeed, with $z=\sin^2\theta$, the apex condition is $z\leq2gH/u^2$ and $R^2=4u^4z(1-z)/g^2$. This concave <quadratic function> is maximized at the admissible value nearest $1/2$. Thus the lower-ceiling expression must not be extrapolated past its regime. If touching the ceiling is excluded, the limiting value is a supremum instead of an attained maximum.