Solution (source code)

= Solution

For $\Delta G=+\delta^{(3)}$, the <fundamental solution of the Laplace equation> in three dimensions is
$$
\boxed{G_0(\mathbf r,\mathbf r')=-\frac1{4\pi|\mathbf r-\mathbf r'|}}.
$$
Its sign follows from the flux: on a small sphere of radius $\varepsilon$, its outward radial <derivative> is $1/(4\pi\varepsilon^2)$, with total flux one.

Let $s=|\mathbf r'|\in(0,1)$ and put the image point at $\mathbf r'^*=\mathbf r'/s^2$. The <method of images> gives the <Dirichlet Green function inside a sphere>:
$$
\boxed{G_B(\mathbf r,\mathbf r')=-\frac1{4\pi}
\left[\frac1{|\mathbf r-\mathbf r'|}-\frac1{s|\mathbf r-\mathbf r'^*|}\right]}.
$$
The image lies outside the ball, so its potential is harmonic inside. On $|\mathbf r|=1$, the identity $|\mathbf r-\mathbf r'|=s|\mathbf r-\mathbf r'^*|$ makes the two terms cancel. The original source retains unit strength. For a source at the centre, take the limit:
$$
\boxed{G_B(\mathbf r,0)=-\frac1{4\pi}\left(\frac1{|\mathbf r|}-1\right)}.
$$