= Solution
For the <potential of an inverse-radius spherical charge density>, assume there is no additional point charge at the origin and choose $\phi(\infty)=0$. The enclosed charge is $Q(r)=4\pi A\int_0^r r'\,dr'=2\pi Ar^2$ for $r<a$, and $Q(a)=2\pi Aa^2$ outside. <Gauss's law> then gives
$$
E_r=\begin{cases}A/(2\epsilon_0),&0<r<a,\\Aa^2/(2\epsilon_0r^2),&r>a.\end{cases}
$$
Integrating the field inward from infinity,
$$
\boxed{\phi(r)=\begin{cases}\dfrac{A}{2\epsilon_0}(2a-r),&0<r\leq a,\\[4pt]\dfrac{Aa^2}{2\epsilon_0r},&r\geq a.\end{cases}}
$$
The potential and its first radial derivative are continuous at $a$, since there is no surface charge there. The integrable <density> singularity has a finite potential limit $\phi(0^+)=Aa/\epsilon_0$.
\Image[/past-exam-of-the-physics-course-of-the-year-4-of-the-natural-sciences-course-of-the-university-of-cambridge/2016/paper-1-spherical-potential.png]
{title=The potential falls linearly inside the inverse-radius charge cloud and joins a reciprocal-radius exterior tail}
{source=paper-1-spherical-potential.py}
Back to article page