Solution (source code)

= Solution

The <product rule> gives
$$
\nabla\cdot(f\nabla g)=\nabla f\cdot\nabla g+f\nabla^2g.
$$
Apply the <divergence theorem>, with outward <unit normal> $\mathbf n$, and use the vanishing <Laplacian> of the <harmonic function> $g$:
$$
\int_V\nabla f\cdot\nabla g\,dV=\int_S f\nabla g\cdot\mathbf n\,dS.
$$
The boundary value of $f$ is one. Another application of the <divergence theorem> therefore gives
$$
\int_S f\nabla g\cdot\mathbf n\,dS=\int_S\nabla g\cdot\mathbf n\,dS=\int_V\nabla^2g\,dV=\boxed{0}.
$$
This is the <gradient pairing with a boundary-constant function and a harmonic function>, obtained directly from <Green's first identity>. The <harmonic function> must be regular throughout the volume; an interior singularity can supply an additional boundary flux.