Evaluating $\int_{0}^{1}\int_{0}^{1}\sqrt{x^{2}+y^{2}}dxdy$ using polar coordinates.

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.


Solution 1:

With symmetry we cut the line in half at $y=x$ and claim that the integral is equal to twice its value on the bottom triangle. The $r$ bounds go from the origin to the line $x=1$, which translates to $r =\sec\theta$. Then the integral becomes

$$2 \int_0^{\frac{\pi}{4}} \int_0^{\sec\theta} r^2 dr d\theta = \frac{2}{3} \int_0^{\frac{\pi}{4}} \sec^3\theta d\theta$$

Which you can take from here with trig identities, or use the substitution $\tan\theta = \sinh(t)$:

$$\frac{2}{3} \int_0^{\sinh^{-1}(1)} \cosh^2(t) \: dt = \frac{1}{3} \int_0^{\sinh^{-1}(1)} 1 + \cosh(2t)\:dt $$ $$ = \frac{t}{3} + \frac{1}{3}\sinh(t)\cosh(t)\Biggr|_0^{\sinh^{-1}(1)} = \frac{1}{3}\sinh^{-1}(1) + \frac{\sqrt{2}}{3}$$

Solution 2:

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!