Prove that the range of a parabolic shoted from a height $h$, speed $v$ and angle $\alpha$ with the floor is maximum when $\alpha$ satisfies
$\cos(2\alpha) = \frac{g h}{v^2 + gh}$
This is my attemp. I need to have this done soon, and I have been trying to figure out where did I make a mistake. It may be a silly mistake I am missing.
I start by writing down the trayectory:
$\alpha(t) = (tv \cos(\alpha), h +t v\sin(\alpha)- \frac{1}{2}gt^2)$
Now let's get the time it takes the proyectile to land:
$\alpha_y(t) = 0 \iff h +t v\sin(\alpha)- \frac{1}{2}gt^2 =0 \iff t^*=\frac{v\sin(\alpha) + \sqrt{v^2\sin^2\alpha + 2gh}}{g}$
And we put that time in $\alpha_x$ to see how far the proyectile lands:
$\alpha_x(t^*) = \frac{v^2\cos\alpha}{g}(\sin{\alpha} + \sqrt{\sin^2\alpha + \frac{2gh}{v^2}})$
Now I take the derivative respect to $\alpha$
$\frac{\partial}{\partial\alpha}\alpha_x(t^*) = \frac{v^2}{g}(\cos^2\alpha - \sin^2\alpha + \frac{\sin\alpha\cos^2\alpha}{\sqrt{\sin^2\alpha + \frac{2gh}{v^2}}} - \sin\alpha\sqrt{\sin\alpha + \frac{2gh}{v^2}})$
And then, It follows:
$\frac{\partial}{\partial\alpha}\alpha_x(t^*) = 0 \iff \cos{2\alpha}\sqrt{\sin^2\alpha + \frac{2gh}{v^2}} + \sin\alpha\cos^2\alpha - \sin\alpha(\sin^2\alpha + \frac{2gh}{v^2}) = 0$
Thus
$\cos{2\alpha} = \frac{\sin\alpha(\sin^2\alpha + \frac{2gh}{v^2}) - \sin\alpha\cos^2\alpha}{\sqrt{\sin^2\alpha + \frac{2gh}{v^2}}}$
Which is not the result I am supposed to get
Using a CAS, one realizes that your solution doesn't work: in fact it is well known that, in this case, one must proceed implicitly.
You start from the cartesian equation of the trajectory$$y=h+x \tan \alpha-x^2 \frac {g\,(1+\tan^2 \alpha)}{2v^2}$$The non-zero $x$-solution of the equation $y=0$ gives the range of the projection.
Because $y=0$ defines (implicitly) the range $x$ as a function $x(\alpha)$, differentiate the equation with respect to $\alpha$ and solve with respect to $x'(\alpha)$ putting this equal to zero to obtain the stationary value of $x(\alpha)$.
You have $$g\,x\tan\alpha-v^2=0$$Then couple the latter with $y=0$.
You find $$x=\frac vg \sqrt {v^2+2gh}$$$$\tan\alpha=\frac v{\sqrt {v^2+2gh}}$$
Using the relation $$\cos {2\alpha}=\frac {1-\tan^2 \alpha}{1+\tan^2 \alpha}$$you obtain the condition.