5

I am able to work out the double integral

$$\int_0^b \int_0^a \sqrt{x^2+y^2} dx dy $$ with brute-force (i.e. integrating $x$, then $y$) to arrive at the close-form result

$$\frac13ab\sqrt{a^2+b^2} +\frac16a^3\sinh^{-1}\frac ba +\frac16 b^3 \sinh^{-1}\frac ab$$

which has the expected parity between $a$ and $b$. However, it gets unwieldy to tackle the triple-integral extension $$\int_0^c \int_0^b \int_0^a \sqrt{x^2+y^2+z^2} dx dy dz$$ this way and I am unable to slug it out. Does anyone know the corresponding close-form expression for the triple version?

Quanto
  • 120,125
  • 5
    Probably do it in spherical coordinates. Then the integrand is easy, but the hard part is writing the rectangular solid in spherical coordinates. – GEdgar Feb 18 '21 at 18:01
  • 4
    I can't even imagine how to write a box in spherical coordinates. – Randall Feb 18 '21 at 18:18
  • 2
    One of the ways would be to write a vector field whose divergence is $\rho$ and doing a surface (double) integral in spherical coordinates. As far as doing triple integral in spherical coordinates, I tried yesterday in one of the questions and miserably failed as I was not able to account for certain parts of the cubic (here it is rectangular) region. – Math Lover Feb 18 '21 at 18:32
  • The vector field should be $\frac{\rho^2}{4} \hat{r}$. Here is a link to a similar question but that was over a cubic region https://math.stackexchange.com/questions/4028593/numerically-evaluating-iiint-c-frac-rm-dx-rm-dy-rm-dzx2/4028623#4028623. – Math Lover Feb 18 '21 at 18:45
  • 3
    @MathLover failed miserably is a harsh sentiment you gave it an admirable effort! Also, it's a little confusing to mix and match coordinate conventions. $r^2\hat{r}$ or $\rho^2\hat{\rho}$ are preferable. – Ninad Munshi Feb 18 '21 at 19:00
  • This will have an analytic answer in terms of inverse cosh, one just needs to use the substitution $$a^2+b^2\sec^2\theta = (a^2+b^2)\cosh^2 t$$ at the appropriate time. For more details, see this integral – Ninad Munshi Feb 18 '21 at 19:02
  • This integral means the mean distance from origin of a point uniformly distributed over 3-dimensional hypercuboid. – user6262 Feb 19 '21 at 19:23
  • Many bounds for the integral can be found out by the methods presented in this paper for a similar integral https://www.google.com/url?sa=t&source=web&rct=j&url=https://maths-people.anu.edu.au/~brent/pd/rpb033.pdf&ved=2ahUKEwiKuZ7v2vbuAhWO4nMBHbXNAH0QFjAEegQIBhAC&usg=AOvVaw1oYSgyGLsmxhhg0-WUojZK – user6262 Feb 19 '21 at 19:46

2 Answers2

6

You can refer to J.M. Borwein's box integral

\begin{gather*} \int_0^c\int_0^b\int_0^a\dfrac{1}{\sqrt{x^2+y^2+z^2}}{\rm\,d}x{\rm\,d}y{\rm\,d}z\\ = \begin{array}{r} ab\ln\left(\frac{c}{\sqrt{a^2+b^2}}+\sqrt{1+\frac{c^2}{a^2+b^2}}\right)\\ +ac\ln\left(\frac{b}{\sqrt{a^2+c^2}}+\sqrt{1+\frac{b^2}{a^2+c^2}}\right) +bc\ln\left(\frac{a}{\sqrt{b^2+c^2}}+\sqrt{1+\frac{a^2}{b^2+c^2}}\right)\\ -\frac{a^2}{2}\arctan\left(\frac{bc}{a\sqrt{a^2+b^2+c^2}}\right)-\frac{b^2}{2}\arctan\left(\frac{ac}{b\sqrt{a^2+b^2+c^2}}\right)-\frac{c^2}{2}\arctan\left(\frac{ab}{c\sqrt{a^2+b^2+c^2}}\right) \end{array}\\ \\ \\ \int_0^c\int_0^b\int_0^a\sqrt{x^{\overset{\,}{2}}+y^2+z^2}{\rm\,d}x{\rm\,d}y{\rm\,d}z\\ = \begin{array}{r} \frac{abc}{4}\sqrt{a^2+b^2+c^2}+\frac{ab\left(a^2+b^2\right)}{6}\ln\left(\frac{c}{\sqrt{a^2+b^2}}+\sqrt{1+\frac{c^2}{a^2+b^2}}\right)\\ +\frac{ac\left(a^2+c^2\right)}{6}\ln\left(\frac{b}{\sqrt{a^2+c^2}}+\sqrt{1+\frac{b^2}{a^2+c^2}}\right) +\frac{bc\left(b^2+c^2\right)}{6}\ln\left(\frac{a}{\sqrt{b^2+c^2}}+\sqrt{1+\frac{a^2}{b^2+c^2}}\right)\\ -\frac{a^4}{12}\arctan\left(\frac{bc}{a\sqrt{a^2+b^2+c^2}}\right)-\frac{b^4}{12}\arctan\left(\frac{ac}{b\sqrt{a^2+b^2+c^2}}\right)-\frac{c^4}{12}\arctan\left(\frac{ab}{c\sqrt{a^2+b^2+c^2}}\right) \end{array}\\ \\ \\ \int_0^c\int_0^b\int_0^a\bigg(x^2+y^2+z^2\bigg)^{\frac{3}{2}}{\rm\,d}x{\rm\,d}y{\rm\,d}z\\ = \begin{array}{r} \frac{2abc\left(a^2+b^2+c^2\right)}{15}\sqrt{a^2+b^2+c^2}+\frac{ab\left(9a^4+10a^2b^2+9b^4\right)}{120}\ln\left(\frac{c}{\sqrt{a^2+b^2}}+\sqrt{1+\frac{c^2}{a^2+b^2}}\right)\\ +\frac{ac\left(9a^4+10a^2c^2+9c^4\right)}{120}\ln\left(\frac{b}{\sqrt{a^2+c^2}}+\sqrt{1+\frac{b^2}{a^2+c^2}}\right)\\ +\frac{bc\left(9b^4+10b^2c^2+9c^4\right)}{120}\ln\left(\frac{a}{\sqrt{b^2+c^2}}+\sqrt{1+\frac{a^2}{b^2+c^2}}\right)\\ -\frac{a^6}{30}\arctan\left(\frac{bc}{a\sqrt{a^2+b^2+c^2}}\right)-\frac{b^6}{30}\arctan\left(\frac{ac}{b\sqrt{a^2+b^2+c^2}}\right)-\frac{c^6}{30}\arctan\left(\frac{ab}{c\sqrt{a^2+b^2+c^2}}\right) \end{array} \end{gather*}

D.Matthew
  • 1,067
4

A start
Spherical coordinates. $(\rho,\theta,\phi)$. They are related to rectangular coordinates $(x,y,z)$ by: \begin{align} x &= \rho\sin\theta\cos\phi\\ y &= \rho\sin\theta\sin\phi\\ z &= \rho\cos\theta \end{align} and in reverse by \begin{align} \rho &= \sqrt{x^2+y^2+z^2}\\ \theta &=\arccos\frac{z}{\sqrt{x^2+y^2+z^2}}\\ \phi &= \arctan\frac{y}{x} \end{align} The box we want is $$ 0 \le x \le a,\\ 0 \le y \le b,\\ 0 \le z \le c. $$ In spherical coorcinates: $$ 0 \le \rho\sin\theta\cos\phi \le a,\\ 0 \le \rho\sin\theta\sin\phi \le b,\\ 0 \le \rho\cos\theta \le c. $$ If we think we will express our integrals using $\rho$ a function of $\theta,\phi$, do this as $$ 0 \le \rho \le a\csc\theta\sec\phi,\\ 0 \le \rho \le b\csc\theta\csc\phi,\\ 0 \le \rho \le c\sec\phi $$ Our triple integral will have three terms, depending on which of the three $a\csc\theta\sec\phi,b\csc\theta\csc\phi,c\sec\phi$ is smallest. That is, dependingon which of the three faces the ray from the origin with angles $\theta,\phi$ intersects.

GEdgar
  • 117,296
  • 1
    I am not sure that spherical coordinates make it easier. –  Feb 19 '21 at 14:28
  • 1
    A similar integral related to Robbin's constant was calculated by Bolis by splitting the box into three similar cones and integrating over a cone in spherical coordinates. $$\int_0^1 \int_0^1 \int_0^1 \sqrt{(x_{1}-y_{1})^2+(x_{2}-y_{2})^2+(x_{3}-y_{3})^2} dx dy dz$$ – user6262 Feb 19 '21 at 19:13
  • With a few modifications to account for $a,b,c$ we can try to use the setup in this answer (the question is actually already linked yet I don't see anyone else having mentioned it here...) – user170231 Feb 05 '23 at 22:21