<s>[INST] Evaluating an integral in mathematica What does this interal evaluate to $$\int_m^n\int_m^n\frac{1}{4\sqrt{u^2+v^2}}\ du\ dv?$$
Mathematica seems to crap out on this.
Assume $m,n>0$.
 [/INST] This is another approach which convert the two dimensional integral to a line integral first.
Let $r = \sqrt{u^2+v^2}$, $\displaystyle\;P = -\frac{v}{r}$ and $\displaystyle\;Q = \frac{u}{r}$, it is easy to check
$$\frac{\partial Q}{\partial v} - \frac{\partial P}{\partial u} = \frac{1}{r}$$
By Green's theorem, we have
$$\frac14 \int_{[m,n]^2} \frac{du dv}{r} 
= \frac14 \int_{\partial [m,n]^2} P du + Qdv 
= \frac14 \int_{\partial [m,n]^2} \frac{u dv - vdu}{\sqrt{u^2+v^2}}
$$
The boundary $\partial [m,n]^2$ consists of 4 line segments


*

*$v = m$, $u : m \to n$.


$$\verb/RHS/ = -\frac{m}{4} \int_m^n \frac{du}{\sqrt{u^2+m^2}} = -\frac{m}{4}\left[\sinh^{-1}\left(\frac{u}{m}\right)\right]_m^n
= -\frac{m}{4}\left(\sinh^{-1}\left(\frac{n}{m}\right) - \sinh^{-1}(1)\right)$$


*

*$u = n$, $v : m \to n$.


$$\verb/RHS/ = \frac{n}{4}\int_m^n \frac{dv}{\sqrt{n^2 + v^2}} =\frac{n}{4}\left[\sinh^{-1}\left(\frac{v}{n}\right)\right]_m^n = \frac{n}{4}\left(\sinh^{-1}(1) - \sinh^{-1}\left(\frac{m}{n}\right)\right)$$


*

*$v = n$, $u : n \to m$.
$$\verb/RHS/ = -\frac{n}{4}\int_n^m \frac{du}{\sqrt{u^2+n^2}}
= -\frac{n}{4}\left[\sinh^{-1}\left(\frac{u}{n}\right)\right]_n^m = \frac{n}{4}\left(\sinh^{-1}(1) - \sinh^{-1}\left(\frac{m}{n}\right)\right)$$

*$u = m$, $v : n \to m$.
$$\verb/RHS/ = \frac{m}{4}\int_n^m \frac{dv}{m^2 + v^2} =
\frac{m}{4}\left[\sinh^{-1}\left(\frac{v}{m}\right)\right]_n^m = -\frac{m}{4}\left(\sinh^{-1}\left(\frac{n}{m}\right)-\sinh^{-1}(1)\right)$$
Combine these four terms, we get
$$\frac14 \int_{[m,n]^2} \frac{du dv}{r}
= \frac{m+n}{2}\sinh^{-1}(1) - \frac{m}{2}\sinh^{-1}\left(\frac{n}{m}\right) - \frac{n}{2}\sinh^{-1}\left(\frac{m}{n}\right)\\
= \frac{m+n}{2}\log(\sqrt{2}+1)
 - \frac{m}{2}\log\left(\frac{\sqrt{n^2+m^2}+ n}{m}\right)
 - \frac{n}{2}\log\left(\frac{\sqrt{m^2+n^2}+ m}{n}\right)$$
</s>