# R := v0*cos(a)*t; h := v0*sin(a)*t - g*t^2/2; E1 := ('h'+g*t^2/2)^2 = v0^2*t^2-'R'^2; 'R'^2 = v0^2*t^2-('h'+g*t^2/2)^2; h := 'h': F := z -> v0^2*z-(h+g*z/2)^2; diff(F(z),z) = 0; z := solve(diff(F(z),z),z); R := 'R': R^2 = F(z); R^2 = factor(expand(F(z))); R = v0*sqrt(v0^2-2*g*h)/g;