So, as noted, we use Poynting's theorem to get:
$$\frac{1}{\mu_0} \oint_{\partial V} (\vec{E} \times \vec{B}) \cdot d\vec{S} = -\int_V \vec{E} \cdot \vec{J} dV$$
[The static version of Poynting's theorem is just: divergence theorem, $\nabla \cdot (\vec{E} \times \vec{B}) = \vec{B} \cdot (\nabla \times \vec{E}) - \vec{E} \cdot (\nabla \times \vec{B})$, then $\nabla \times \vec{E} = 0$ and $\nabla \times\vec{B} = \mu_0\vec{J}$]

The electric field is just the negative gradient of electric potential. We can use integration by parts in higher dimensions:

$$-\int_V \vec{E}\cdot\vec{J} dV = \int_V (\nabla \phi) \cdot \vec{J} dV = \oint_{\partial V} \phi \vec{J} \cdot d\vec{S} - \int_V \phi(\nabla \cdot \vec{J}) dV$$

The current density doesn't diverge. So it's just the first term, basically, the surface integral of voltage times current.

Of course your boundary condition says there's no current out of the surface, still, the previous statement holds in static situations even without that boundary condition.

Good questions; I'm sure a lot of people are confused on this stuff (as I was the first time I used Jackson).

Essentially your confusion boils down to being careful to consider the following fact:

*The Green's function for a particular boundary value problem depends on the boundary conditions.*

In particular, let's say you have a Dirichlet boundary value problem. Then, as Jackson shows on page 39, the appropriate Green's function for such a boundary value problem must (a) satisfy Poisson's equation with a delta function source in that region and (b) vanish on the boundary (see eq. 1.43) of that region. If you can find a function that has these two properties in the region you are considering, then you have found the Green's function for the Dirichlet problem.

So if we consider the half space ($z>0$) with dirichlet boundary conditions at $z=0$, then we are looking for a function that satisfies Poisson's equation in the upper half space with unit source *and* which vanishes on the boundary, which in this case is $z=0$ plus the "boundary at infinity."

You can check yourself that the function
$$
G(\mathbf x, \mathbf x') = \frac{1}{|\mathbf x - \mathbf x'|} - \frac{1}{|\mathbf x + \mathbf x'|}
$$
has these properties. The intuition for this, and the reason why most people say you can just immediately write this down, is that the first term clearly satisfies Poisson's equation with unit source in the upper half space where $\mathbf x'$ is being taken to have $z>0$, and the second term corresponds to having a unit source in the lower half space with opposite sign. Our intuition about potentials of points charges indicates that this will cause that combination to vanish at $z=0$. Also, the Laplacian of the second term vanishes in the upper half space, so it doesn't affect the fact that in the upper half space, this function satisfies Poisson's equation with unit source at $\mathbf x'$.

I hope that was clear? I can definitely try to clean it up or expand on this. I know from personal experience that it's a confusing topic!

**Addendum** in response to comments.

Green's functions are associated with a set of two data (1) A region (2) boundary conditions on that region. The function $1/|\mathbf x-\mathbf x'|$ is the Green's function for (1) All of space with (2) Dirichlet boundary conditions. This is because it (a) satisfies Poisson's equation with unit source in that region and (b) vanishes at the boundary of that region (which in this case is at infinity). In general, for any region $R$, for Dirichlet boundary conditions, as long as we simply find a function $G(\mathbf x,\mathbf x')$ that, (a) satisfies Poisson's equation with a unit source placed in that region, and that (b) vanishes on the boundary of the region, then we have found the Green's function for that Dirichlet problem (by the definition of a Green's function).

When we are trying to find the Green's function for the Dirichlet problem on the upper half space, we first imagine putting a point charge in the upper half space so that condition (a) is satisfied, this leaves us with the function $1/|\mathbf x-\mathbf x'|$ where $\mathbf x'$ is a point in the upper half space. Then, we notice that although this function is an appropriate solution to Poisson's equation, it does not vanish for $x$ on the boundary, so this can't be the Green's function for this Dirichlet problem. We need to do something to this function which does not spoil the fact that it satisfies the unit source Poisson equation in the upper half space but such that the resulting function additionally satisfies the appropriate boundary condition.

So we ask ourselves "what can we do to this function so that (a) remains satisfied, but so that (b) is also satisfied *in the upper half space*. Well we notice that if we add any function that satisfies *Laplace's equation* (Laplacian equaling zero) in the upper half space to $1/|\mathbf x-\mathbf x'|$, then the resulting function will still satisfy (a).

Now what sorts of functions satisfy Laplace's equation in the upper half space?

The answer is *any charge distribution whose charge density is only nonzero outside of the upper half space will create a potential that satisfies Laplace's equation in the upper half space*.

So if we can find a charge distribution that when placed in the lower half space produces a potential that when added to $1/|\mathbf x-\mathbf x'|$ causes their sum to vanish on the boundary, then their sum will satisfy the properties required of a Green's function. This is where we notice that an "image" point charge will do exactly this!

All we are doing with this point charges is an intuitive way of finding a function that satisfies the appropriate mathematical properties (a) and (b) that a Green's function for a Dirichlet problem must satisfy.

## Best Answer

Everything is OK with your proof, at last when the two densities of charge are (measurable) bounded functions with bounded support, as physically expected. In that case all the manipulations of integrals you did are allowed by Fubini and Tonelli's theorem.