# Triple Integrals in Spherical Coordinates, problem with boundaries

Calculate

$$\iiint \frac{1}{{x^2+y^2+z^2}}dA$$

Where

$x^2+y^2+(z-2)^2\le1$

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$

but then I am having a rough time with the boundaries. I am stuck at- $$\rho^2\sin^2\phi\cos^2\theta + \rho^2\sin^2\phi\sin^2\theta +(\rho \cos\phi-2)^2 \le 1$$

$$\rho^2-4\rho\cos\phi \ +4\le1$$

and I don't know where to go from here.

Thank you

• Have you tried making the substitution $w=z-2$? Its usually better to go for a nasty integrand than nasty boundary. – Eddy Jun 3 '18 at 16:35
• Try to change to the shifted spherical $z=2+\rho\cos\phi$.The integration is still easy ($\sin\phi$ is the derivative of $\cos\phi$, use the chain rule). – A.Γ. Jun 3 '18 at 16:35

By letting $z=2+w$ the problem boils down to computing $$\iiint_{x^2+y^2+w^2\leq 1}\frac{d\mu}{x^2+y^2+w^2+4w+4}$$ or, by setting $w=\rho\cos\theta,y=\rho\sin\theta\sin\varphi,x=\rho\sin\theta\cos\varphi$, $$2\pi\int_{0}^{1}\int_{0}^{\pi}\frac{\rho^2\sin\theta}{\rho^2+4\rho\cos\theta+4}\,d\theta\,d\rho.$$ Let us focus on the inner integral: $$\int_{0}^{\pi}\frac{\rho^2\sin\theta}{\rho^2+4\rho\cos\theta+4}\,d\theta = \frac{\rho}{2}\,\log\left(\frac{2+\rho}{2-\rho}\right)$$ by the tangent half-angle substitution. By integration by parts, the final outcome is $2\pi-\frac{3\pi}{2}\log(3)$.
• Integrals of $f(\cos x)\sin x$ are normally easier to calculate by the chain rule (substitution $t=\cos x$). – A.Γ. Jun 3 '18 at 16:51
• @A.Γ.: of course to set $\theta=\arcsin u$ is a viable alternative, but in such a case one needs to split the integration range in $(0,\pi/2)\cup(\pi/2,\pi)$ first. – Jack D'Aurizio Jun 3 '18 at 16:53
• Why to split? The antiderivative $-\frac{\rho}{4}\ln(\rho^2+4\rho\cos\theta+4)$ is a straightforward integration by the chain rule. – A.Γ. Jun 3 '18 at 17:04