How do you solve cos^2 x + 2cosx=3 for x in the interval [0,2pi)?