The domain of a function is the set of all values for which the function is defined, and the range of the function is the set of all values that takes.
(In grammar school, you probably called the domain the replacement set and the range the solution set. They may also have been called the input and output of the function.)
Consider the function shown in the diagram.
Here, the domain is the set . is not in the domain, since the function is not defined for .
The range is the set . is not in the range, since there is no letter in the domain that gets mapped to .
You can also talk about the domain of a relation, where one element in the domain may get mapped to more than one element in the range.
Consider the relation .
Here, the relation is given as a set of ordered pairs. The domain is the set of -coordinates, , and the range is the set of -coordinates, . Note that the domain elements and are associated with more than one range elements, so this is not a function.
But, more commonly, and especially when dealing with graphs on the coordinate plane, we are concerned with functions, where each element of the domain is associated with one element of the range. (See The Vertical Line Test.)
The domain of the function
is all real numbers except zero (since at , the function is undefined: division by zero is not allowed!).
The range is also all real numbers except zero. You can see that there is some point on the curve for every -value except .
Domains can also be explicitly specified, if there are values for which the function could be defined, but which we don't want to consider for some reason.
The following notation shows that the domain of the function is restricted to the interval .
The graph of this function is as shown. Note the open circles, which show that the function is not defined at and . The -values range from up to (including , but not including ). So the range of the function is