Consider the following integral:
$$\int_{\frac{\pi}{4}}^{\frac{5\pi}{4}}\int_{\cos(x)}^{\sin(x)}dydx = \int_{\frac{\pi}{4}}^{\frac{5\pi}{4}}\left(\sin(x)-\cos(x)\right)dx=\left[-\cos(x)-\sin(x)\right]_{\frac{\pi}{4}}^{\frac{5\pi}{4}}=2\sqrt{2}$$
I would like like to switch the order of integration. I have broken the region bounded by the trig functions into 5 subregions in order to avoid integrating across an interval that splits any particular definition for the inverse functions. I know some symmetry could help simplify the calculations but does not help with my misunderstanding:
1) $\arccos(y)\leq x\leq\arcsin(y)\qquad -\frac{1}{\sqrt{2}}\leq y \leq \frac{1}{\sqrt{2}}\qquad$ $y$ is decreasing
2) $\arcsin(y)\leq x\leq \frac{\pi}{2} \qquad \frac{1}{\sqrt{2}}\leq y\leq 1\qquad$ $y$ is increasing
3) $\frac{\pi}{2}\leq x\leq\arcsin(y) \qquad \frac{1}{\sqrt{2}}\leq y \leq 1\qquad$ $y$ is decreasing
4) $\arccos(y)\leq x\leq \pi \qquad -1\leq y\leq-\frac{1}{\sqrt{2}}\qquad$ $y$ is decreasing
5) $\pi\leq x\leq\arccos(y)\qquad -1\leq y\leq-\frac{1}{\sqrt{2}}\qquad$ $y$ is increasing
Working through this problem I have tried to reason by looking at increasing or decreasing $y$ in terms of increasing $x$. This seems to work in all regions but 4) and 5). There is a sign change that I cannot account for. So I have the following corresponding integrals for the $dxdy$ integration order:
1) $ \int_{\frac{1}{\sqrt{2}}}^{\frac{-1}{\sqrt{2}}}\int_{\arccos(y)}^{\arcsin(y)}dxdy = \frac{\pi}{\sqrt{2}}$
2) $ \int_{\frac{1}{\sqrt{2}}}^{1}\int_{\arcsin(y)}^{\frac{\pi}{2}}dxdy = \frac{1}{\sqrt{2}}-\frac{\pi}{4\sqrt{2}}$
3) $ \int_{1}^{\frac{1}{\sqrt{2}}}\int_{\frac{\pi}{2}}^{\arcsin(y)}dxdy = \frac{1}{\sqrt{2}}-\frac{\pi}{4\sqrt{2}}$
4) $ \int_{\frac{-1}{\sqrt{2}}}^{-1}\int_{\arccos(y)}^{\pi}dxdy = -\left(\frac{1}{\sqrt{2}}-\frac{\pi}{4\sqrt{2}}\right)$
5) $ \int_{-1}^{\frac{-1}{\sqrt{2}}}\int_{\pi}^{\arccos(y)}dxdy = -\left(\frac{1}{\sqrt{2}}-\frac{\pi}{4\sqrt{2}}\right)$
Integrals 4 and 5 evaluate to minus their respective areas. I'm a bit confused as to the reasoning.
I think i finally got this one. The bounded region under consideration crosses over the domain of definition for both the $\arcsin(y)$ and $\arccos(y)$. The standard domain of definition for these functions is:
$-\frac{\pi}{2}\leq arcsin(y)\leq\frac{\pi}{2}\qquad0\leq\arccos(y)\leq\pi$
The way I finally realized what was happening here was by investigating the graph of the inverse functions on their standard domains and asking myself the following question:
How can I continuously extend the graph of these inverses to include the bounded region?
From this, one sees that multiplying the $\arcsin(y)$ by -1 and adding $\pi$ provides a continuous extension that covers the bounded region. Likewise for $\arccos(y)$ multiply by -1 and add $2\pi$. With this insight, the region can be broken into 3 subregions:
1) $\arcsin(y)\leq x\leq\pi-\arcsin(y)\qquad \frac{1}{\sqrt{2}}\leq y\leq1$
2) $\arccos(y)\leq x\leq\pi-\arcsin(y)\qquad \frac{-1}{\sqrt{2}}\leq y\leq\frac{1}{\sqrt{2}}$
3) $\arccos(y)\leq x\leq2\pi-\arccos(y)\qquad -1\leq y\leq\frac{-1}{\sqrt{2}}$
The area of the bounded region follows from integrating over these 3 subregions.