Suppose a projectile is launched with initial velocity v and angle A
Initial y velocity: Vsin(A)
Time taken to reach peak height (using v=u+at) :
Total time of flight:
Total horizontal range (by the fact that horizontal velocity is constant):
The value of A that maximises this is the value that maximises sinAcosA. Which is 45 degrees.
But also, sinAcosA is symmetrical about 45 degrees. This can be proven by showing the equivalence of sin(45+B)cos(45+B) = sin(45-B)cos(45-B).