# Two definitions of continuous differentiability

Recently I have seen two different definitions of continuous differentiability for a real-valued function of several variables $$f(\mathbf{x}) = f(x_1,\ldots,x_n)$$ on a set $$E \subseteq \mathrm{int} \operatorname{dom} f \subseteq \mathbb{R}^n$$:

1. Real-valued function of several variables $$f(\mathbf{x}) = f(x_1,\ldots,x_n)$$ is said to be continuously differentiable on a set $$E \subseteq \mathrm{int} \operatorname{dom} f \subseteq \mathbb{R}^n$$ if for each $$\mathbf{x}_0 \in E$$ the following holds: all first-order partial derivatives of $$f$$ are defined in some neighborhood $$U(\mathbf{x}_0)$$ and are continuous at $$\mathbf{x}_0$$.

2. Real-valued function of several variables $$f(\mathbf{x}) = f(x_1,\ldots,x_n)$$ is said to be continuously differentiable on a set $$E \subseteq \mathrm{int} \operatorname{dom} f \subseteq \mathbb{R}^n$$ if it is differentiable at every point of $$E$$ and its derivative $$f'(\mathbf{x})$$ is continuous at every point of $$E$$ (as vector function).

I guess that these two definitions are equivalent if the set $$E$$ is open (I think this basically follows from Theorem 9.21 from Rudin's Principles of Mathematical Analysis). But they don't seem to be equivalent if the set $$E$$ is not open.

So which of these two definitions is more correct and popular, especially in the context of mathematical optimization problems ?
(as far as I know, in optimization problems we often have a function $$f(\mathbf{x})$$ which is continuously differentiable on a set $$E \subseteq \mathrm{int} \operatorname{dom} f \subseteq \mathbb{R}^n$$, where the set $$E$$ is called the feasible set of the problem $$\min_{\mathbf{x} \in E} f(\mathbf{x})$$)

Edit. I think there exist two more definitions that seem reasonable. However, I have not seen them in textbooks (for the considered case of $$E \subseteq \operatorname{int} \operatorname{dom} f \subseteq \mathbb{R}^n$$).

1. Real-valued function of several variables $$f(\mathbf{x}) = f(x_1,\ldots,x_n)$$ is said to be continuously differentiable on a set $$E \subseteq \mathrm{int} \operatorname{dom} f \subseteq \mathbb{R}^n$$ if there is an open set $$U$$, such that $$E \subseteq U \subseteq \operatorname{int} \mathrm{dom} f$$ and $$f \in C^1(U)$$

2. Real-valued function of several variables $$f(\mathbf{x}) = f(x_1,\ldots,x_n)$$ is said to be continuously differentiable on a set $$E \subseteq \mathrm{int} \operatorname{dom} f \subseteq \mathbb{R}^n$$ if $$f|_{\operatorname{int} E} \in C^1(\operatorname{int} E)$$ and all first-order partial derivatives of $$f|_{\operatorname{int} E}$$ extend continuously up to $$E$$.

The two definitions aren’t equivalent. If you take $$E$$ to be a singleton, $$E=\{a\}$$, then the first definition requires the partial derivatives to exist in a small ball around the point, while the second requires the partial derivatives to exist only at the point. There are functions that are differentiable only at one point. In one variable, diff at one point here is a nice example. Those functions would be continuously differentiable using the second definition, since a function (in this case $$f’$$) defined only at one point is automatically continuous. However, they would not be continuously differentiable according to the first definition.
As for which definition is better, in partial differential equations, and in calculus of variations, the standard one I have always seen and used is the following: given a function $$f:E\to\mathbb{R}$$, we say that $$f\in C^1(E)$$, if there is an open set $$U$$ that contains $$E$$ and a function $$g\in C^1(U)$$ such that $$g=f$$ in $$E$$. The reason for this definition is that if you take a $$C^1$$ function defined in the entire space and you restrict it to an arbitrary subset, you would like it to remain $$C^1$$. See also Munkres
• "given a function $f:E\to\mathbb{R}$, we say that $f\in C^1(E)$, if there is an open set $U$ that contains $E$ and a function $g\in C^1(U)$ such that $g=f$ in $E$." – I also often saw this definition. The problem is that I am interested in the case where $E \subseteq \operatorname{int} \mathrm{dom} f$ whereas in the cited definition $E = \mathrm{dom} f$. Mar 23, 2023 at 12:25
• By the way, do you think it would be correct to give the following definition (based on the cited definition): Real-valued function of several variables $f(\mathbf{x}) = f(x_1,\ldots,x_n)$ is said to be continuously differentiable on a set $E \subseteq \mathrm{int} \operatorname{dom} f \subseteq \mathbb{R}^n$ if there is an open set $U$, such that $E \subseteq U \subseteq \operatorname{int} \mathrm{dom} f$ and $f \in C^1(U)$? Mar 23, 2023 at 12:25
• Yes, that would definitely make sense. There is a paper by Whitney, Hassler Differentiable functions defined in arbitrary subsets of Euclidean space. Trans. Amer. Math. Soc. 40 (1936), no. 2, 309–317, in which he considers the case where the function is defined on a larger set, and it requires $C^1$ on a smaller set, but the definition is not very intuitive. Mar 23, 2023 at 13:22