Change the double integral into a single integral in polar coordinates I have this integral:
$$\iint_{G} f(\sqrt{x^2+y^2})dxdy,\,G=\{(x;y)\,|\,x^2+y^2\leq x;x^2+y^2\leq y\}$$
As the description of task hints, I guess I need to somehow make the integral equation depend on only one variable (either $\phi$ or $r$) after converting to polar and applying the constraints. But I'm not sure how to deal with inequality constraints, I tried substituting $x=r\cos{\phi},y=r\sin{\phi}$ into the inequalities and got some bounds on r:
$$r\leq \cos{\phi},\,r\leq \sin{\phi}$$
But I'm not sure how to proceed further... If I had something like $r=\cos{\phi}$, I could have just substituted $r$ into the $x$ and $y$ equations and got rid of one variable, but it doesn't seem like the case here. Also, the answer (from the book) contains $asin$ and $acos$ (which I suspect they got by expressing $\phi$ from constraints), but the issue stays the same. I don't really need the solution to this exact problem, but rather some general insights on constraints and change of coordinate systems (e.g. can I apply constraints first, and then change or how to deal with inequalities).
 A: In polar coordinates, you have,$$x^2+y^2\leqslant x\iff r\leqslant\cos\phi\quad\text{and}\quad x^2+y^2\leqslant y\iff r\leqslant\sin\phi.$$So, clearly (assuming that $\phi\in[0,2\pi]$), $\phi\in\left[0,\frac\pi2\right]$; otherwise, one of the numbers $\cos\phi$ or $\sin\phi$ is smaller than $0$. On the other hand, if $\phi\in\left[0,\frac\pi2\right]$, then $r$ can go from $0$ the smallest of the numbers $\cos\phi$ and $\sin\phi$. So, the largest value that $r$ can take is $\frac{\sqrt2}2$ (that's when $\phi=\frac\pi4$). For each $r\in\left[0,\frac{\sqrt2}2\right]$, $\phi$ can go from $\arcsin r$ to $\arccos r$. To see why, see that if $(x,y)$ is such that $x^2+y^2=y$ and that $\sqrt{x^2+y^2}=r$, then$$r\sin\phi=y=x^2+y^2=r^2,$$and therefore $\sin\phi=r(\iff\phi=\arcsin r)$; a similar argument shows that the largest value that $\phi$ can take is $\arccos r$. Therefore, you have\begin{align}\iint_Gf\left(\sqrt{x^2+y^2}\right)\,\mathrm dx\,\mathrm dy&=\int_0^{\sqrt 2/2}\int_{\arcsin r}^{\arccos r}f(r)r\,\mathrm d\phi\,\mathrm dr\\&=\int_0^{\sqrt2/2}f(r)r\bigl(\arccos(r)-\arcsin(r)\bigr)\,\mathrm dr.\end{align}
