a Poisson Equation with boundary has a general solution by Green’s theorem. the Green’s theorem stated that a volume integral of Laplacian can be converted to a surface integral. combined this with Green’s function. the general solution of a Poisson equation:

$\nabla^2 \Phi = \rho$

is:

$\Phi(\vec{r}) = \frac{1}{4\pi} \int{\rho(\vec{r'}) G(\vec{r},\vec{r'})d^3x'} + \frac{1}{4\pi}\oint{G(\vec{r},\vec{r'}) \frac{\partial \Phi(\vec{r'})}{\partial n'}-\Phi(\vec{r}) \frac{\partial G(\vec{r},\vec{r'})}{\partial n'}d^2x'}$

usually, the boundary condition is given and this make the solution unique. There are 2 boundary conditions that will give unique solution.

1. Dirichlet – given the potential on the boundary, this requires the Green’s  function be Zero on the boundary.
2. Neumenn – given the field, or the change of the potential on the boundary, this requires the change of the Green’s function be $- 4\pi / S$ on the surface. where S is the total surface area.

Thus, the problem of solving the Poisson equation is equivalent with finding the Green’s function with certain requirement for boundary condition. the Green function should obey this equation:

$\nabla^2 G(\vec{r},\vec{r'})=-4\pi \delta(\vec{r}-\vec{r'})$

because a complete solution of a differential equation must include the homogeneous solution. in this case, the Laplace equation:

$\nabla^2 \Phi=0$

thus, the Green’s function must contain a part from it. for example.

$G(\vec{r},\vec{r'}) = \frac{1}{|\vec{r}-\vec{r'}|} + F(\vec{r},vec{r'})$

with

$\nabla^2 F(\vec{r}, \vec{r'}) = 0$

the method of finding the Green’s function is from the Laplace equation. when we solving Laplace equation in certain coordinate, we get the eigen function for the Laplacian.  The eigen function span the space of function. Thus, we can construct the Green’s function from eigen function.