Solution (source code)

= Solution

The \b[<maximum principle for subharmonic functions>] here states that if $u\in C^2(D)\cap C(\overline D)$ and $\Delta u=f\geq0$ in $D$, then
$$
\boxed{\max_{\overline D}u=\max_{\partial D}u.}
$$
If $f\leq0$, apply this to $-u$ to obtain the corresponding minimum principle. In particular a <harmonic function> has both its maximum and minimum on the boundary. Without a sign condition on $f$, this conclusion need not hold.

First suppose $\Delta u>0$. By <compactness> and continuity, $u$ attains a maximum on $\overline D$. At an interior maximum, the first derivatives vanish and the <Hessian matrix> is negative semidefinite. Its trace is then nonpositive, contradicting $\Delta u>0$. Thus a maximum lies on the boundary.

For the non-strict case put $u_\epsilon=u+\epsilon(x^2+y^2)$, with $\epsilon>0$. Then $\Delta u_\epsilon=f+4\epsilon>0$, so the strict case yields, for $z\in\overline D$,
$$
u(z)+\epsilon|z|^2\leq\max_{\partial D}(u+\epsilon)
=\max_{\partial D}u+\epsilon.
$$
Let $\epsilon\downarrow0$. This gives $u(z)\leq\max_{\partial D}u$, proving the theorem. The argument proves the weak maximum principle; it does not claim that every maximizer must be on the boundary when $u$ is constant.