$$\iint_{[0,\pi]\times[0,\pi]}\left|\cos(x+y)\right|d(x,y)=2\pi$$
I want to prove the above double integral. However, I am not sure how to open the absolute function corresponding to the proper integrals. How do the limits change when we consider where $\cos(x+y)$ is positive or negative?
Consider that $f(x)=\left|\cos(x)\right|$ is a $\pi$-periodic function, hence for every $a\in\mathbb{R}$ we have: $$ \int_{a}^{a+\pi}f(x)\,dx = \int_{-\pi/2}^{\pi/2}f(x)\,dx = \int_{-\pi/2}^{\pi/2}\cos(x)\,dx = 2.$$ If now we use Fubini's theorem (we surely can since the integrand function is non-negative, continuous and bounded), we have: $$ \iint_{[0,\pi]^2}\left|\cos(x+y)\right|\,d(x,y) = \int_{0}^{\pi} 2\,dy = 2\pi $$ as wanted.