Answer:
We are given the trajectory of a projectile:
y=H+xtan(θ)−g2u2x2(1+tan2(θ)),
where H is the initial height, g is the (positive) gravitational constant and u is the initial speed. Since we are looking for the maximum range we set y=0 (i.e. the projectile is on the ground). If we let L=u2/g, then
H+xtan(θ)−12Lx2(1+tan2(θ))=0
Differentiate both sides with respect to θ.
dxdθtan(θ)+xsec2(θ)−[1Lxdxdθ(1+tan2(θ))+12Lx2(2tan(θ)sec2(θ))]=0
Solving for dxdθ yields
dxdθ=xsec2(θ)[xLtan(θ)−1]tan(θ)−xL(1+tan2(θ))
This derivative is 0 when tan(θ)=Lx and hence this corresponds to a critical number θ for the range of the projectile. We should now show that the x value it corresponds to is a maximum, but I'll just assume that's the case. It pretty obvious in the setting of the problem. Finally, we replace tan(θ) with Lx in the second equation from the top and solve for x.
H+L−12Lx2−L2=0.
This leads immediately to x=L2+2LH−−−−−−−−√. The angle θ can now be found easily.