Newton's second laws tells us that the vertical motion of the rock in function of the time

follows

while the horizontal motion follows

where

is the angle of the throw with respect to the ground and

is the initial speed of the rock.
Let's find the horizontal range

: the rock hits the ground when

which happens for <span>

, and it has thus traveled </span>

.
Let's find the maximum height traveled : the maximum height is obtained when the rock's vertical speed is zero, i.e. when

that is to say at

. At this time it has a height of

Therefore the problem is resolved when

i.e. for