\chapter{Functions and graphs}
\section{Description of functions}
A \textit{relation} is a collection of pairs.
\begin{example}
\(\{(1,x),(3,t),(1,y),(4,y)\}\)
is a relation.
\end{example}
The set of all first entries of the pairs in a relation is
called the \textit{domain}, and the set of all second entries
is called the \textit{range}. We will denote them by \(D\) and \(R\), respectively.
\begin{example}
\begin{enumerate}
\item
The relation \(\{(1,x),(3,t),(1,y),(4,y)\}\)
has domain
\(D=\{ 1,3,4\}\) and range \(R=\{x,t,y\}\)
(remember that
when listing the elements of a set, we never repeat the same element twice).
\item
The relation \( \{(0,c),(1,d),(2,c),(3,e),(4,a),(5,f)\}\) has
domain
\(D=\{0,1,2,3,4,5\}\) and range \(R=\{a,c,d,e,f\}\)
\item
The relation \(\{ (1,1), (2,1), (3,1), (2,1)\}\) has domain \(D=\{1,2,3\}\)
and range \(R=\{1\}\).
\end{enumerate}
\end{example}
Note that in part a. the two pairs \((1,x)\) and \((1,y)\) have the same first entry,
but different second entries.
This is not the case for parts b. and c. In these relations, for every element of the domain,
there is only one element of the range that is paired with it.
So we can think of the relations in b. and c. as \textit{rules}:
if we are given the first entry, we can determine the second one.
Such relations are called \textit{functions}.
\begin{definition}
A \textit{\textbf{function}} \(f\) from a set \(A\) to a set \(B\) is a rule that matches each element \(x\) in \(A\), called the \textit{\textbf{domain}} of \(f\), with exactly one element \(y\) in the set \(B\), called the \textit{\textbf{range}} of \(f\).
\end{definition}
So relations b. and c. above are functions, but a. is not.
Note that in part c. we had the two identical pairs \((2,1)\) and \((2,1)\).
This is OK for a function, because even though the first entries are the same,
so are the second entries. We are just
repeating twice the same rule: given \(2\), we get \(1\).
\subsection{Functions from diagrams}
Since a function pairs each element of the domain with \textbf{only one} element of the range,
we can picture it by drawing an arrow from each element of the domain to the
corresponding entry of the range, as in the following diagram:
\(\img{U1F1.jpg}{}{}{10em}\) |
A function with domain \(D=\{0,1,2,3,4,5\}\)
and range \(R=\{a,c,d,e,f\}\) |
Note that the element \(b\) in the previous diagram
is not in the range, because there is no element of the domain that is paired with it.
The essential thing about a function is that it sends each element of the domain to
a \textbf{unique} element of the range. So we cannot have one
element of the domain sent to two different elements of the range. But it is OK to
have two or more elements of the domain sent
to the same element of the range (like the element \(c\) in the figure above).
To remember this, think of the domain of a function as a set of people, and the range as a
set of birthdays.
Each person must have a unique birthday (a person cannot be born twice!) but it is
of course OK to have two people with the same birthday.
An element of the domain is also called an \textit{input} value, and an element of the range an
\textit{output} value.
\subsection{Functions from tables}
A common way to describe a function is to make a table that lists the domain elements in a
row, with the corresponding range elements below, as in the following example.
\begin{example} The following table describes a function with domain \(D=\{1,2,3,4,5\}\) and range \(R=\{0,1,4,5,8\}\).
\[
\begin{array}{c|ccccc}
x & 1 & 2 & 3 & 4 & 5\\
\hline
y & 8 & 5 & 4 & 1 & 0
\end{array}
\]
\end{example}
Sometimes it may be more convenient to list the elements as columns instead of rows, with the domain elements on the left. So the function of the previous example would be:
\[\begin{array}{r|c}
x & y\\
\hline
1 & 8 \\
2 & 5 \\
3 & 4 \\
4 & 1 \\
5 & 0\\
\end{array}
\]
\subsection{Square roots and cube roots}
The square root of 4 is 2,
because \(2^2=4\). But
\((-2)^2\) is also 4, and so \(-2\) is another square root of 4.
This leads us to conclude that there are
two square roots of \(4\), that is, \(2\) and \(-2\), often written as \(\pm 2\). This
means that there are two solutions of
the equation\[x^2=4\]
and that is, \(x=\pm 2\). BUT, we should not confuse this with the symbol \(\sqrt{4}\). When
we write \(\sqrt{4}\) we mean the \textbf{positive} square root of 4. So, \(\sqrt{4}=2\), while the solutions
of the equation \(x^2=4\) are \(\pm \sqrt{4}\), or \(\pm 2\).
\begin{example}
Suppose we want to solve the equation \(x^2-4y-1=0\) for \(x\).
\[
\begin{array}{rcll}
x^2-4y-1&=& 0 & \mbox{The given equation}\\[2ex]
x^2-4y-1 \color{red}{+4y+1} &=& 0 \color{red}{+4y+1} & \mbox{add \(4y+1\) to both sides}\\[2ex]
x^2 &=& 4y+1 & \mbox{Simplify}\\[2ex]
x&=& \pm \sqrt{4y+1} & \mbox{Take square root, with the \(\pm\) sign}
\end{array}
\]
So we find two solutions, \(\pm \sqrt{4y+1}\).
\end{example}
Because the square of a negative number is positive, and the square of a positive number is positive, we can
never get a negative number by squaring \textbf{any} real number. So for example the equation \(x^2+4=0\)
has no solutions, because if we try to solve it we get \(x=\pm \sqrt{-4}\), and that is not a real number.
For cube roots, things are different. That's because if \(x\) is negative, then \(x^3\) is also negative. So for
example \((-2)^3=-8\). This means that the solution of \(x^3=8\) is just \(x=2\), and the solution of \(x^3=-8\) is
\(x=-2\). Compare with the situation for squares: \(x^2=4\) has two solutions, and \(x^2=-4\) has no solutions.
\begin{example}
Consider the equation \(u^3+27w=0\). We want to solve this equation for \(u\).
\[
\begin{array}{rcll}
u^3+5w&=& 0 & \mbox{The given equation}\\
u^3+5w \color{red}{-5w} &=& 0 \color{red}{-5w} & \mbox{subtract \(5w\) from both sides}\\[2ex]
u^3 &=& -5w & \mbox{Simplify}\\
u&=& \sqrt[3]{-5w} & \mbox{Take cube root, \(\pmb{\textrm{without}}\) \( \pm\) sign}\\
u&=& -\sqrt[3]{5w} & \mbox{We can take the \(-\) sign outside a cube root}
\end{array}
\]
This time we found only one solution, \(-\sqrt[3]{5w}\).
\end{example}
For higher exponents, such as \(x^4\), \(x^5\), etc, we just need to consider whether the exponent is even
or odd. So for example \(x^4 = 3\) has two solutions, \(x=\pm \sqrt[4]{3}\), and \(x^4=-3\) has no solutions, while
\(x^5=3\) has one solution \(x=\sqrt[5]{3}\) and \(x^5=-3\) has one solution \(x=-\sqrt[5]{3}\).
\subsection{Functions from equations}
Suppose we are given an equation in two variables \(x\) and \(y\), such as \(y-3x^2=0\).
If we solve it for \(y\), we find a single answer:
\[
\begin{array}{rcll}
y-3x^2&=& 0 & \mbox{The given equation}\\[2ex]
y-3x^2 \color{red}{+3x^2} &=& 0 \color{red}{+3x^2} & \mbox{add \(3x^2\) to both sides}\\[2ex]
y &=& 3x^2 & \mbox{Simplify}
\end{array}
\]
In this case we say that the given equation \textit{defines \(y\) as a function of \(x\)},
and we call \(x\) the \textit{independent variable}, and \(y\) the \textit{dependent variable}.
That's because if we choose any value we want for \(x\), such as \(x=2\), then the formula
\(y=3x^2\) allows us to find \(y\):
\[y=3(2^2)=3(4)=12.\]
So the independent variable
is for the input of the function (in the domain), and the dependent variable for the output
(in the range).
But suppose we solve instead the same equation for \(x\):
\[
\begin{array}{rcll}
y-3x^2&=& 0 & \mbox{The given equation}\\[2ex]
y-3x^2 \color{red}{-y} &=& 0 \color{red}{-y} & \mbox{subtract \(y\) from both sides}\\[2ex]
-3x^2 &=& -y & \mbox{Simplify}\\[2ex]
\displaystyle \frac{-3x^2}{\color{red}{-3}} & = &\displaystyle \frac{-y}{\color{red}{-3}} & \mbox{divide both sides by \(-3\)}\\[2ex]
x^2 & = & \displaystyle \frac{y}{3} & \mbox{Simplify}\\[2ex]
\sqrt{x^2} & = & \displaystyle \pm \sqrt{\frac{y}{3}} & \mbox{Take the square root, remembering to include \(\pm\)}\\[2ex]
x & = & \displaystyle \pm \sqrt{\frac{y}{3}} & \mbox{Simplify}
\end{array}
\]
This time we found two answers for a given value of \(y\): either \(\sqrt{y/3}\), or \(-\sqrt{y/3}\).
This is like a person having two birthdays. It means that the equation does \textbf{not}
define \(x\) as a function of \(y\).
While the most common name for the input variable is \(x\), and the most common name for the output
variable is \(y\), it is important to bear in mind that any names can be used for either variable. So
it is quite possible to have an equation that determines \(x\) as a function of \(y\) (see for example Problem 1.1.3).
Problems
\problem
Decide if the diagrams define functions, and give the domain and range for each function.
\(\img{U1F2.jpg}{}{}{8em}\) | \( \img{U1F3.jpg}{}{}{8em}\) |
a. | b. |
\begin{sol}
\begin{enumerate}
\item
This diagram does not define a function, because \(c\) is sent to both \(v\) and \(w\).
\item This diagram defines a function, because each element of \(\{4,5,6,7,8,9\}\)
is sent to only one element of \(\{1,2,3,4\}\). The domain is \(D = \{4,5,6,7,8,9\}\)
and the range is \(R=\{1,2,3,4\}\).
\end{enumerate}
\end{sol}
\mproblem
Decide if the diagrams define functions, and give the domain and range for each function.
\(\img{U1F5.jpg}{}{}{8em}\) | \(\img{U1F4.jpg}{}{}{8em}\) |
a. | b. |
\problem
Decide if each of the following tables or lists describes a function. If it does, give the domain and range of the function.
\[
\begin{array}{|c|c|}
\hline
& \\
\begin{array}{c|ccccc}
x & -2 & -1 & 0 & 1 & 2\\
\hline
y & 3 & 2 & 1 & 0 & -1
\end{array}
\hspace{0.5in}
& \begin{array}{c|ccccc}
s & 4 & 5 & 6 & 4 & 5\\
\hline
t & 3 & 2 & 1 & -3 & 2
\end{array} \\
& \\
\mbox{a.} \hspace{0.5in} & \mbox{b.}\\
\hline
\ & \ \\
\{(2,2),(3,2),(2,3),(1,4),(4,1)\} \hspace{0.5in} &\{(0,5),(1,-5),(2,5),(1,-5),(0,5)\} \\
\ & \ \\
\mbox{c.} \hspace{0.5in} & \mbox{d.} \\
\hline
\end{array}
\]
\begin{sol}
\begin{enumerate}
\item
This table describes a function with domain \(D=\{-2,-1,0,1,2\}\) and range
\(R=\{-1,0,1,2,3\}\).
\item
This table does not describe a function, because \(4\) is sent to two different elements.
\item
This list does not describe a function because \(2\) is sent to two different elements.
\item
This list describes a function with domain \(D=\{0,1,2\}\) and range \(R=\{-5,5\}\).
\end{enumerate}
\end{sol}
\mproblem
Decide if each of the following tables or lists describes a function. If it does, give the domain and range of the function.
\[
\begin{array}{|c|c|}
\hline
& \\
\begin{array}{c|ccccc}
x & 3 & 4 & 5 & 6 & 7\\
\hline
y & -3 & -4 & -5 & -6 & -7
\end{array}
\hspace{0.5in}
&
\begin{array}{c|ccccc}
x & 2 & 1 & 0 & 1 & 2\\
\hline
y & 3 & 2 & 1 & 2 & 3
\end{array}\\
& \\
\mbox{a.} \hspace{0.5in} & \mbox{b.}\\
\hline
& \\
\{(2,1),(1,-1),(0,1),(1,1),(2,-1)\} \hspace{0.5in}
& \{(r,0),(s,0),(t,0),(u,0)\} \\
& \\
\mbox{c.} \hspace{0.5in} & \mbox{d.} \\
\hline
\end{array}
\]
\problem
Answer the questions, and if a function is defined, state the independent
variable and the dependent variables.
\begin{enumerate}
\item Does the equation \(5y^2-9x=10\) define \(x\) as a function of \(y\)?
\item Does the equation \(5y^2-9x=10\) define \(y\) as a function of \(x\)?
\item Does the equation \(3b^2-a^3=27\) define \(a\) as a function of \(b\)?
\end{enumerate}
\begin{sol}
\begin{enumerate}
\item
To answer the question, we solve the equation for \(x\):
\[
\begin{array}{rcll}
5y^2-9x & = & 10& \mbox{The given equation}\\[2ex]
5y^2-9x-\color{red}{5y^2} & = & 10-\color{red}{5y^2} & \mbox{Subtract \(5y^2\) from both sides}\\[2ex]
-9x & = & 10-5y^2& \mbox{Simplify}\\[2ex]
\displaystyle{\frac{-9x}{\color{red}{-9}}} & = & \displaystyle{\frac{10-5y^2}{\color{red}{-9}}}& \mbox{Divide both sides by \(-9\) }\\[2ex]
x & = & -\displaystyle{\frac{10}{9}+\frac{5y^2}{9}}& \mbox{Simplify}
\end{array}
\]
The last line gives us a single answer for \(x\). So the equation defines \(x\)
as a function of \(y\). The independent variable is \(y\) and the dependent variable is \(x\).
\item
We solve the equation for \(y\):
\[
\begin{array}{rcll}
5y^2-9x & = & 10& \mbox{The given equation}\\[2ex]
5y^2-9x+\color{red}{9x} & = & 10 +\color{red}{9x} & \mbox{Add \(9x\) to both sides}\\[2ex]
5y^2 & = & 10+9x& \mbox{Simplify}\\[2ex]
\displaystyle{\frac{5y^2}{\color{red}{5}}} & = & \displaystyle{\frac{10+9x}{\color{red}{5}}}&
\mbox{Divide both sides by \(5\)} \\[2ex]
y^2 & = & \displaystyle{\frac{10+9x}{5}}& \mbox{Simplify}\\[2ex]
\sqrt{y^2} & = & \pm\displaystyle{\sqrt{\frac{10+9x}{5}}}&
\mbox{Take the square root}\\[-1ex]
& & & \mbox{(Don't forget the \(\pm\) sign) }\\[2ex]
y & = & \pm\displaystyle{\sqrt{\displaystyle{\frac{10+9x}{5}}}}& \mbox{Simplify}
\end{array}
\]
We found two different answers for \(y\).
So the equation does \textbf{not} define \(y\) as a function of \(x\).
\item
We solve the equation for \(a\):
\[
\begin{array}{rcll}
3b^2-a^3 & = & 27& \mbox{The given equation}\\[2ex]
3b^2-a^3-\color{red}{3b^2} & = & 27-\color{red}{3b^2} &
\mbox{Subtract \(3b^2\) from both sides}\\[2ex]
-a^3 & = & 27-3b^2 & \mbox{Simplify}\\[2ex]
a^3 & = & 3b^2-27&
\mbox{Multiply both sides by \(-1\) }\\[2ex]
\sqrt[3]{a^3} & = &\sqrt[3]{3b^2-27}&
\mbox{Take the cube root of both sides (one answer!)} \\[2ex]
a & = &\sqrt[3]{3b^2-27}& \mbox{Simplify}
\end{array}
\]
We found a single answer for \(a\). So the equation
defines \(a\) (the dependent variable) as a function of \(b\) (the independent variable).
\end{enumerate}
\end{sol}
\mproblem
\begin{enumerate}
\item Does the equation \(3t^2+6s=0\) define \(s\) as a function of \(t\)?
\item Does the equation \(5v^3-7u^2=1\) define \(v\) as a function of \(u\)?
\item Does the equation \(5v^3-7u^2=1\) define \(u\) as a function of \(v\)?
\end{enumerate}