# Teaching domain and range incorrectly

What’s wrong with these high-school math questions?

1. State the domain of the function $f(x)=\frac{1}{x}$.
2. Where is the function $f(x)=\ln(x)$ undefined?
3. State the range of the function $f(x)=x^2$.

As a math teacher, I’ve asked these questions before too. But I always ask them with a bit of a cringe. Do you see what’s wrong with them?

Domain

A function is only well-defined when it is defined with its domain. A function $f$ is an association between two sets $A$ and $B$ that assigns only one element of $B$ to each element of $A$. The set $A$ is called the domain and the set $B$ is sometimes called the codomain. If  $f$ is a function mapping elements from $A$ into $B$, then we often write $f:A\to B$. For instance, consider the function $f:\mathbb{R}\to\mathbb{R}$ defined by

$f(x)=e^x$

The domain of this function is $\mathbb{R}$, since that’s how the function is defined. Notice I explicitly gave the domain right before defining the function rule. Technically, this must always be done when defining any function, ever.

We might ask a student, “What is the domain of $f(x)=e^x$?” But this is a poor question. The function rule isn’t well-defined by itself. There are many possible domains for this function, like the set of integers $\mathbb{Z}$, the set of positive reals $\mathbb{R}^+$, or rational numbers between 20 and 30. What a teacher probably means is, “What is the largest possible subset of $\mathbb{R}$ that could be used as the domain of $f(x)=e^x$?” In this case, the answer is $\mathbb{R}$.

So I hope you see why question (1) at the beginning of this post is not a very precise question. Likewise, question (2) is not very precise either. “Where is $\ln{x}$ undefined?” has multiple answers. The answer the teacher is looking for is $(-\infty,0]$. The question would be better worded, “What real values cannot be in the domain of $\ln{x}$?”

Range

What about the range? The codomain in the example $f(x)=e^x$ is also $\mathbb{R}$. But the range of $f$ is $(0,\infty)$. The range of a function is defined to be the set of all $y\in B$ such that there exists an $x\in A$ with $f(x)=y$.

But the range depends on the choice of domain. So asking questions like (3), “State the range of the function $f(x)=x^2$” aren’t well defined for all the same reasons as above. The desired answer is probably $[0,\infty)$. But the domain of $f(x)=x^2$ could be the integers, in which case the range is the non-negative integers. We’re not told. So in the case of (3), the more precise question would read, “State the range of the function $f(x)=x^2$ with $x\in\mathbb{R}$.”

Should we change our teaching?

Maybe. But maybe not. I think I’ll still ask the questions in the imprecise way I started this post. Using the more precise questions would be unnecessarily confusing for most students. But we as teachers should be aware of our slightly incorrect usage, and be ready to give a more precise and thoughtful answer to students who ask.

That being said, I think there’s room for more set theory and basic topology at the high school level. I’m a bit sad I didn’t learn the words onto, surjective, one-to-one, injective, bijective, image, and preimage until very late in my post-high-school studies. I’m not sure all students are ready for such language, but we shouldn’t ever shy away from using precise language. That’s part of what makes us mathematicians.

I <3 precise language!