# Triple Integrals in Spherical Coordinates where (z-2)^2

$$\iiint \frac{1}{\sqrt{x^2+y^2+(z-2)^2}}$$

for $x^2+y^2+z^2 = 1$

I've used spherical coordinates, like this: $x=\rho sin\phi cos\theta$; $y=\rho sin\phi sin\theta$; $z=\rho cos\phi$ and $J=\rho^2 sin\phi$

$$\rho^2 sin^2\phi cos^2\theta + \rho^2 sin^2\phi sin^2\theta +\rho^2 cos^2\phi = 1$$ $$\rho^2 sin^2\phi + \rho^2 cos^2\phi = 1$$ $$\rho^2 = 1$$ $$\rho = 1$$

and when i put coordinates in my initial integral and simplify it, i get this:

$$\int_0^{2\pi}\int_0^\pi\int_0^1\frac{1}{\sqrt{\rho^2-4\rho cos\phi +4}}\rho^2sin\phi d\theta d\phi d\rho$$

and i can not move from there. Please, help.

• complete the square under the radical, and do $\tan u$ substitution. A lot of the messy stuff will cancel out along the way. – Doug M Jun 10 '16 at 21:21
• Could you please show me? – mirai Jun 10 '16 at 21:22

\begin{align}&\int_0^{2\pi}\int_0^{\pi}\int_0^1\frac1{\sqrt{\rho^2-4\rho\cos\phi+4}}\rho^2d\rho\sin\phi\,d\phi\,d\theta\\ &=2\pi\int_0^{\pi}\int_0^1\frac1{\sqrt{\rho^2-4\rho\cos\phi+4}}\rho^2d\rho\sin\phi\,d\phi\\ &=2\pi\int_0^1\left[\frac12\sqrt{\rho^2-4\rho\cos\phi+4}\right]_0^{\pi}\rho\,d\rho\\ &=\pi\int_0^1\left[|\rho+2|-|\rho-2|\right]\rho\,d\rho\\ &=\pi\int_0^12\rho^2d\rho=\frac{2\pi}3\end{align}

• I see. But what did you do with $sin\phi$? – mirai Jun 10 '16 at 22:29
• Let $u=\rho^2-4\rho\cos\phi+4$. Then (holding $\rho$ constant) $du=4\rho\sin\phi\,d\phi$ and $$\int\frac{\rho\sin\phi\,d\phi}{\sqrt{\rho^2-4\rho\cos\phi+4}}=\int\frac{du}{4 \sqrt {u}}=\frac12\sqrt u+C=\frac12\sqrt{\rho^2-4\rho\cos\phi+4}+C$$ So the $\sin\phi$ was useful for integrating that square root which might otherwise have become an elliptic integral. – user5713492 Jun 10 '16 at 22:38
• And what about the boundaries? – mirai Jun 10 '16 at 22:42
• Same as you had them in your question: over the unit sphere. – user5713492 Jun 10 '16 at 22:44

I was going to suggest the substitution.

$\rho = 2\sin \phi\tan u + 2 \cos \phi$

And that would clean up the radical. But, after thinking about it, I decided that spherical is not the way to go.

$x = r \cos \theta\\ y = r \sin \theta\\ z = z\\ dx\,dy\,dz = r\,dr\,dz\,d\theta$

$\int\int\int\dfrac {r}{\sqrt{r^2 + (z-2)^2}} dr\,dz\,d\theta$

We would like to integrate by r first. Otherwise, we have an inverse tangent to deal with. So, find limits of r in terms of z.

$\int_0^{2\pi}\int_{-1}^1\int_0^{\sqrt{1-z^2}} \dfrac {r}{\sqrt{r^2 + (z-2)^2}} dr\,dz\,d\theta\\ \int_0^{2\pi}\int_{-1}^1 (r^2 + (z-2)^2)^{\frac12}|_0^{\sqrt{1-z^2}} dz\,d\theta\\ \int_0^{2\pi}\int_{-1}^1 [(1-z^2 + (z-2)^2)^{\frac12} - ((z-2)^2)^{\frac12}]dz\,d\theta\\ \int_0^{2\pi}\int_{-1}^1 (-4z+5)^{\frac12} - |z-2|dz\,d\theta$

And you can get home from here.

Suppose we stuck with spherical, and flipped the order of integration!

$\int_0^1\int_0^\pi\int_0^{2\pi}\frac{\rho^2\sin\phi}{\sqrt{\rho^2-4\rho \cos\phi +4}} d\theta d\phi d\rho$

$2\pi\int_0^1\int_0^\pi\frac{\rho^2sin\phi}{\sqrt{\rho^2-4\rho \cos\phi +4}} d\phi d\rho$

$u = \rho^2-4\rho \cos\phi +4\\ du = 4\rho \sin\phi d\phi$

$2\pi\int_0^1\int_{\rho^2 - 4\rho + 4}^{\rho^2+4\rho + 4}\frac{\rho}{4\sqrt{u}} du d\rho\\ 2\pi\int_0^1\frac 12 \sqrt{u}\rho|_{\rho^2-4\rho + 4}^{\rho^2+4\rho + 4} d\rho\\ 2\pi\int_0^1\frac 12 (|\rho+2|\rho - |\rho-2|\rho) d\rho\\ 2\pi\int_0^1 \rho^2\, d\rho\\ \frac{2\pi}{3} \rho^3|_0^1 \\ \frac{2\pi}{3}$

• I suppose that could be the way, too. But i thought since i have a sphere, it would be much easier with spherical coordinates. – mirai Jun 10 '16 at 22:30
• And frequently it is. But sometimes it isn't. – Doug M Jun 10 '16 at 22:32
• @mirai I made an update staying in spherical coordinates. – Doug M Jun 10 '16 at 23:05
• I checked your exposition in cylindrical coordinates and with your latest round of corrections it matches my answer. Your first error in spherical coordinates was $\rho^2+4\rho+4\ne\rho^2+8$. – user5713492 Jun 10 '16 at 23:22
• @user5713492 Got it, thanks. – Doug M Jun 10 '16 at 23:51

I think it would be better if you first use $t=z-2$. This way, you have $(x^2+y^2+z^2=1)\rightarrow (x^2+y^2+t^2+4t+3=0)$. Then, use the spherical coordinates. Now, your integral would be really simple, and you need to find the proper boundaries for new integral.

$(x^2+y^2+t^2+4t+3=0) \rightarrow \rho^2+4\rho cos\phi +3=0 \rightarrow \rho =-2cos\phi \pm \sqrt{4(cos\phi)^2-3} \rightarrow -2cos\phi - \sqrt{4(cos\phi)^2-3}\leq \rho\leq -2cos\phi + \sqrt{4(cos\phi)^2-3}$.

• Wouldn't i have $\iiint \frac{1}{\sqrt{x^2+y^2+t^2}}$ then? – mirai Jun 10 '16 at 21:38
• Yeah. The integral would be simple and just the boundary of $\rho$ will be changed. – Majid Jun 10 '16 at 21:42
• And how did you get $x^2+y^2+t^2+4t+3=0$ ? Should it be -4 maybe? – mirai Jun 10 '16 at 22:28
• $t=z-2\rightarrow z=t+2$ and by substituting $z$ in $x^2+y^2+z^2=1$, we have $x^2+y^2+t^2+4t+4=1$ that is equal to what I got there. – Majid Jun 11 '16 at 0:57