-
Since we want to maximize the horizontal distance traveled by the cannonball, we need to find out when the cannonball hits the ground.

Input := 


time = Solve[y[t]==0,t];

Input := 


t2=t/.time[[2]]

Output =


5.10204 Sin[theta]