definition of derivative Definition:
A mapping $f:U\to \mathbb{R}^n$ from an open set $U\subset \mathbb{R}^m$ into $\mathbb{R}^n$ is differentiable at a point $a\in U$ if there is a linear mapping $A:\mathbb{R}^m\to \mathbb{R}^n$ described by an $n\times m$ matrix $A$ such that for all $h$ in an $\underline{\textbf{open}}$ neighborhood  of the origin in $\mathbb{R}^m$, $$f(a+h)=f(a)+Ah+\epsilon(h)$$ where $\lim_{h\to 0}\frac{\|\epsilon(h)\|}{\|h\|}=0$
In this definition why do we need openness which I draw? Thanks!
 A: The idea is, if $f$ is differentiable at $a$, then "$f$ is approximately affine (linear plus a constant) close to $a$". The intuitive notion of "close to" generally translates as "in some open set". Note, incidentally, that the limit condition
$$
\lim_{h \to 0} \frac{\|\epsilon(h)\|}{\|h\|} = 0
$$
implicitly assumes $\epsilon(h)$ is defined in some open neighborhood of $0$.
If you assume less, i.e., that
$$
f(a + h) = f(a) + Ah + \epsilon(h)
\tag{1}
$$
for all $h$ in some set $V$ having $0$ as a limit point, and such that
$$
\lim_{n \to \infty} \dfrac{\|\epsilon(h_{n})\|}{\|h_{n}\|} = 0
$$
for every sequence $(h_{n})$ in $V$ that converges to $0$, you risk defining a condition that:


*

*Depends not only on $f$, but on the set $V$.

*Fails to capture the desired intuition of being "approximately affine" near $a$.
Think, for example, of $f(x, y) = |x|$ at $a = (0, 0)$. Condition (1) holds if $V$ is the $x$-axis, but $f$ isn't differentiable at $a$. "Worse" examples are easy to construct, e.g., functions that are discontinuous at $a$, but satsfy (1) if $V$ is an arbitrary algebraic curve through $a$.
