6. Functions, Relations, Range and Domain
This chapter deals with functions and their graphs. In particular, we define
- Relations and functions;
- Interval and set notation;
- Range, domain and implied domain;
- The vertical line test for functions.
Do you need this chapter?
Take the following quiz to see if you need to look at this chapter.
Functions, relations, range and domain
1. A relation is a set of ordered pairs.
a) True
b) False
Answer
a) True
2. Which of the following is not a relation (you may pick more than one):
a) [latex]10[/latex]
b) [latex]\left(1,7\right),\left(2,4\right),\left(-5,3\right)[/latex]
c) [latex]\left\{ \left(x,y\right):y=x^{2}\right\}[/latex]
d) [latex]\left\{\left(x,y\right):x^2+y^2=1\right\}[/latex]
Answer
a) not an ordered pair or a set and b) not a set.
3. A function is a special type of relation in which every value of x has only one value of y.
a) True
b) False
Answer
a) True
4. Is the set of ordered pairs [latex]\left\{ \left(1,7\right),\left(2,4\right),\left(-5,3\right),\left(14,-8\right)\right\}[/latex] a function?
a) Yes
b) No
Answer
a) Yes
5. The domain of the set of ordered pairs [latex]\left\{ \left(1,7\right),\,\left(2,4\right),\,\left(-5,3\right),\,\left(14,-8\right)\right\}[/latex] is
a) [latex]\left\{-5,1,2,14\right\}[/latex]
b) [latex]\left\{-8,3,4,7\right\}[/latex]
c) [latex]x[/latex]
d) [latex]y[/latex]
Answer
a)
6. The range of the set of ordered pairs [latex]\left\{ \left(1,7\right),\,\left(2,4\right),\,\left(-5,3\right),\,\left(14,-8\right)\right\}[/latex] is
a) [latex]\left\{-5,1,2,14\right\}[/latex]
b) [latex]\left\{-8,3,4,7\right\}[/latex]
c) [latex]x[/latex]
d) [latex]y[/latex]
Answer
b)
7. The figure below shows the graph of the function [latex]f\left( x \right)=x^2-2x[/latex].

What is the domain of the function?
a) [latex]\{0,2 \}[/latex]
b) [latex]\left[-2,4 \right][/latex]
c) [latex]\left\{x:x\geq -1\right\}[/latex]
d) [latex]\mathbb{R}[/latex]
Answer
d)
8. The figure below shows the graph of the relation [latex]\{ \left(x,y \right): \left(x-1 \right)^2+y^2=1\}[/latex].

What is the domain and range?
a) Domain is [latex]\left[-1,1\right][/latex], range is [latex]\left[0,2\right][/latex].
b) Domain is [latex]\left(0,2\right)[/latex], range is [latex]\left(-1,1\right)[/latex].
c) Domain is [latex]\left[0,2\right][/latex], range is [latex]\left[-1,1\right][/latex] .
d) Domain is [latex]\mathbb{R}[/latex], range is [latex]\mathbb{R}[/latex].
Answer
c)
9. What is the domain and range of the function [latex]f\left(x\right)=\dfrac{1}{x-1}[/latex] which is graphed below?

Answer
Domain is [latex]\mathbb{R}\setminus \left\{1\right\}[/latex], range is [latex]\mathbb{R}\setminus \left\{0\right\}[/latex]
Set and interval notation
The set of real numbers comprises all numbers from negative infinity to positive infinity and is denoted by the symbol [latex]\mathbb{R}[/latex]. When discussing functions and relations we often consider a subset of the real numbers. Subsets may be defined using set notation or interval notation.
The set of all numbers from [latex]-2[/latex] to [latex]3[/latex], including [latex]-2[/latex] and [latex]3[/latex], may be written as
\[\left\{ x:-2\leq x\leq3\right\} \]
and is read as the set of all numbers [latex]x[/latex] such that [latex]-2[/latex] is less than or equal to [latex]x[/latex] and [latex]x[/latex] is less than or equal to [latex]3[/latex]. This is set notation. In interval notation this set would be written as [latex]\left[-2,3\right][/latex]. Note that the square brackets indicate that [latex]-2[/latex] and [latex]3[/latex] are included.
The set of all numbers from [latex]-2[/latex] to [latex]3[/latex], excluding [latex]-2[/latex] and [latex]3[/latex], may be written in set notation as
\[\left\{x:-2<x< 3 \right\}. \]
In interval notation this set is written as [latex]\left(-2,3\right)[/latex]. The curved brackets indicate that the endpoints [latex]-2[/latex] and [latex]3[/latex] are not included.
Now consider the set of numbers from [latex]-2[/latex] to [latex]3[/latex], including [latex]-2[/latex] and excluding [latex]3[/latex]. In set notation this is written as
\[\left\{x:-2\leq x< 3 \right\} \]
and, in interval notation it is written as [latex]\left[-2,3\right)[/latex].
The set of numbers from [latex]-2[/latex] to [latex]3[/latex], excluding [latex]-2[/latex] and including [latex]3[/latex] in set notation is written as
\[\left\{x:-2<x\leq 3 \right\}. \]
and, in interval notation as [latex]\left(-2,3\right][/latex].
It is also possible to consider unions of intervals. For example
\[\left(-\infty,2\right]\cup\left(4,\infty\right)\]
is the set of real numbers from negative infinity to [latex]2[/latex], including [latex]2,[/latex] and from [latex]4[/latex] to infinity, excluding [latex]4[/latex].
Excluding elements from a set
Sometimes it is necessary to exclude numbers from a set. For example the set of values for which the function [latex]f\left( x \right) = \dfrac{1}{x}[/latex] makes sense is any real number except for [latex]x=0[/latex]. This may be written as [latex]\mathbb{R}\backslash \{0 \}[/latex]. In general we use the backslash to indicate exclusion. To exclude a set [latex]\mathbb{B}[/latex] from a set [latex]\mathbb{A}[/latex] we write [latex]\mathbb{A} \backslash \mathbb{B}[/latex].
For example to denote all the real numbers except for those between [latex]0[/latex] and [latex]1[/latex], but including [latex]0[/latex] and [latex]1[/latex] we write [latex]\mathbb{R} \backslash \left(0,1 \right)[/latex].
The Cartesian plane
The Cartesian plane is defined by a pair of mutually perpendicular coordinate axes. The horizontal axis is the [latex]x-[/latex] axis and the vertical axis the [latex]y-[/latex] axis. Their point of intersection is called the origin [latex]O[/latex].
Points on the plane are referred to by their horizontal distance ([latex]x-[/latex] coordinate) and vertical distance ([latex]y-[/latex] coordinate) from the origin. Distances to the right of, and up from the origin are positive. Distances to the left of, and down from the origin are negative. The coordinates of a point in the plane is given as an ordered pair. An ordered pair comprises two numbers in a particular order. For example [latex]\left(3,4\right)[/latex] is an ordered pair. Because the ordering is important, [latex]\left(4,3\right)[/latex] is a different ordered pair. The [latex]x-[/latex] coordinate is always given first.
Consider Fig 6.1 below.

The point [latex]A\, \left(2,3\right)[/latex] has coordinates [latex]x=2[/latex] and [latex]y=3.[/latex]
The point [latex]B\, \left(-3,2\right)[/latex] has coordinates [latex]x=-3[/latex] and [latex]y=2[/latex].
The point [latex]C\, \left(-3,-3\right)[/latex] has coordinates [latex]x=-3[/latex] and [latex]y=-3[/latex].
The point [latex]D\, \left(1,-2\right)[/latex] has coordinates [latex]x=1[/latex] and [latex]y=-2[/latex].
Note that the notation for the coordinates is different to the interval notation above. Hence [latex]\left(-3,2\right)[/latex] could be the point located at [latex]x=-3[/latex] and [latex]y=2[/latex] or the set of real numbers from [latex]-3[/latex] to [latex]2.[/latex] This is not a problem, as the context usually clarifies what is meant.
Relations, range and domain
A relation is a set of ordered pairs. For example [latex](1,2),(2,6),(3,4),(2,8)[/latex] are ordered pairs and [latex]\left\{ \left(1,2\right),\left(2,6\right),\left(3,4\right),\left(2,8\right)\right\}[/latex] is a relation. Note the use of the parentheses "[latex]\{[/latex]" and "[latex]\}[/latex]" to indicate a set.
The domain of a relation is the set of first elements or the [latex]x-[/latex]values of the ordered pairs. For the above-ordered pairs the domain, [latex]\text{dom} = \left\{ 1,2,3,4,6\right\}[/latex].
The range of a relation is the set of second elements or the [latex]y-[/latex]values of the ordered pairs. For the above ordered pairs the range, [latex]\text{ran} =\left\{ 2,4,6,8\right\}[/latex] .
It is possible to graph a relation. The first number is the [latex]x-[/latex]coordinate and the second the [latex]y-[/latex]coordinate. Hence the relation [latex]\left\{ \left(1,2\right),\left(2,6\right),\left(3,4\right),\left(2,8\right)\right\}[/latex] has the graph (Fig. 6.2):

Because it is a discrete set of points forming the relation, we call it a discrete relation.
It is also possible to have relations involving infinite numbers of points. In this case, a rule is provided. The rule specifies the relationship between the [latex]x[/latex] and [latex]y[/latex] values. For example the relation
\[
S=\left\{ \left(x,y\right):y>x,\,x\in\mathbb{R}\right\}
\]
where the symbol [latex]\in[/latex] means "is in", or "is an element of". This relation, called S, consists of the set of all ordered pairs [latex]\left(x,y\right)[/latex], where the [latex]y[/latex] value is greater than the [latex]x[/latex] value and where [latex]x[/latex] is a real number. Note that a relation is defined by its rule (in this case [latex]y>x[/latex]) and its domain (in this case [latex]x\in\mathbb{R}[/latex] ). If the domain is not given, then we assume the largest possible domain. This is called the implied domain. The graph of [latex]S[/latex] is the shaded region shown below in Fig. 6.3.

Note that the line [latex]y=x[/latex] is shown dotted as the rule for [latex]S[/latex] has a strict inequality, [latex]y>x[/latex]. This means the points [latex]y=x[/latex] are not included. If the rule was [latex]y\geq x[/latex], the line would be solid.
Examples: Relations
1. The graph of a relation is shown below in Fig. 6.4. What are the domain and range of the relation?

Solution:
The domain is [latex]\left\{-3,-2,-1.5,1,2.5\right\}[/latex].
The range is [latex]\left\{-1,-0.5,1,2\right\}[/latex].
2. The graph of the relation [latex]x^{2}+y^{2}=4[/latex] is shown below in Fig 6.5. State the domain and range of
this relation.

Solution:The domain is [latex]\left\{ x:-2 \leq x \leq 2 \right\}[/latex] or [latex]\left[ -2,2 \right][/latex].
The range is [latex]\left\{x:-2\leq y\leq 2\right\}[/latex] or [latex]\left[-2,2\right][/latex].

Solution:The domain is [latex]\left\{x:-2\lt x\lt2\right\}[/latex] or [latex]\left(-2,2\right)[/latex].
The range is [latex]\left\{x:-2\lt y\lt2\right\}[/latex] or [latex]\left(-2,2\right)[/latex].
Functions
From some of the previous examples it can be seen that some values in the domain ([latex]x[/latex] values) may have many, even an infinite number of corresponding values in the range ([latex]y[/latex] values).
A function is a special type of relation. Each point in the domain of a function has a unique value in the range. Every value of [latex]x[/latex] may have only one value of [latex]y[/latex] .
Examples: Functions
1. The relation [latex]\left\{ (-1,2),(-1,4),(1,6),(2,8),(3,10)\right\}[/latex] is not a function because the value [latex]x=-1[/latex] has two corresponding [latex]y[/latex] values [latex]2[/latex] and [latex]4[/latex].
2. The relation [latex]\left\{ (-1,1),(0,2),(1,3),(2,5),(3,7)\right\}[/latex] is a function because for each [latex]x[/latex] value there is only one corresponding [latex]y[/latex] value.
3. The relation [latex]F=\left\{ \left(x,y\right):y=\sin x,\,x\in \mathbb{R}\right\}[/latex] is shown below in Fig.6.7.

If we choose any possible value of [latex]x[/latex] there exists only one corresponding
value of [latex]y[/latex]. Therefore, the relation [latex]F[/latex] is a function.
Functions are usually defined by rules. For example, the sine function may be written as [latex]f\left(x\right)=\sin\left(x\right)[/latex].
Vertical line test
When relations are represented graphically, a vertical line test may be applied to decide if they are functions. If a vertical line crosses the graph more than once, then it is not a function because an [latex]x[/latex] value has more than one [latex]y[/latex] value.
The Fig. 6.8 below is not the graph of a function because the dotted vertical line, [latex]x=1.5[/latex], crosses the graph more than once.

The graph in Fig. 6.9 below is not the graph of a function because the dotted vertical line, [latex]x=1[/latex], crosses the graph more than once.

Implied domain
If only the rule of the function is given, then we assume that the domain is [latex]\mathbb{R}[/latex] (the set of real numbers) unless otherwise defined implicitly by the function. This is called the implied domain.
Sometimes the domain is restricted so that the function is defined. For example, if a function involves a square root, the domain is restricted to those values of [latex]x[/latex] that result in a non-negative number under the square root sign.
Examples: Implied domain
- The domain of the function [latex]y=+\sqrt{x-4}[/latex] is restricted such that [latex]x-4\geq0[/latex]; the domain is [latex]\left\{ x:x\geq4\right\}[/latex].
- The domain of the function [latex]y=+\sqrt{9-x^{2}}[/latex] is restricted such that [latex]9-x^{2}\geq0[/latex]; the domain is [latex]\left\{ x:-3\leq x\leq3\right\}[/latex].
- If the function involves a fraction, the value in the denominator must not equal zero. So, the domain of the function
\[y=\dfrac{3}{x+5}\]
is restricted such that [latex]x+5\neq0[/latex]. The domain is [latex]\left\{ x \in \mathbb{R}:x\neq-5\right\}[/latex]. The domain may be written as [latex]\mathbb{R}\backslash \left\{ -5\right\}[/latex]. Here, [latex]\mathbb{R}\backslash \left\{ -5\right\}[/latex] is the set of real numbers excluding [latex]-5[/latex].
- The domain of the function
\[y=\dfrac{3}{x^2-7}\]
is restricted such that [latex]x^2-7\neq0[/latex]; the domain is [latex]\left\{ x\in \mathbb{R}:x\neq \pm \sqrt{7}\right\}[/latex] or [latex]\mathbb{R}\backslash \left\{ -\sqrt{7},\sqrt{7}\right\}[/latex].
Here are some exercises for you to try.
Exercises: Domain, range, relations and functions
1. State the domain and range of the following relations
(a) [latex]\left\{ \left(-2,1\right),\left(0,2\right),\left(2,5\right),\left(2,7\right),\left(3,9\right)\right\}[/latex]
(b) [latex]\left\{ \left(4,1\right),\left(5,2\right),\left(6,3\right)\right\}[/latex]
(c) [latex]\left\{ \left(x,y\right):x^{2}+y^{2}=25\right\}[/latex]
(d) [latex]\left\{ \left(x,y\right):2y=6-5x,x\geq2\right\}[/latex]
Answer
(a) domain [latex]= \left\{ -2,0,2,3\right\} \qquad{}[/latex] range [latex]= \left\{ 1,2,5,7,9\right\}[/latex]
(b) domain [latex]= \left\{ 4,5,6\right\} \qquad{}[/latex] range [latex]=\left\{ 1,2,3\right\}[/latex]
(c) domain [latex]= \left\{ x:-5\leq x\leq5\right\} \qquad{}[/latex] range [latex]= \left\{ y:-5\leq y\leq5\right\}[/latex]
(d) domain [latex]= \left\{ x:x\geq2\right\} \qquad{}[/latex]range[latex]= \left\{ y:y\leq-2\right\}[/latex]
2. Which of the following relations are functions?
(a) [latex]\left\{ \left(x,y\right):y=2x+4\right\}[/latex]
(b) [latex]\left\{ \left(x,y\right):y=4-x^{2}\right\}[/latex]
(c) [latex]\left\{ \left(x,y\right):x^{2}+y^{2}=36\right\}[/latex]
(d) [latex]\left\{ \left(x,y\right):y=7\right\}[/latex]
(e) [latex]\left\{ \left(x,y\right):x=-2\right\}[/latex]
(f) [latex]\left\{ \left(x,y\right):y=-\sqrt{4-x^{2}}\right\}[/latex]
Answer
(a), (b), (d), (f)
3. State the domain of the following functions.
(a) [latex]\left\{ \left(x,y\right):y=x+2\right\}[/latex]
(b) [latex]\left\{ \left(x,y\right):y=4-x^{2}\right\}[/latex]
(c) [latex]\left\{ \left(x,y\right):y=+\sqrt{4-x}\right\}[/latex]
(d) [latex]\left\{ \left(x,y\right):y=\dfrac{3}{x+2}\right\}[/latex]
(e) [latex]\left\{ \left(x,y\right):y=\dfrac{5}{\sqrt{x-7}}\right\}[/latex]
(f) [latex]\left\{ \left(x,y\right):y=\dfrac{1}{x+2}-\dfrac{3}{x-4}\right\}[/latex]
Answer
(a) [latex]\mathbb{R}[/latex]
(b) [latex]\mathbb{R}[/latex]
(c) [latex]\left\{ x:x\leq4\right\}[/latex]
(d) [latex]\left\{ x:x\neq-2\right\}[/latex]
(e) [latex]\left\{ x:x>7\right\}[/latex]
(f) [latex]\left\{ x:x\in\mathbb{R}\setminus\left\{ -2,4\right\} \right\}[/latex]
Key takeaways
1. The set of real numbers is denoted by [latex]\mathbb{R}[/latex].
2. A point [latex]\left(x,y \right)[/latex] is located on the Cartesian plane at a distance [latex]x[/latex] from the origin horizontally and [latex]y[/latex] from the [latex]x[/latex]-axis vertically.
3. The point [latex]\left(x,y \right)[/latex] is called an ordered pair.
4. Intervals including their end points are written as [latex]\left[a,b \right][/latex].
5. Intervals excluding their end points are written as [latex]\left(a,b \right)[/latex]
6. To exclude a set [latex]\mathbb{B}[/latex] from a set [latex]\mathbb{A}[/latex] we write [latex]\mathbb{A} \backslash \mathbb{B}[/latex].
7. A relation is a set of ordered pairs.
8. A function is a special type of relation. Each point in the domain of a function has a unique value in the range. Every value of [latex]x[/latex] may have only one value of [latex]y[/latex].
9. The domain of a relation or function is the set of the [latex]x[/latex] values in the ordered pairs [latex]\left(x,y \right)[/latex].
10. The range of a relation or function is the set of the [latex]y[/latex] values in the ordered pairs [latex]\left(x,y \right)[/latex].