Skip to main content
Logo image

Section 7.2 Graphs of Functions

In Definition 7.1.2 we had introduced the image of an element of the domain under a function. The set of all these images is called the image of the function.

Definition 7.2.1. Image of a function.

The image of a function \(f:A\to B\) is the set
\begin{equation*} f(A) = \left\{ f(x) \mid x \in A \right\}. \end{equation*}
For all \(x\) in the domain of \(f:A\to B\) we have \(f(x)\in B\text{,}\) thus the image \(f(A)\) of \(f\) is a subset of codomain \(B\) of \(f\text{.}\)

Example 7.2.2.

Let \(f:\mathbb{Z}_5\to \mathbb{Z}_5\) be given by \(f(x)=x^2\bmod 5\text{.}\) Then
\begin{gather*} f(0)=0^2\bmod 5=0\bmod 5 = 0\\ f(1)=1^2\bmod 5=1\bmod 5 = 1\\ f(2)=2^2\bmod 5=4\bmod 5 = 4\\ f(3)=3^2\bmod 5=9\bmod 5 = 4\\ f(4)=4^2\bmod 5=16\bmod 5 = 1 \end{gather*}
So the image \(f(\mathbb{Z}_5)\) of \(f\) is
\begin{equation*} f(\mathbb{Z}_5)=\left\{ f(x) \mid x \in \mathbb{Z}_5 \right\}=\{0,1,4\}. \end{equation*}
Note that this differs from the codomain of \(f\) which is \(\mathbb{Z}_5=\{0,1,2,3,4\}\text{.}\)
In Section 7.1 we defined functions by algebraic expressions or tables of charts. Another way of representing a function is its graph. Instead of organizing the values in a table we consider them as elements of a Cartesian product. We give an introduction to graphs of functions in the video in Figure 7.2.3. It is followed by a more detailed discussion.
Figure 7.2.3. Graphs of Functions by Matt Farmer

Definition 7.2.4. Graph of a function.

The graph of a function \(f:A\to B\) is the set
\begin{equation*} \left\{ (x,f(x)) \mid x \in A \right\} \subseteq A\times B. \end{equation*}
In Example 7.2.5 we make a graphical representation of a function. We apply the graphical representation of Cartesian products from Section 6.3 to the graph of the function.

Example 7.2.5. Graph of a function given by an algebraic rule.

Let \(f:\mathbb{Z}_{6}\to\mathbb{Z}_{5}\) be given by \(f(x)= 2^x \bmod 5\text{.}\)
We have
\begin{align*} f(0) \amp= 2^0 \bmod 5 = 1 \bmod 5 = 1\\ f(1) \amp= 2^1 \bmod 5 = 2 \bmod 5 = 2\\ f(2) \amp= 2^2 \bmod 5 = 4 \bmod 5 = 4\\ f(3) \amp= 2^3 \bmod 5 = 8 \bmod 5 = 3\\ f(4) \amp= 2^4 \bmod 5 = 16 \bmod 5 = 1\\ f(5) \amp= 2^5 \bmod 5 = 32 \bmod 5 = 2 \end{align*}
So the graph of \(f\) is:
\begin{align*} \amp\{(x,f(x))\mid x\in \Z_6\}\\ \amp\;=\{(0,f(0)), (1,f(1)), (2,f(2)), (3,f(3)), (4,f(4)), (5,f(5))\}\\ \amp\;=\{(0,1), (1,2), (2,4), (3,3), (4,1), (5,2)\} \subseteq \mathbb{Z}_{6}\times\mathbb{Z}_{5} \end{align*}
The graph of \(f\) and Section 6.3 give a graphical representation of the function \(f\text{.}\)
The graphical representation of a function gives its graph, domain, and codomain, as shown in Example 7.2.6.

Example 7.2.6. Function given by its graph.

Suppose that the graph of the function \(h\) is given by
The values on the horizontal axis are the elements in the domain of \(h\text{.}\) So its domain is
\begin{equation*} \mathbb{Z}_{10}=\{0,1,2,3,4,5,6,7,8,9\}\text{.} \end{equation*}
The values on the vertical axis form the codomain. So the codomain of \(h\) is
\begin{equation*} \mathbb{Z}_{5}=\{0,1,2,3,4\}\text{.} \end{equation*}
The graph of \(h\) is made of the black pixels in the Cartesian product \(\mathbb{Z}_{10}\times\mathbb{Z}_5\text{.}\) The graph of \(h\) is
\begin{equation*} \{ (x,h(x)) \mid x \in A \} = \{ (0,2), (1,0),(2,0), (3,1), (4,0), (5,1), (6,0), (7,4),(8,4),(9,3) \}. \end{equation*}
The graph of \(h\) contains pairs of the form \((x,h(x))\text{,}\) where \(x\) is in the domain of \(h\text{.}\) This lets us read each value \(h(x)\) from the plot.
In Example 7.2.7 observe how changing the plot of the graph of a function changes its graph.

Example 7.2.7. Graph of a function interactive.