compute $\int_Q\frac{1}{|x|} \, dx$ on $Q=[0,1]^2$

Let $Q=[0,1]^2$, compute the integral:

$$\int_Q\frac{1}{|x|} \, dx$$

I tried to take $x=(x_1,x_2)$, then the integral is:

$$\int_Q\frac{1}{\sqrt{x_1^2+x_2^2}} \, dx_1 \, dx_2$$

Then I moved to polar coordinates $(x_1,x_2)=(r\cos\theta,r\sin\theta)$, so the integrand is $\frac{1}{\sqrt{r^2}}r=1$.

I could't find the integral's domain. I took $0\leq r\cos\theta\leq1$ and $0\leq r\sin\theta\leq1$ from $(x_1,x_2)\in Q$.

Then I got $0\leq r\leq\sqrt2$, but I didn't mange to find $\theta$'s interval, is it $\displaystyle \Big[0,\frac{\pi}{2}\Big]$?

Final result by WA is: $2\log(1 + \sqrt2)$

• your domain is square not circular, in your case $r$ is also a function of $\theta$, not varies independently from $0$ to $\sqrt2$ – serg_1 Jul 3 '17 at 17:50

$$\begin{eqnarray*}\iint_{(0,1)^2}\frac{da\,db}{\sqrt{a^2+b^2}}&\stackrel{\text{symmetry}}{=}&2\int_{0}^{1}\int_{0}^{a}\frac{1}{\sqrt{a^2+b^2}}\,db\,da\\&\stackrel{b\mapsto a c}{=}&2\int_{0}^{1}\int_{0}^{1}\frac{1}{\sqrt{1+c^2}}\,dc\,da\\&=&2\,\text{arcsinh}(1)=\color{red}{2\log(1+\sqrt{2}).}\end{eqnarray*}$$

• Can you explain a little bit more about the symmetry? Is it by Fubini's theorem? – Don Fanucci Jul 3 '17 at 18:06
• @TrueTopologist: you are integrating over a square a function $f(a,b)$ fulfilling $f(a,b)=f(b,a)$, hence the integral over $(0,1)^2$ equals twice the integral over the triangle $\{(a,b)\in(0,1)^2: b\leq a\}$. – Jack D'Aurizio Jul 3 '17 at 18:11
• OK, now I understand, thank U. – Don Fanucci Jul 3 '17 at 18:12

$$0 \leq \tan\theta \leq \infty \implies \theta \in [0,\pi/2]$$

$$0 \leq r\cos\theta \leq 1, 0 \leq r\sin\theta \leq 1 \implies 0 \leq r \leq \min(1/\cos\theta,1/\sin\theta)$$

\begin{align}I &= \int_0^{\pi/2}\int_0^{\min(1/\cos\theta,1/\sin\theta)} \,\partial r \,\partial \theta\\ &= \int_0^{\pi/4}\int_0^{1/\cos\theta} \, \partial r \, \partial \theta + \int_{\pi/4}^{\pi/2}\int_0^{1/\sin\theta} \, \partial r \, \partial \theta \\ &= \int_0^{\pi/4}\frac{1}{\cos\theta} \, \partial \theta + \int_{\pi/4}^{\pi/2} \frac{1}{\sin\theta} \, \partial \theta \\ &= \log(\tan\theta+\sec\theta)|_0^{\pi/4} -\log(\cot\theta+\csc\theta)|_{\pi/4}^{\pi/2}\\ &= \log(1+\sqrt 2) - 0-0 + \log(1+\sqrt{2}) \\ &= 2\log(1+\sqrt 2)\end{align}

Note that I used the fact that $\sin\theta\leq\cos\theta, \forall \theta \in [0,\pi/4]$ and $\sin\theta>\cos\theta, \forall \theta \in (\pi/4,\pi/2]$.
