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?

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$.
