integrate cosz from -pi/2+i to pi+i