Example of solving isotropic Poisson equation with boundary conditions

Solve $$ \begin{align*} \nabla^2\psi = \begin{cases} -\rho_0, & r\leq R, \\ 0, & r>R. \end{cases} \end{align*} $$ where $\rho_0$ is a constant with the requirement

  1. $\psi(r=0)$ is non-singular;

  2. $\psi(r)\to 0$ as $r\to \infty$;

  3. $\psi$ and $\psi'$ are continuous.

For $r\leq R$, the complimentary function is the isotropic solution of Laplace equation, which is $A/r + B$. For particular solution, try $\psi(r) = Cr^{p}$. Then $$ \begin{align*} -\rho_0 = C\nabla^2(r^{p}) = C\frac{1}{r^2} \pdd r\left(r^2\pdfd{r^{p}}r\right) = Cp(p+1)r^{p-2} \implies p=2, C=-\frac{1}{6}\rho_0. \end{align*} $$ Applying 1, $A=0$. So $$ \begin{align*} \psi(r) = B - \frac{1}{6}\rho_0 r^2, \qquad r\leq R. \end{align*} $$

For $r>R$, the solution is $D/r+E$, and applying 2, we have $E=0$, so $$ \begin{align*} \psi(r) = \frac{D}{r}, \qquad r>R. \end{align*} $$

Now we patch the two solutions together using 3: $$ \begin{cases} \frac{D}{R} &= \psi(r=R) &= B - \frac{1}{6}\rho R^2, \\ -\frac{D}{R^2} &= \psi'(r=R) &= -\frac{1}{3}\rho_0 R. \end{cases} $$ Solving, $$ \begin{align*} D = \frac{1}{3}\rho_0 R^3, \quad B = \frac{1}{2}\rho_0 R^2. \end{align*} $$ Hence the solution is $$ \begin{align*} \psi(r) = \begin{cases} \frac{1}{6} \rho_0 (3R^2 - r^2), & r\leq R, \\ \frac{1}{3} \rho_0 R^3/r, & r>R. \end{cases} \end{align*} $$