Consider an integral $$ I(x,a) = \int \limits_{-x}^{2\pi-x}\theta(\cos(z)-a)dz, $$ where $-1<a <1$ and $\theta(b)$ is Heaviside theta function. How to evaluate it analytically?
P.S. The integral is the sub-integral of another integral $$ I_{1}(a) = \int \limits_{0}^{2\pi}dx\int \limits_{-x}^{2\pi-x}\theta(\cos(z)-a)dz, $$
The integrand is periodic with period $2 \pi$, therefore $I(x, a)$ does not depend on $x$: $$\int_{-x}^{2 \pi - x} \theta(\cos z - a) dz = \int_{-\pi}^\pi \theta(\cos z - a) dz = 2 \arccos a, \quad -1 \leq a \leq 1.$$