# Express term a in formula in terms b, c, d etc

I have a formula that calculates $$R$$ with the following formula:

$$R = \dfrac{V\cos(α)\Big(V\sin(α) + \sqrt{V\sin(\alpha))^2 + 2gh}\Big)}{g}$$

but in this case I need to know $$V$$ and I already know $$R$$ I also know the other terms $$a, g, h$$. How do I rewrite the formula to get $$V$$?

I with my little math knowledge this is what i came up with:

$$V = \dfrac{R}{\cos(\alpha)}\dfrac{\Big(\dfrac{R}{sin(\alpha)} + \sqrt{\big(\frac{R}{ \sin(\alpha)}\big)^2 + 2gh}\Big)}{g}$$

but I am pretty sure this is wrong :(

My math is really rusty, so pls explain it in children terms :)

So let $$\cos \alpha =c,\sin \alpha =s,$$ then the first equation becomes $$Rg=Vc(Vs+\sqrt{V^2s^2+2gh}),$$ which transforms to $$\frac{Rg-V^2cs}{Vc}=\sqrt{V^2s^2+2gh}.$$ This then becomes (after squaring and some other apparent simplifications) $$(Rg-V^2cs)^2=V^2c^2(V^2s^2+2gh).$$ Then we make further substitutions: Letting $$Rg=A,cs=B,c^22gh=C,$$ we obtain now $$(A-V^2B)^2=V^4B^2+V^2C^2,$$ which eventually simplifies to $$A^2=V^2(2AB+C),$$ so that we have $$V=\pm\sqrt{\frac{A^2}{2AB+C}}.$$ Finally, back substitution gives the desired result.