[proofplan]
We subtract two putative solutions to form a [harmonic](/page/Laplace's-Equation) function $w$ that vanishes on $\partial U$. The [Strong Maximum Principle](/theorems/32) applied to both $w$ and $-w$ forces $w \equiv 0$, giving uniqueness.
[/proofplan]
[step:Form the difference and verify it is harmonic with zero boundary data]
Suppose $u_1, u_2 \in C^2(U) \cap C(\overline{U})$ both solve the [boundary](/page/Boundary) value problem. Define $w := u_1 - u_2$. By linearity of the Laplacian:
\begin{align*}
\Delta w = \Delta u_1 - \Delta u_2 = f - f = 0 \quad \text{in } U.
\end{align*}
By the boundary condition:
\begin{align*}
w = u_1 - u_2 = g - g = 0 \quad \text{on } \partial U.
\end{align*}
So $w \in C^2(U) \cap C(\overline{U})$ is harmonic in $U$ and vanishes on $\partial U$.
[/step]
[step:Apply the maximum principle to both $w$ and $-w$ to conclude $w \equiv 0$]
Since $w$ is harmonic and continuous on $\overline{U}$, the [Maximum Principle](/theorems/32) (part (i)) gives:
\begin{align*}
\max_{\overline{U}} w = \max_{\partial U} w = 0, \qquad \min_{\overline{U}} w = \min_{\partial U} w = 0,
\end{align*}
where the minimum principle follows by applying the maximum principle to $-w$, which is also harmonic. Therefore $0 \le w \le 0$ throughout $\overline{U}$, so $w \equiv 0$ in $U$.
[guided]
We apply the [Maximum Principle](/theorems/32) (part (i)) to the harmonic function $w$. This requires $w \in C^2(U) \cap C(\overline{U})$ with $\Delta w = 0$ in $U$, both of which we verified in the previous step.
The maximum principle states $\max_{\overline{U}} w = \max_{\partial U} w$. Since $w = 0$ on $\partial U$, this gives $\max_{\overline{U}} w = 0$, meaning $w(x) \le 0$ for all $x \in \overline{U}$.
For the lower bound, note that $-w$ is also harmonic in $U$, since $\Delta(-w) = -\Delta w = 0$. Moreover, $-w \in C^2(U) \cap C(\overline{U})$ and $-w = 0$ on $\partial U$, so $-w$ satisfies the same hypotheses. Applying the [Maximum Principle](/theorems/32) (part (i)) to $-w$:
\begin{align*}
\max_{\overline{U}} (-w) = \max_{\partial U} (-w) = 0,
\end{align*}
which gives $-w(x) \le 0$, i.e., $w(x) \ge 0$ for all $x \in \overline{U}$.
Combining the upper and lower bounds: $0 \le w(x) \le 0$ for all $x \in \overline{U}$, so $w \equiv 0$ in $\overline{U}$.
[/guided]
[/step]
[step:Conclude uniqueness]
From $w \equiv 0$ we obtain $u_1 \equiv u_2$ in $U$. Therefore there exists at most one solution $u \in C^2(U) \cap C(\overline{U})$ to the Dirichlet problem.
[/step]