It is analytic, so just do
from -Pi to Pi
Integral of (cos^2 z) from ( - pi ) iota along |z|= pi to (pi) iota in the right half plane
STATE IF THE FUNCTION IS ANALYTIC OR NOT AND THEN INTEGRATE USING PARAMETRIC REPRESENTATION IF NOT ANALYTIC OR SIMPLY INTEGRATE using calculus IF ANALYTIC.