2
$\begingroup$

While teaching us about limits, my math teacher showed us how to define a function with a "hole" in it:

$$f(x)=\begin{cases}x^2, & x \neq 2 \\ \text{undefined}, & x=2\end{cases}$$

This is really confusing me, why do I have to define that a value is undefined?

I asked her, and her reasoning is that if you don't write that for $x=2$ there is no value, then it could be any value possible, like $7$ or $42$ as the function has only be written partially. She added that it is only I who thinks that it is undefined, for everyone else, it could be anything, and thus, I have to explicitly write that the function has no value for $2$, or else it wouldn't be mathematically correct.

I don't understand the reasoning for the following reason: If I write

$$f(x)=x^2, \text{ for } x\neq 2$$

then the function is already undefined for the value is $2$, as the function has no formula if $x=2$. And thus, the value is undefined, I don't have to write it again that it is in fact undefined.

After a while, she dismissed me by saying that it is only a formality, and as a result not important.

But I really want to know, so where is my flaw? Or rather, why do I have specify that the function is undefined for $2$ explicitly?

  • 0
    I think it's just a convention. In a case like this, a reader might well assume that $f(2)=2^2$, why not? So it is worth specifying that this is not the case just to avoid confusion.2017-02-14
  • 0
    Both writings are exactly the same, there is no flaw in your argument, but also none in the teachers-it really is just a formality. Maybe the teacher was just warning you not to get too hung up on it-as long as everyone knows what you are talking about, one notation is as good as the other.2017-02-14
  • 0
    I share your point of view: *a priori*, if you define $ f(x)$ only for $x=2$, it is undefined at $x=2$. Of course the context may change that.2017-02-14
  • 0
    @Bernard: I think you wanted to mean "...if you define $f(x)$ only for $x\ne 2$".2017-02-14
  • 0
    @user 170039: Oh! yes. One never never rereads oneself enough…2017-02-14

3 Answers 3

1

You are completely right, although it is better to replace $$f(x)=x^2, \text{ for } x\neq 2$$ by $$f(x)=x^2, \text{ for } x\in\mathbb R\setminus\{2\}.$$

More explicitly: To write "undefined" simply makes no sense.


As a complement, a function is defined only if we give a domain and an expression for it. However, sometimes it is impossible to indicate an explicit expression and the same happens for the domain. Look for example at the apparently "peculiar" way in which the domain of an infinitesimal generator is defined (see https://en.wikipedia.org/wiki/C0-semigroup#Infinitesimal_generator). But really, your class seems to be of a more basic level, and so all this should be forgotten.

1

A relation between sets $A$ and $B$ is a subset of the Cartesian product $A\times B$.

A function is a relation with the property that for all $a\in A$, $\exists b\in B$ such that $f(a)=b$ such that for a given $a$, such a $b$ is unique.

The set $A$ is called the domain of the function, and the set $B$ is called the codomain. Every element in the domain must have a mapping of the function in the codomain. Thus, a function needs to be defined everywhere in its domain. A function $f$ with a domain $A$ and codomain $B$ is denoted as $$f:A\to B$$

So, first, in your case, you need to define the domain of your function. If your domain is $\mathbb R\setminus \{2\}$, then it is implied that you talk of the definition of the function only in points that lie in its domain. If your domain includes $\{2\}$, and the function has no mapping to the codomain, your function is not a function at all by definition, it is just a relation.

Either way, there is no need to mention "undefined" anywhere explicitly.

1

Every function have to be defined among others by its' domain, eg: $$f:[-1,3]\to \mathbb{R},\\ f(x)=x^2$$ If you specify the domain (in this case it is an interval $[-1,3]$), you don't have to point, that $f$ is undefined for $x\not \in [-1,3]$.

On the other hand your teacher showed the alternative way to determine the domain - pointing, that for values from some set the function is undefined: $$f(x)=\begin{cases}NaN&,x <-1\\x^2&,x\in[-1,3]\\NaN&, x>3\end{cases}$$ Frankly speaking this is the first time I see, that math teacher taught someone to do it in that way - it's very... unesthetic.