11
$\begingroup$

Is it possible to calculate the integral

$$I = \int_{-1}^1 \mathrm dx \int_{-1}^1 \mathrm dy \int_{-1}^1 \mathrm dz \frac{1}{x^2 + y^2 + z^2}$$

analytically? I tried using spherical coordinates

$$I = \int_0^{r(\vartheta,\varphi)} \mathrm dr \int_0^\pi \mathrm d\vartheta \int_0^{2\pi} \mathrm d\varphi \sin(\vartheta) \;,$$

but I couldn't come up with a proper expression for $r(\vartheta,\varphi)$, which is the radial component for points on the boundary of the cube $[0,1]^3$.

  • 0
    Did you remember to exploit symmetry and use the correct Jacobian determinant after switching to spherical coordinates?2011-05-15
  • 0
    @J. M. Isn't this $r^2 sin(\vartheta)$?2011-05-15
  • 2
    Using Gauss theorem (applied to the punctuated cube $C_{\epsilon} = [-1, 1]^3 - B_{\epsilon}(0)$ with $\epsilon \to 0$) for $f = \mathrm{r}/\| \mathrm{r} \|^2$, we have $$ \int_{C_0} \frac{dV}{\| \mathrm{r} \|^2} = \int_{\partial C_{0}} \frac{\mathrm{r}}{\| \mathrm{r} \|^2}\cdot \nu \, d\sigma = 24 \int_{0}^{1} \int_{0}^{1} \frac{dxdy}{x^2+y^2+1}. $$ But I have no idea how to go further...2011-05-15
  • 2
    @sos440: Well, I guess the natural next step would be to split the integral into two triangles and go to polar coordinates, so that you get $$48 \int_0^{\pi/4} \int_0^{1/\cos\phi} \frac{r}{r^2+1} dr \, d\phi.$$2011-05-15
  • 0
    ...but you get a rather nasty integral in $\phi$. Mathematica returns a messy expression with polylogs and the Catalan constant. The numerical value is approximately 30.6965.2011-05-15
  • 0
    @Hans Lundmark / @sos440 Thanks a lot. So carrying out the $r$ integration yields $$24\int_0^{\pi}{4} \mathrm d\varphi \log \left( 1 + \frac{1}{\cos^2(\varphi)} \right)\;,$$ for which Mathematicas online integrator spits out that messy expression involving polylogarithms. However, what irritates me is that this expression contains complex arguments. How can the integral of a purely real function over a real domain produce a complex result?2011-05-15
  • 1
    @hennes: That's because Wolfram/ *Mathematica* knows nothing about [Clausen functions](http://mathworld.wolfram.com/ClausenFunction.html) and their ilk, and thus has to use dilogarithms with complex argument.2011-05-15
  • 2
    @hennes: Well, the result must be real, and numerical evaluation indicates that the imaginary part is indeed zero (up to some tiny numerical roundoff error). Maybe it's possible to write the answer in some nicer way which is obviously real, but I don't know. Anyway, if you've ever evaluated trig integrals using Euler's formulas, you might yourself have produced a complex-looking result which is actually real-valued.2011-05-15
  • 0
    @J. M. / @Hans Lundmark Ok, I see. So indeed the integral is solvable analytically, but the result is very unhandy. Thanks to everyone! :)2011-05-15
  • 1
    The "messy closed form" spat out by *Mathematica* for reference: $$\frac{i}{4}\left(\mathrm{Li}_2(-i(3-\sqrt{8}))-\mathrm{Li}_2(i(3-\sqrt{8}))\right)+\frac{\pi}{8}\mathrm{artanh}\frac{\sqrt{8}}{3}-\frac{G}{2}$$2011-05-15
  • 0
    @J. M. Thanks. What does $G$ refer to here? Is it that Catalan constant Hans Lundmark mentioned? I couldn't find anything in Wolfram's online reference and I don't have Mathematica installed on my box.2011-05-15
  • 0
    Yes.${}{}_{}^{}$2011-05-16
  • 0
    The integral is about [15](http://www.wolframalpha.com/input/?i=integrate+1%2F%28x%5E2%2By%5E2%2Bz%5E2%29%2C%7Bx%2C-1%2C1%7D%2C%7By%2C-1%2C1%7D%2C%7Bz%2C-1%2C1%7D). Take Wolfram Alpha's numerical result with a grain of salt. The argument is divergent at the origin.2012-03-16
  • 0
    @oenamen: I think Wolfram|Alpha's result is fine; it's the same as you get for the unproblematic one- and two-dimensional integrals given in the above comments. The reason the result in your deleted answer slightly differs from this is that the edge of the cube is at $\theta=\pi/4$ only at its midpoint, not throughout the edge.2012-03-16
  • 0
    @joriki: Thanks, I noticed this wedge myself this morning and deleted the answer. It was too good to be true!2012-03-16

2 Answers 2

4

I. Spherical coordinates

Let's try to do this in spherical coordinates by brute force and see what happens. $$I = 16\int_R d \Omega \ d r,$$ where $R$ is the region for which $0\leq \theta\leq \pi/2$ and $0\leq\phi\leq \pi/4$. This region splits into two parts.

In region 1, $0\leq\theta \leq \theta'$ and we integrate up to $z=1$, so $0\leq r \leq 1/\cos\theta$.

In region 2, $\theta' \leq\theta \leq \pi/2$ and we integrate to $x=1$, so $0\leq r \leq 1/(\sin\theta\cos\phi)$.

Here $\theta'$ is a function of $\phi$, $\tan\theta' = \sqrt{1+\tan^2\phi}$. Notice that $\cos\theta' = 1/\sqrt{2+\tan^2\phi}$.

The integrals over region 1 and 2 are not elementary, $$\begin{eqnarray*} I_1 &=& 16 \int_0^{\pi/4} d\phi \int_0^{\theta'} d\theta \ \sin\theta \int_0^{1/\cos\theta} dr \\ &=& 8 \int_0^{\pi/4} d\phi \ \ln(2+\tan^2\phi) \\ %%% I_2 &=& 16 \int_0^{\pi/4} d\phi \int_{\theta'}^{\pi/2} d\theta \ \sin\theta \int_0^{1/(\sin\theta \cos\phi)} dr \\ &=& 16 \int_0^{\pi/4} d\phi \ \sec\phi \ \left(\frac{\pi}{2} - \theta'\right) \\ &=& 8\pi\ln(1+\sqrt2) - 16 \int_0^{\pi/4} d\phi \ \sec\phi \ \tan^{-1}\sqrt{1+\tan^2\phi}. \end{eqnarray*}$$ It is possible to go further with these integrals, but they are pretty ugly. Numerically they give $15.3482\cdots$. Let's try another approach.

II. Divergence theorem

Let's put together the steps in the comments and make it obvious our final answer is real.

Using the divergence theorem for ${\bf F} = \hat r/r$ we find $$I = 24\int_0^1 d x \int_0^1 d y \frac{1}{x^2+y^2+1},$$ and so, going to polar coordinates, $$\begin{eqnarray*} I &=& 48\int_0^{\pi/4} d \phi \int_0^{1/\cos\phi} d r \ \frac{r}{r^2+1} \\ &=& 24\int_0^{\pi/4} d\phi \ \ln(1+\sec^2\phi). \end{eqnarray*}$$ This integral is nontrivial.

Let us try a series approach and expand in small $\phi$. We find $$\begin{eqnarray*} I &=& 6\pi \ln 2 + 24\int_0^{\pi/4}d \phi \ \left[\ln\left(1-\frac{1}{2}\sin^2\phi\right) - \ln(1-\sin^2\phi)\right] \\ &=& 6\pi \ln 2 + 12\sum_{k=1}^\infty \frac{1}{k}\left(1-\frac{1}{2^k}\right) B_{\frac{1}{2}} \left(k+\frac{1}{2},\frac{1}{2}\right) \end{eqnarray*}$$ where $B_x(a,b)$ is the incomplete beta function. The $k$th term of the sum goes like $1/k^{3/2}$. Notice that $6\pi \ln 2 \approx 13$ so the ``zeroeth'' term is already a pretty good approximation.

Mathematica gives a result that doesn't appear explicitly real, but it can be massaged into $$I = 24 \mathrm{Ti}_2(3-2\sqrt2) + 6\pi \tanh^{-1}\frac{2\sqrt2}{3} - 24 C,$$ where $\mathrm{Ti}_2(x)$ is the inverse tangent integral, with the series $$\mathrm{Ti}_2(x) = \sum_{k=1}^\infty (-1)^{k-1} \frac{x^{2k-1}}{(2k-1)^2},$$ and $C$ is the Catalan constant.

-2

The set of limits corresponds to a sphere of radius $1$ ($x$ ranges from $-1$ to $+1$; $y$ ranges from $-1$ to $+1$; and $z$ ranges from $-1$ to $+1$). Therefore we successively integrate: w.r.t.theta between zero and $\pi$; w.r.t. phi between zero and $2\pi$; and w.r.t. $r$ bet. zero and $1$ (radius vector extends from the origin to $1$). Thus we get $4\pi$ for the answer.

  • 1
    I think you're missing something. The volume [-1,1] x [-1,1] x [-1,1] describes a cube not a sphere. The sphere of radius 1 you refer to does for instance not include the point (1,1,1).2012-02-23