How do you solve #2sin^2x=cosx+1# in the interval #0<=x<=2pi#?