What is the optimum angle of projection when throwing a stone off a cliff? You are standing on a cliff at a height $h$ above the sea. You are capable of throwing a stone with velocity $v$ at any angle $a$ between horizontal and vertical. What is the value of $a$ when the horizontal distance travelled $d$ is at a maximum?
On level ground, when $h$ is zero, it's easy to show that $a$ needs to be midway between horizontal and vertical, and thus $\large\frac{\pi}{4}$ or $45°$. As $h$ increases, however, we can see by heuristic reasoning that $a$ decreases to zero, because you can put more of the velocity into the horizontal component as the height of the cliff begins to make up for the loss in the vertical component. For small negative values of $h$ (throwing up onto a platform), $a$ will actually be greater than $45°$.
Is there a fully-solved, closed-form expression for the value of $a$ when $h$ is not zero?
 A: Assume no friction and uniform gravity g. 
If you throw a stone at point (0, h), with velocity (v cos θ, v sin θ), then we get
\begin{align}
d &= vt\cos\theta && (1) \\
0 &= h + vt\sin\theta - \frac12 gt^2 && (2)
\end{align}
The only unknown to be solved is t (total travel time). We could eliminate it by using $t = \frac d{v\cos\theta}$ to get
$$ 0 = h + d\tan\theta - \frac{gd^2\sec^2\theta}{2v^2}\qquad(3) $$
Then we compute the total derivative with respect to θ:
\begin{align}
0 &= \frac d{d\theta}\left(d\tan\theta\right) - \frac g{2v^2}\frac d{d\theta}\left(d^2\sec^2\theta\right) \\
&= \ldots
\end{align}
and then set $\frac{dd}{d\theta}=0$ (because it is maximum) to solve d:
$$ d = \frac{v^2}{g\tan\theta} $$
Substitute this back to (3) gives:
\begin{align}
h &= \frac{v^2}g \left( \frac1{2\sin^2\theta} - 1\right) \\
\Rightarrow \sin\theta &= \left( 2 \left(\frac{gh}{v^2} + 1\right) \right)^{-1/2}
\end{align}
This is the closed form of θ in terms of h. 
A: A projectile is thrown from a height $h$, with speed $u$ at an angle $\theta$ from the horizontal.  With $h,u$ fixed we wish to find $\theta$ to maximise $s$, the horizontal distance covered before the projectile hits the ground.
Let $\vec{u}, \vec{v}$ be the initial  and terminal velocities respectively.  By conservation of energy we have: $$|\vec{u}| =u,\qquad\qquad |\vec{v}|=\sqrt{u^2+2gh},$$
so $$|\vec{u}\times \vec{v}|=u\sqrt{u^2+2gh}\left(\sin\alpha\right),\qquad (1)$$
where $\alpha$ is the angle between $\vec{u}$ and $\vec{v}$.
On the other hand $$\vec{u}=\left(\begin{array}{c}u\cos\theta\\0\\u\sin\theta\end{array}\right),\qquad \vec{v}=\left(\begin{array}{c}u\cos\theta\\0\\u\sin\theta-gt\end{array}\right),$$
where $t$ is the time that the projectile is in flight.  Thus $$\vec{u}\times \vec{v}=\vec{u}\times (\vec{v}-\vec{u})=\left(\begin{array}{c}0\\gs\\0\end{array}\right).$$ Hence $$|\vec{u}\times \vec{v}|=gs. \qquad (2)$$
Combining $(1)$ and $(2)$ we get $$gs=u\sqrt{u^2+2gh}\left(\sin\alpha\right).\qquad (3)$$  Thus $s$ maximises at $$\frac ug \sqrt{u^2+2gh},$$ when $\vec{u}$ and $\vec{v}$ are perpendicular.
To find $\theta$ we can now use $\vec{u}\cdot \vec{v}=0$:$$u^2\cos^2\theta+u^2\sin^2\theta-gtu\sin\theta=0.$$
This simplifies to $$u^2=gs\tan\theta.$$
Using $(3)$ We conclude that $$\tan\theta=\frac u{\sqrt{u^2+2gh}}.$$
A: I don't have a complete solution, but I attempted to solve this problem using calculus.

$x'=v \cos a$
     $y''= -g$ and (at  $t=0) \quad y'= v \sin a$
     So, $y'= v \sin a -gt$
     $x_0=0$, so $x=vt \cos a$
     $y_0=h$, so $y=vt \sin a - \frac12 gt^2+c$ (integrating with respect to $t$)
     Subbing in $h, y=vt \sin a - \frac12 gt^2+h$  

The ball will hit the ground when $y=0$.
This is as far as I got, but it appears that you can find a closed solution after all. I originally tried solving the quadratic for $t$ and subbing that into $x$, but it seems to work much better to do the substitution the other way round. I will leave this solution here in case anyone wants to see how to derive the basic equations for $x$ and $y$.
