I want to evaluate the integral $\int_{0}^{1}\int_{0}^{1}\sqrt{x^{2}+y^{2}}dxdy$ using the substitution $x=r\cos\theta$ and $y=r\sin\theta$ where the Jacobian is given as $|J(r, \theta)|=r$ and thus $dxdy=rdrd\theta$.
I need to set the range for $r$ and $\theta$. For $\theta$, it seems obvious that it ranges from $0$ to $\frac{\pi}{2}$ to cover all parts of the rectangle. But I am confused with the range for $r$. Would it be OK to set minimum $r$ as $0$ and maximum $r$ as $\sqrt{2}$, which is the diagonal of the square domain? I think I am confused with the fundamentals of integration.
In the square, $r$ will go from $0$ to $\sqrt2$, as the furthest point from the origin within the square is $(1,1)$. But the range of allowable $\theta$ will depend on $r$. If $r<1$ we get all $\theta$ between $0$ and $\pi/2$. But for $1<r<\sqrt2$ the smallest $\theta$ we get corresponds to the point $(1,\sqrt{r^2-1})$ and so is $\theta=\tan^{-1}\sqrt{r^2-1}$. The largest theta we get is its complement. Therefore \begin{align} \int_0^1\int_0^1\sqrt{x^2+y^2}\,dx\,dy &=\int_0^1\int_0^{\pi/2}r^2\,d\theta\,dr +\int_1^{\sqrt2}\int_{\tan^{-1}\sqrt{r^2-1}}^{\pi/2-\tan^{-1}\sqrt{r^2-1}} r^2\,d\theta\,dr\\ &=\frac\pi2\int_0^1r^2\,dr+\int_1^{\sqrt2}\left(\frac\pi2 -2\tan^{-1}\sqrt{r^2-1}\right)r^2\,dr. \end{align} Good luck with that second integral!