The horizontal range of the ball is maximised when
![](https://latex.codecogs.com/png.latex?\bg_white \alpha = \pi / 4)
. This can be easily shown by examining the equation in ii).
Case 1: The ceiling allows for an angle of projection of
.
If the ceiling allows for at least this angle of projection, then
![](https://latex.codecogs.com/png.latex?\bg_white \alpha = \pi / 4)
is the optimal angle to throw the ball.
It doesn't matter how tall the ceiling is after a certain point - because the best angle is
![](https://latex.codecogs.com/png.latex?\bg_white \pi / 4)
and any higher angle will simply lower
![](https://latex.codecogs.com/png.latex?\bg_white d )
.
The horizontal range obtained by projecting at this optimal angle is then
![](https://latex.codecogs.com/png.latex?\bg_white d = {v^2}/{g})
.
But when does the ceiling allow for this angle? It is when the maximum height of the projectile (with angle of projection
![](https://latex.codecogs.com/png.latex?\bg_white \alpha = \pi / 4)
) is less than or equal to the height allowed by the ceiling (which is
![](https://latex.codecogs.com/png.latex?\bg_white H-S )
).
Mathematically, this can be represented by the condition
![](https://latex.codecogs.com/png.latex?\bg_white (H-S) \geq \frac{v^2 \sin^2 (\pi/4)}{2g} \implies 4g(H-S) \geq v^2)
.
Case 2: The ceiling does NOT allow for an angle of projection of
.
As
![](https://latex.codecogs.com/png.latex?\bg_white \alpha )
decreases past
![](https://latex.codecogs.com/png.latex?\bg_white \pi / 4 )
, so too does
![](https://latex.codecogs.com/png.latex?\bg_white d)
, from ii).
Therefore we want the largest value of
![](https://latex.codecogs.com/png.latex?\bg_white \alpha )
we can get. This value occurs when the tip of the ball's trajectory coincides with the ceiling, i.e.
Rearrangement gives:
Finally, to get the answer, substitute (1) and (2) into:
![](https://latex.codecogs.com/png.latex?\bg_white d = \frac{v^2}{g}(2 \sin \alpha \cos \alpha))