I came across with this equation:
$v^2 \cos (2 \alpha) \sqrt{v^2 \sin^2 \alpha+2gh}+v \sin \alpha [v^2 \cos (2 \alpha)-2gh]=0$
or
$2 g h \sin \alpha - v^2 \cos(2\alpha) \sin \alpha = v \cos(2 \alpha) \sqrt{v^2 \sin^2 \alpha + 2gh}$
Now this equation before squaring gives $$\alpha = \arccos \left(\sqrt{\frac{2 g h + v^2}{2 g h + 2v^2}} \right)$$
But if we square its sides:
$4 g^2 h^2 \sin^2 \alpha-4ghv^2\sin^2 \alpha \cos(2\alpha)+v^4 \cos^2(2\alpha) \sin^2 \alpha = v^2 [\cos^2(2\alpha)](v^2 \sin^2 \alpha + 2gh)$
The solution would be:
$$\alpha=\arccos \left(\frac{gh}{2v^2+2gh} \right)$$
Which is a whole different result. I'm wondering why squaring ruins the result? I do know that this operation may introduce extra solutions, but here we have a complete new one.