Can someone please tell me how to derive this:

its supposed to be projectile motion with spring

x = Sqrt (dx*g*1/2*m) +(mgh sin2theta)
----------------------------
(1/2)(k)(sin2theta)

all i got is r =v^2sin2theta / g

x is displacement of elastic

plz help