Solution (source code)

= Solution

Under the usual bounded-domain hypotheses, with piecewise smooth boundary and a sufficiently smooth <vector field>, the <divergence theorem> states
$$
\boxed{\int_\Omega\nabla\cdot\mathbf F\,dV=\int_{\partial\Omega}\mathbf F\cdot\mathbf n\,dS,}
$$
where $\mathbf n$ is outward. Apply it to $g\mathbf F$ and use the <product rule> $\nabla\cdot(g\mathbf F)=\mathbf F\cdot\nabla g+g\nabla\cdot\mathbf F$ to obtain
$$
\boxed{\int_\Omega(\mathbf F\cdot\nabla g+g\nabla\cdot\mathbf F)\,dV
=\int_{\partial\Omega}g\mathbf F\cdot\mathbf n\,dS.}
$$
For uniqueness, let $w=u_1-u_2$ for two <classical solutions> with the same <Dirichlet boundary data>. Then $\Delta w=0$ and $w=0$ on the boundary. Taking $\mathbf F=\nabla w$, $g=w$ gives <Green's first identity> in the form
$$
\int_\Omega|\nabla w|^2\,dV
=\int_{\partial\Omega}w\partial_nw\,dS-\int_\Omega w\Delta w\,dV=0.
$$
The continuous nonnegative integrand must vanish, so $w$ is constant on each connected component. The zero boundary data make every such constant zero. Thus \b[the solution of the <Dirichlet problem> for the <Laplace equation> is unique, if it exists]. This establishes <Uniqueness of the Dirichlet problem>; existence is assumed. Boundedness, or suitable conditions at infinity, is needed: on an unbounded half-space the <harmonic function> $w=z$ has zero boundary values but is not identically zero.