# If $u(x,y)$ is harmonic on a domain $D$ and has a global maximum on $D$ then $u$ is constant on $D$

I have the following exercise in my complex analysis course:

Let $$u(x,y)$$ be harmonic function on a domain $$D$$ such that $$u$$ has a global maximum on $$D$$.
Prove that $$u$$ is constant on $$D$$.

My efforts so far:
If I knew that $$D$$ was simply connected, then I'd know how to prove it, but because it's not given, I started by using the fact that there is some point $$(x_0,y_0)\in D$$ such that for all $$(x,y)\in D$$, it holds $$u(x,y)\leq u(x_0,y_0)$$.
Now, since $$D$$ is open, there is an open disk around $$(x_0,y_0)$$ that is contained in $$D$$, and I managed to prove that $$u(x_0,y_0)$$ is constant within that disk. I'm missing the final part where I take a general $$(x,y)\in D$$ and show that $$u(x,y)=u(x_0,y_0)$$
I know that D is path connected, so there must be a path that connects $$(x,y)$$ to $$(x_0,y_0)$$ but I don't know how to continue from here (I thought about covering this path by open disks but I can't really write it down formally).

Any help would be much appreciated.

• Jan 12, 2023 at 9:35

$$\{(x,y)\in D: u(x,y)=u(x_0,y_0)\}$$ is a closed subset of $$D$$, by continuity of $$u$$. Use what you have already proved to show that it is open. Since $$D$$ is connected it follows that $$u(x,y)=u(x_0,y_0)$$ for all $$(x,y) \in D$$.
• How come the set $\{(x,y)\in D : u(x,y)=u(x_0,y_0)\}$ is closed (even though $u$ is continuous)? Let's say that we knew in advance that $u$ is constant on $D$, so it is continuous in particular. But, in this case, the above set is simply $D$, which is open (and not necessarily closed). On top of that, if this set is closed, then since it is both open and closed it must be all of $\mathbb{C}$. Am I getting it wrong? Jan 12, 2023 at 14:56
• @Vegetal605 It is a closed subset of $D$ in the subspace topology of $D$. Jan 12, 2023 at 23:13