[proofplan]
Suppose two solutions $u_1, u_2$ exist. Their difference $w := u_1 - u_2$ is [harmonic](/page/Laplace%27s%20Equation) in $U$ with zero boundary trace. Applying Green's first identity to the pair $(w, w)$, both the boundary term (since $w = 0$ on $\partial U$) and the volume term involving $\Delta w$ (since $\Delta w = 0$) vanish, forcing $\int_U |\nabla w|^2 \, d\mathcal{L}^n = 0$. Since $|\nabla w|^2$ is [continuous](/page/Continuity) and nonnegative, $\nabla w \equiv 0$ in $U$, so $w$ is constant on each [connected](/page/Connectedness) component; the zero boundary condition forces $w \equiv 0$.
[/proofplan]
[step:Form the difference $w := u_1 - u_2$ and identify its PDE and boundary data]
Let $u_1, u_2 \in C^2(\overline{U})$ both solve the Dirichlet problem:
\begin{align*}
-\Delta u_j = f \text{ in } U, \qquad u_j = g \text{ on } \partial U \qquad (j = 1, 2).
\end{align*}
Define $w := u_1 - u_2 \in C^2(\overline{U})$. By linearity of the Laplacian,
\begin{align*}
\Delta w = \Delta u_1 - \Delta u_2 = (-f) - (-f) = 0 \quad \text{in } U,
\end{align*}
and $w = g - g = 0$ on $\partial U$. Thus $w$ is harmonic in $U$ with zero Dirichlet boundary condition.
[/step]
[step:Apply Green's first identity to deduce $\int_U |\nabla w|^2 \, d\mathcal{L}^n = 0$]
Since $w \in C^2(\overline{U})$ and $U$ is a bounded $C^1$ domain, [Green's first identity](/theorems/30) with both entries equal to $w$ gives
\begin{align*}
\int_U |\nabla w|^2 \, d\mathcal{L}^n = \int_{\partial U} w\, \partial_\nu w \, d\mathcal{H}^{n-1} - \int_U w\, \Delta w \, d\mathcal{L}^n,
\end{align*}
where $\partial_\nu w := \nabla w \cdot \nu$ and $\nu$ is the outward unit normal on $\partial U$. The boundary integral vanishes because $w = 0$ on $\partial U$:
\begin{align*}
\int_{\partial U} w\, \partial_\nu w \, d\mathcal{H}^{n-1} = 0.
\end{align*}
The volume integral vanishes because $\Delta w = 0$ in $U$:
\begin{align*}
\int_U w\, \Delta w \, d\mathcal{L}^n = 0.
\end{align*}
Therefore
\begin{align*}
\int_U |\nabla w|^2 \, d\mathcal{L}^n = 0.
\end{align*}
[guided]
We need to show that the difference $w$ has no "energy." Green's first identity provides the tool: it relates the $L^2$ norm of $\nabla w$ to boundary and volume terms involving $w$ itself. Applying it with both test functions equal to $w$:
\begin{align*}
\int_U |\nabla w|^2 \, d\mathcal{L}^n = \int_{\partial U} w\, \partial_\nu w \, d\mathcal{H}^{n-1} - \int_U w\, \Delta w \, d\mathcal{L}^n.
\end{align*}
Why do both right-hand terms vanish? The boundary term vanishes because $w = 0$ on $\partial U$ --- this is where the Dirichlet condition is consumed. The volume term vanishes because $\Delta w = 0$ in $U$ --- this is where harmonicity of $w$ is consumed. Without either condition, we could not conclude that $\nabla w = 0$. Together they force
\begin{align*}
\int_U |\nabla w|^2 \, d\mathcal{L}^n = 0.
\end{align*}
This is the energy argument: the Dirichlet energy of $w$ is zero.
[/guided]
[/step]
[step:Conclude $\nabla w \equiv 0$ and $w \equiv 0$ via the boundary condition]
The integrand $|\nabla w|^2$ is continuous on $U$ (since $w \in C^2(\overline{U})$) and nonnegative. A continuous nonnegative function whose integral over an open set is zero must vanish identically:
\begin{align*}
\nabla w \equiv 0 \quad \text{in } U.
\end{align*}
Since $\nabla w \equiv 0$, the function $w$ is constant on each connected component of $U$. Each connected component of the bounded domain $U$ has its boundary contained in $\partial U$, and $w = 0$ on $\partial U$, so by continuity the constant must be $0$. Therefore $w \equiv 0$ in $U$, which gives $u_1 \equiv u_2$ in $U$.
[/step]