\(H=\frac{u^2 \sin ^2 \theta}{2 g} \Rightarrow \sin \theta=\sqrt{\frac{2 g H}{u^2}}\)
\(R=\frac{2 u^2 \sin \theta \cos \theta}{g}\)
\(R=\frac{2 u^2}{g} \sqrt{\frac{2 g H}{u^2}} \times \sqrt{1-\frac{2 g H}{u^2}}\)
\(R=\frac{2 u^2}{g} \sqrt{\frac{2 g H}{u^2}} \times \sqrt{\frac{u^2-2 g H}{u^2}}\)
\(\frac{g R}{2 \sqrt{2 g H}}=\sqrt{u^2-2 g H}\)
Squaring both the sides,
\(\frac{g R^2}{4 \times 2 g H}=u^2-2 g H\)
\(\Rightarrow u^2=2 g H+\frac{9 R^2}{8 H}\)
\(u=\sqrt{2 g H+\frac{g R^2}{8 H}}\)