This is a follow-up question to my previous question.

Definition: a function $ f: D to mathbb {R} $ where $ D subset

> mathbb {R} $ is differentiable at a limit point $ z in D $ Yes

$ lim limits_ {h to 0} frac {f (z + h) -f (z)} {h}, h neq 0, z + h in D $

there then we say

$ f & # 39; (z) $ is the derivative of $ f $ to $ x $.

Note that the conditions $ h neq 0, z + h in D $ are necessary to ensure that the difference ratio is defined and $ z $ it needs to be a limit point of $ D $ such is possible to find a sequence that approaches $ z $ other than the constant sequence (for which the difference quotient is not defined). If this were not the case, the limit would not be unique.

It is also easy to show from this definition that this is equal to the existence of $ c = f & # 39; (z) in mathbb {R} $ such that $ forall h: x + h in D $:

$ f (z + h) = f (z) + ch + r_ {z} (h) $ with $ lim limits_ {h to 0} frac {r_ {z} (h)} {h} = 0 $.

Note that $ f & # 39; (z) h $ it is a linear map defined for all $ h: z + h in D $. Conditions again $ h neq 0, z + h in D $ are necessary for the expression to make sense and $ z $ it must be a limit point for $ c $ be unqiue

The definition of limit is also easy to generalize to functions with vector values, but it makes no sense for functions of more than one variable. So, the idea is to define the differentiability in terms of the existence of a linear map.

Definition: Let $ U subset mathbb {R ^ {n}} $ be open. A function $ f: U to mathbb {R ^ {}} $ is differentiable in

$ z in U $ if there is a linear map $ L: mathbb {R ^ {n}} to

> mathbb {R m} $ such that $ forall h: x + h in U $

$ f (z + h) = f (z) + L_ {z} (h) + r_ {z} (h) $ with $ lim limits_ {h a 0}

> frac {r_ {z} (h)} { | h |} = 0 $.

This definition is taken from some class notes on real analysis and the linear map. $ L $ can be considered as the best approximation of the change in the value of the function $ f $ close $ z $.

It seems clear to me why we come up with the idea of â€‹â€‹differentiability as linear approximation. However, what I really don't understand is why we require $ U $ be open. Of course, we need to be able to approach a point so that it is differentiable, but I feel that the condition is stronger than necessary. In particular, we did not need it for the case of functions of a variable. Can we not reuse the same conditions as in the case of a variable?

Another thing that bothers us is that we require $ L $ to be defined in $ mathbb {R ^ n} $. This also seems to be unnecessary and it would be sufficient to require it to be defined for $ h: x + h in U $.

Am I missing something? Any clue is appreciated. Thank you!