# If $f:U\rightarrow\mathbb{R}$, $U\subset\mathbb{R}^m$ open and bounded, is continuous and has partial derivatives, when does $f$ have global extrema?

My actual question was a bit too long to state on the title, but I'm trying to prove the following statement, which is a generalization of Rolle's theorem:

Let $$f:U \rightarrow \mathbb{R}$$ be continuous on the open bounded set $$U \subset \mathbb{R}^m$$, having partial derivatives at every point of $$U$$. If, for every $$a \in \partial U$$, we have $$\lim_{x \rightarrow a} f(x)=0$$, then there exists some $$c \in U$$ such that $$\frac{\partial f}{\partial x_i} (c)=0$$ for $$i=1, \dots, m$$.

I'm not yet looking for direct hints to the above statement as I feel that I need to work more on it before asking for help. However, I was thinking that, if I proved that $$f$$ attains some global extrema at some point $$c \in U$$, then I could prove that the partial derivatives vanish there. However, unlike the case for closed bounded sets, I know that continuity on an open bounded set doesn't guarantee the existence of global extrema, but I was wondering whether the additional condition $$\lim_{x \rightarrow a} f(x)=0$$ for every $$a \in \partial U$$ was enough to give us that result. This definitely seems to be the case when $$m=1$$, and perhaps when $$m=2$$ as well, though I'm having some trouble visualizing the latter. Regardless, I was also wondering if we could at least say that the function $$f$$ can be extended to a continuous function $$g$$ that has partial derivatives and is defined on a closed bounded set (perhaps the closure of $$U$$?).

... the function 𝑓 can be extended to a continuous function $$g$$ ...

Yes, you can extend $$f$$ to a continous function $$g$$ on $$\overline U$$ by defining $$g(x) = f(x)$$ for $$x \in U$$ and $$g(x) = 0$$ for $$x \in \partial U$$.

... that has partial derivatives and is defined on a closed bounded set (perhaps the closure of $$U$$?).

No, $$g$$ does not necessarily have partial derivatives at points on the boundary (example below). However, that is not needed for the desired conclusion.

If $$g$$ is identically zero then so is $$f$$ and you are done. Otherwise $$g$$ attains a strictly positive maximum or a strictly negative minimum at a point $$c \in U$$. Then $$g$$ (and consequently, $$f$$) has a global extremum at $$c$$ and all partial derivatives of $$f$$ at $$c$$ are zero.

Example: $$f(x) = \Vert x \Vert (1-\Vert x \Vert)$$ on $$U = \{ x \in \Bbb R^m \mid 0 < \Vert x \Vert < 1 \}$$. $$f$$ is continuously differentiable in $$U$$ and has zero limits at the boundary. However, the extended function $$g$$ does not have partial derivatives at the origin.

– 123
Commented Jul 25, 2023 at 7:17
• Would you happen to be able to check a similar problem I'm working on the following link? math.stackexchange.com/questions/4742957/…
– 123
Commented Jul 26, 2023 at 21:05

Suppose $$\sup f > 0$$, then let $$C = \{ x \in U | f(x) \ge {1 \over 2} \sup f \}$$. Note that $$C$$ is closed (why?) hence compact and so $$f$$ attains a $$\max$$ at some $$c \in C$$, and we must also have that $$f$$ attains a $$\max$$ on $$U$$ at $$c$$ (again, why?). Since $$c \in U^\circ = U$$, we must have $${\partial f(c) \over \partial x_k} = 0$$ for all $$k$$.

If $$\sup f < 0$$, repeat the above in a similar manner.

Otherwise pick any point in $$U$$.

• Would $C$ be closed because it's the pre-image $f^{-1}([1/2 \sup f, + \infty))$ of a closed set and $f$ is continuous?
– 123
Commented Jul 25, 2023 at 7:16
• @osrs Well, a little care is needed since the domain of $f$ is $U$. For example, the preimage of $\mathbb{R}$ is $U$ which is closed relative to $U$ but not in $\mathbb{R}^n$. It might be easier to show that if $x_n \to x$ with $x_n \in C$ then $x \in C$. Commented Jul 25, 2023 at 17:27
• Oh, I see, and that would simply follow from continuity: $f(x)=\lim f(x_n) \geq \lim 1/2 \sup f = 1/2\sup f$ so $x \in C$.
– 123
Commented Jul 26, 2023 at 4:07
• @osrs That is correct, then you have compactness from which an extremiser follows. In Since the extremiser is not at the boundary it is in the interior. Commented Jul 26, 2023 at 4:30
• That’s great. Thank you so much for the answer!
– 123
Commented Jul 26, 2023 at 5:51