I would like someone to review my solution please, the original question is to calculate
$\iiint \frac{1}{x^2+y^2+(z-2)^2}dA$ where $A=\{x^2+y^2+z^2 \leq 1\}$
What I did:
First I changed variables to polar coordinates in order to simplify the boundaries:
$x=r\sin\theta cos\phi$, $y=r\sin\theta \sin\phi$, $z=r\cos\theta$, $0\leq r \leq 1$, $0\leq \theta \leq \pi$, $0 \leq \phi \leq 2\pi$ and the jacobian is $r^2\sin\theta$.
to get the following result:
$$\int_{0}^{2\pi}\int_{0}^{\pi}\int_{0}^{1} \frac{r^2sin\theta}{r^2-2rcos\theta+4}drd\theta d\phi$$
We can see that $\phi$ doesn't appear in any integral, so we can just multiply by $2\pi-0=2\pi$ and forget about it:
$$\int_{0}^{2\pi}\int_{0}^{\pi}\int_{0}^{1} \frac{r^2sin\theta}{r^2-2rcos\theta+4}drd\theta d\phi =2\pi \int_{0}^{\pi}\int_{0}^{1} \frac{r^2sin\theta}{r^2-2rcos\theta+4}drd\theta$$
now I used substitution, $\alpha=-cos\theta$, $d\alpha =sin\theta d\theta$, $-1 \leq \alpha \leq 1$
$$2\pi \int_{0}^{\pi}\int_{0}^{1} \frac{r^2sin\theta}{r^2-2rcos\theta+4}drd\theta=2\pi \int_{-1}^{1}\int_{0}^{1}\frac{r^2sin\theta}{r^2+2r\alpha+4}dr\frac{d\alpha}{sin\theta}$$
cancel the sine to get:
$$2\pi \int_{-1}^{1}\int_{0}^{1}\frac{r^2}{r^2+2r\alpha+4}drd\alpha$$
this integral is very difficult (at least wasn't apparent to me) if we integrate by $r$. luckily, Fubini's theorem states that we can integrate by $\alpha$ first and the result won't change:
$$2\pi \int_{-1}^{1}\int_{0}^{1}\frac{r^2}{r^2+2r\alpha+4}drd\alpha=2\pi\int_{0}^{1}\int_{-1}^{1}\frac{r^2}{r^2+2r\alpha+4}d\alpha dr $$
The antiderivative of $$\frac{1}{r^2+2r\alpha+4}$$ with respect to alpha is $$\frac{\ln(r^2+2r\alpha+4)}{2r}$$
since $\alpha$ goes from $-1$ to $1$: $$\frac{\ln(r^2+2r+4)}{2r}-\frac{\ln(r^2-2r+4)}{2r} = \frac{\ln(r+2)^2-\ln(r-2)^2}{2r}=\frac{\ln(\frac{r+2}{r-2})}{r}$$ so:
$$2\pi\int_{0}^{1}\int_{-1}^{1}\frac{r^2}{r^2+2r\alpha+4}d\alpha dr=2\pi \int_{0}^{1}r\ln(\frac{r+2}{r-2})dr$$
Now I integrated by parts $\int uv'=uv-\int u'v$ where $u=\ln(\frac{r+2}{r-2})$, $u'=\frac{-4}{r^2-4}$, $v'=r$, $v=\frac{r^2}{2}$:
$$\int r\ln(\frac{r+2}{r-2})dr=\frac{r^2ln(\frac{r+2}{r-2})}{2}-\int\frac{-2r^2}{r^2-4}dr =\frac{r^2ln(\frac{r+2}{r-2})}{2}+2(r+\ln(\frac{r-2}{r+2})+2)$$
when $r=1$:
$$\frac{1^2ln(-3)}{2}+2(1+\ln(\frac{-1}{3})+2)=\frac{1}{2}\ln(-3)-2\ln(-3)+6=-\frac{3}{2}\ln(3)-\frac{3\pi i}{2}+6$$
when $r=0$:
$$0+2(0+\ln(-1)+2)=2\ln(-1)+4=2\ln(1)+2\pi i+4=4+2\pi i$$
Subtract the 2 results to get: $$-\frac{3}{2}\ln(3)-\frac{3\pi i}{2}+6-4-2\pi i=2-\frac{3}{2}\ln(3)-\frac{7\pi i}{2}$$
Multiply this result by $2\pi$ to reach the final answer which is $$4\pi-3\pi \ln(3)-7\pi^2i$$
Is this indeed the correct answer? Is there a better way of solving this? this seems like a very difficult way to do the exercise.