# Direct calculation of the gravitational potential inside a hollow sphere

I calculated the gravitational potential inside a massive sphere with constant density and got the result:

$$\Phi = -2\pi G\rho R^2 + \frac{2}{3}\pi G\rho R_p^2$$ Where $$R$$ is the radius of the sphere and $$R_p$$ the distance of the point where the potential is evaluated from the center. It is fine, because minus the gradient of the potential gives the well known result that the acceleration of gravity increases linearly with the radius.

It is easy to use the result for $$\Phi$$, and show that the potential of a hollow sphere, with external radius $$R_e$$ and internal radius $$R_i$$ is constant. $$\Phi_h = -2\pi G\rho R_e^2 + \frac{2}{3}\pi G\rho R_p^2 - (-2\pi G\rho R_i^2 + \frac{2}{3}\pi G\rho R_p^2) = -2\pi G\rho(R_e^2 - R_i^2)$$

Once again it is fine, because the acceleration is indeed zero inside.

But when I try to calculate directly the potential inside a (infinitelly thin) spherical shell, I got a wrong result, with a non-constant field. The integration is simpler than for a massive sphere, but I can't find the mistake. All the sites of the internet that I saw calculate directly the acceleration inside, not the potential.

Does anyone know where it is calculated? Or present the derivation as an answer?

• Problem solved. If the solution of an integral is $\sqrt{x}|_a^b$, that means $\sqrt{b} - \sqrt{a}$, and not $\sqrt{b-a}$. Math blindness... Commented Jun 5, 2022 at 19:26

I don't remember how the constants work out, but we're basically looking at this integral $$\int_{S^2}\frac{dA}{|\mathbf{x}-\mathbf{x}'|}.$$
Let's put the observation point on the $$z$$-axis, then we have $$\int_0^\pi d\theta \int^{2\pi}_0 d\phi \frac{R^2 \sin\theta}{\sqrt{r^2+R^2-2r R \cos\theta}},$$ which is easily evaluated to $$2\pi\frac{R}{r}\left(|r+R|-|r-R|\right).$$
For $$r, this evaluates to $$4\pi R$$.
By Gauss's law, the field is \begin{align} \mathbf{g}(\mathbf{r}) = \begin{cases}0& r < R\\ \frac{GM}{r^2}\hat{\mathbf{r}} & r>R\end{cases} \end{align} So with $$\Phi = 0$$ at $$r\rightarrow \infty$$, the potential inside the shell is \begin{align} \Phi(\mathbf{r}) &= - \int_{\infty}^{\mathbf{r}} \mathbf{g}\cdot d\boldsymbol{\ell}\\ &= -\int_{\infty}^{R} \frac{GM}{r^2}dr\\ &= \frac{GM}{R} \end{align}