Need help on the conservation of energy Eq

hi people..

I've been trying to unravel this equation, but i have not been successful.. I could use some help..

The equation is the application of the conservation of energy law..

(m/2) [(Rx' + Rx'cos(x))^2 + (-Rx'sin(x))] + mg(R+ Rcos(x)) = (m/2)(v^2) + mg2R

I guess i should really learn how to use Latex. Anyway, the x' represents the derivative of x, m the mass, g the gravity force.

I know it unravels to (x')^2 = (4gR(sin(x/2))^2 + v^2) / (4(R^2)(cos(x/2))^2), but i can't get there..

Thanks!(Nod)