Maximum range

 

For a given initial kinetic energy, the maximum range occurs when cosq sinq is a maximum. and the angle of launch is 45°  above the horizontal.