plot cos^2 x for x=0 to 2pi