Find the area below the curve $y=[\sqrt{2+2\cos2x}]$ and above the $x$-axis , $x\in [-3\pi,6\pi]$, (where $[.]$ denotes the greatest integer function) .
My approach:
$$y=[\sqrt{2+2\cos2x}]$$ $$=[\sqrt{2+2(2\cos^2x-1}]$$ $$=[\sqrt{2+4\cos^2x-2}]$$ $$=[|2\cos x|]$$
After this, I do not know how to solve it and how to find the area.
$$0\le 2|\cos{x}|\le 2\implies [2|\cos{x}|]\in[0,1,2]$$
The function $[2|\cos{x}|]$ is discontinuous for those values of x that make it 2, but those are single points of removable discontinuity and they're not going to affect the integration properties of this function. So, the area lies between values of $0$ and $1$. Therefore, we need to find that value of x (just find one such value, the rest of the problem is going to be take care of by symmetry and repetition) which serves as the boundary point between values that are above 1 and values that are below 1:
$$ 2\cos{x}=1\implies x=\frac{\pi}{3} $$
Using symmetry and the fact that the area is just a bunch of rectangles that are the same, we have the following:
$$ \int_{-3\pi}^{6\pi}\sqrt{2+2\cos(2x)}\,dx= \int_{-3\pi}^{6\pi}[|2\cos{x}|]\,dx= 18\int_{0}^{\frac{\pi}{3}}\,dx=6\pi\ sq.\ units. $$