Understanding relations and functions is crucial for exploring more advanced topics in math and their applications in various scientific and engineering areas. Use this resouce to learn about what functions and relations are.
Relations
A relation is a set of ordered pairs. For example, \((1,2),(2,6),(3,4),(x,y)\) are ordered pairs. If the set is a relation, they are written inside curly brackets: \(\left\{ (1,2),(2,6),(3,4),(x,y)\right\}\).
The domain (dom) of a relation is the set of first elements or the \(x\)-values of the ordered pairs. For \(\left\{ (1,2),(2,6),(3,4),(x,y)\right\}\), \(\textrm{dom}=\left\{ 1,2,3,x\right\}\).
The range (ran) of a relation is the set of second elements or the \(y\)-values of the ordered pairs. For \(\left\{ (1,2),(2,6),(3,4),(x,y)\right\}\), \(\textrm{ran}=\left\{ 2,4,6,y\right\}\).
If the domain is not given then we assume the largest possible domain.
There is often a rule that links the domain and range. For example, consider a relation called \(S\) where:
\[ S = \left\{ (x,y):y>x,x\in\mathbb{R}\right\} \]
The symbol \(\in\) means “is in” or “is an element of” and \(\mathbb{R}\) stands for the set of real numbers. The expression \(x\in\mathbb{R}\) means that “x is an element of the set of real numbers”. That is, \(x\) is a real number.
Therefore, relation \(S\) is defined by the rule \(y>x\) and its domain \(x\in\mathbb{R}\). The relation consists of the set of all ordered pairs (\(x\) and \(y\)), where the \(y\) value is greater than the \(x\) value and where \(x\) must be a real number.
The rule of a relation may be thought of as: \(\textrm{DOMAIN}\rightarrow\textrm{RULE}\rightarrow\textrm{RANGE}\). Values taken from the domain are applied to the rule, which then produces the values for the range.
Example 1 – identifying the domain and range of relations
Consider the graph of the following relation and state the domain and range.
\[ \left\{ (x,y):y=x^{2}\right\} \]
The rule joining the set of ordered pairs \((x,y)\) is \(y=x^{2}\).
\(x\) can be any real number, so \(\textrm{dom}=x\in\mathbb{R}\).
\(y\) must be greater than or equal to \(0\), so \(\textrm{ran}=\left\{ y:y\geq0 \right\}\).
Consider the graph of the following relation and state the domain and range.
\[ x^{2}+y^{2}=4\]
The rule joining the set of ordered pairs \((x,y)\) is \(x^{2}+y^{2}=4\).
\(\textrm{dom}=\left\{ x:-2\leq x\leq2\right\}\)
\(\textrm{ran}=\left\{ y:-2\leq y\leq2\right\}\)
Consider the graph of the following relation and state the domain and range.
\[\left\{ (x,y):2x+3y=6,x\geq0\right\}\]
The rule joining the set of ordered pairs \((x,y)\) is \(2x+3y=6\).
The restriction \(x\geq0\) is placed on the domain, so \(\textrm{dom}=\left\{ x:x\geq0\right\}\).
\(\textrm{ran}=\left\{ y:y\leq2\right\}\)
Exercise – identifying the domain and range of relations
State the domain and range of the following relations.
\(\textrm{dom}=\left\{ -2,0,2,3\right\}\) and \(\textrm{ran}=\left\{ 1,2,5,7,9\right\}\)
\(\textrm{dom}=\left\{ 4,5,6\right\}\) and \(\textrm{ran}=\left\{ 1,2,3\right\}\)
\(\textrm{dom}=\left\{ x:-5\leq x\leq5\right\}\) and \(\textrm{ran}=\left\{ y:-5\leq y\leq5\right\}\)
\(\textrm{dom}=\left\{ x:x\geq2\right\}\) and \(\textrm{ran}=\left\{ y:y\leq-2\right\}\)
Functions
For some relations, values in the domain (\(x\) values) may have many corresponding values in the range (\(y\) values), even an infinite number! When each point in the domain has a unique value in the range, the relation is called a function. In other words, every value of \(x\) has only one value of \(y\) in a function.
For example, the relation \(\left\{ (-1,2),(-1,4),(1,6),(2,8),(3,10)\right\}\) IS NOT a function because the value \(x=-1\) has two corresponding \(y\) values (\(2\) and \(4\)).
However, \(\left\{ (-1,1),(0,2),(1,3),(2,5),(3,7)\right\}\) IS a function because for each \(x\) value, there is only one corresponding \(y\) value.
Mapping notation
Let's consider the relation \(F=\left\{ \left(x,y\right):y=\sin(x),x\in R\right\}\).
If we choose any possible value of \(x\), there exists only one corresponding value of \(y\). Therefore, the relation \(F\) is a function. We can also write this function using mapping notation.
\[ f:X\rightarrow Y,\textrm{where }f(x)=\sin (x)\]
This means that the domain \(X\) is mapped onto the range \(Y\) using the rule \(f(x)=\sin(x)\).
Vertical line test
When you are given the graph of a relation, you can use a vertical line test to determine whether it is a function.
If you draw a vertical line through the \(x\)-axis, and it crosses the graph more than once, then it is NOT a function. This just means that there is an \(x\) value with more than one \(y\) value.
Consider the graphs of \(y=\pm\sqrt{x}\) and \(y=x^{2}\).
When a vertical line is drawn through \(y=\pm\sqrt{x}\), it crosses the graph more than once, so it is not a function. But when one is drawn through \(y=x^{2}\), the vertical line only crosses the graph once, so this relation is a function.
Exercise – identfying functions
Identify which of the following relations are functions.
\(\left\{ x,y:y=2x+4\right\}\)
\(\left\{ x,y:y=4-x^{2}\right\}\)
\(\left\{ x,y:x^{2}+y^{2}=36\right\}\)
\(\left\{ x,y:y=7\right\}\)
\(\left\{ x,y:x=-2\right\}\)
\(\left\{ x,y:y=-\sqrt{4-x^{2}}\right\}\)
A, B, D and F are functions.
Implied domain
When only the rule of a function is given, we usually assume that the domain is all real numbers, \(\mathbb{R}\), unless the function itself shows a different domain. There are a few examples of functions where the domain is restricted.
Functions with square roots
If a function involves a square root, the domain (in the real number system) is restricted to \(x\) values that give in a non-negative number under the square root sign. For example, the domain of the function \(y=+\sqrt{x-4}\) would be restricted so that \(x-4\geq0\). The domain is \(\left\{ x:x\geq4\right\}\).
Similarly, the domain of the function \(y=+\sqrt{9-x^{2}}\) would be restricted so that \(9-x^{2}\geq0\), making the domain \(\left\{ x:-3\leq x\leq3\right\}\).
Functions with fractions
If the function involves a fraction, the value in the denominator must not equal \(0\). So, the domain of the function \(y=\dfrac{3}{x+5}\) is restricted so that \(x+5\neq0\). This means its domain is \(\left\{ x:x\neq-5\right\}\).
The domain can also be written as \(\left\{ x:x\in\mathbb{R}\setminus\left\{ -5\right\} \right\}\). This means that the domain is the set of real numbers excluding \(-5\).
Consider another example: \(y=\dfrac{3}{2x-8}\). The domain of this function is restricted so that \(x-8\neq0\); therefore, the domain is \(\left\{ x:x\neq4\right\}\) or \(\left\{ x:x\in\mathbb{R}\setminus\left\{ 4\right\} \right\}\).