plot y = cosx and y = 1/2