# 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.

• I tried setting $r$ between $0$ and $\sqrt{2}$ and WolframAlpha tells me that the calculated value is different from the answer. – Senna Dec 14 '19 at 7:52
• No this is two integrals in polar. – Ninad Munshi Dec 14 '19 at 7:53
• @NinadMunshi Then, should I divide the domain into two triangles? Why does the simple integration not work properly? – Senna Dec 14 '19 at 7:59
• Because the inner most bounds of a double integral are curves, not points. They would go from one function of $r$ to another (yes in this case the origin counts as a "curve" because multiple $\theta$'s end up there). As you can see for a square, the outermost $r$ bounds would be a piecewise function of $\theta$. – Ninad Munshi Dec 14 '19 at 11:12

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 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!
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}$$
The integrand $$\sqrt{x^2+y^2}$$ is symmetric about the line $$y=x$$ yielding $$\iint_{[0,1]\times [0,1]}\sqrt{x^2+y^2}\;dydx=2\int_0^1\int_0^x\sqrt{x^2+y^2}\;dydx=2\int_0^\frac{\pi}{4}\int_0^{\sec(\theta)}r^2\;drd\theta=\frac{2}{3}\int_0^\frac{\pi}{4}\sec^3(\theta)\;d\theta$$ $$=\frac{1}{3}(\sec({\pi\over 4})\tan({\pi\over4})+\ln(\sec({\pi\over4})+\tan({\pi\over4})))=\frac{1}{3}(\sqrt2+\ln(1+\sqrt2))$$