Page 2.4: Introduction to Functions
In calculus, we will frequently deal with functions and so the goal of this section is to explain, what do we mean by a function ? In order to answer this question, we first must discuss the notion of a set.
Definition: A set, typically denoted by a capital letter such as \(A\), refers to an unordered collection of well-defined objects. We call the objects in the set the elements of the set. If \(x\) is an element of \(A\), we write \( x \in A \). If \( x \) is not an element of the set \(A\), then we write \(x \not\in A\).
There are a few different ways to mathematically denote a set. One way to denote or describe a set is the roster method. The roster method describes a set by explicitly listing its elements. For instance, the set \(A\) of all positive integers less than 5 can be written as \( A = \{ 1, 2, 3, 4 \} \). Or the set \(A\) of all positive integers less than 100 can be written as \( A = \{ 1, 2, 3, \ldots, 99 \} \).
However, there is another common way to describe a set. Specifically, we can use what is called set-builder notation. To use set builder notation to describe a set, we describe the property an element must have to be a member of the set. Intuitively, we can think of the set builder notation as being the blueprints for the set. That is, the set builder notation tells us how to build the set. For instance, the set \(A\) of all positive integers less than 5 can be written as \(A = \{ x : x \in \mathbb{Z^+} ~ \text{and} ~ x \leq 5 \} \) or \(A = \{ x ~ | ~ x \in \mathbb{Z^+} ~ \text{and} ~ x \leq 5 \} \).
The general form when using set builder notation is to write \( \{ x | x ~ \text{has property} ~ P \} \).
Another type of set that we should be familiar with is intervals. In calculus, we will often look at intervals of real numbers. These intervals are also sets and can be described via set builder notation.
1) \( [a,b] = \{ x \in \mathbb{R} ~| ~ a \leq x \leq b \} \)
2) \( [a,b) = \{ x \in \mathbb{R} ~| ~ a \leq x < b \} \)
3) \( (a,b] = \{ x \in \mathbb{R} ~|~ a < x \leq b \} \)
4) \( (a,b) = \{ x \in \mathbb{R} ~|~ a < x < b \} \)
5) \( [a, \infty) = \{ x \in \mathbb{R} ~| ~ a \leq x \} \)
6) \( (a, \infty) = \{ x \in \mathbb{R} ~| ~ a< x \} \)
7) \( (- \infty ,b] = \{ x \in \mathbb{R} ~| ~ x \leq b \} \)
8) \( (- \infty ,b) = \{ x \in \mathbb{R} ~| ~x < b \} \)
9) \( (- \infty ,\infty) = \mathbb{R} \)
A visual representation of these can be found here: https://math.libretexts.org/Courses/Prince_Georges_Community_College/MAT_2160%3A_Applied_Calculus_I/06%3A_Algebra_Review/6.04%3A_Set-Builder_and_Interval_Notations
Notice that we said a set is just an unordered collection of well-defined objects. We never said these objects have to be numbers and so the following are also examples of sets.
1) \( A = \{ 1, 2, 3, 4, 5, 6 \} \).
2) \( E = \{ x ~|~ x ~ \text{is a student enrolled in our Math 241 course} \} \).
3) \( F = \{ x \in \mathbb{Z} ~|~ x \leq 10 \} \).
4) \( G = \{ (1,6), (2,5), (3,4), (4,3), (5,2), (6,1) \} \).
If we wish to denote a function visually, then we would often construct an image that looks like the following:
We are now in a position to explain what is meant by the word, function .
Definition: Let \(A\) and \(B\) be nonempty sets. A function, \(f\), from \(A\) to \(B\) is a rule that assigns to each element in \(A\) one and only one element, in \(B\). We write \(f(a) = b\) if \(b\) is the unique element of \(B\) assigned by the function \(f\) to the element \(a\) of \(A\). If \(f\) is a function from \(A\) to \(B\), we write \(f: A \longrightarrow B\) and we call \(A\) the domain of \(f\) and we call \(B\) the codomain of \(f\).
We will often let \(x\) denote an element in domain and \(y\) denote an element in the codomain.
The above definition is saying that for a rule to be regarded as a function, two conditions must be met:
1) Every element in the alleged domain has the capability of being "plugged" into the function (meaning that every element in the domain gets "mapped" to somewhere in \(B\).
2) When that mapping happens, each element in \(A\) gets sent to one and ONLY ONE element in \(B\). That is, no \(x\) value should ever get sent to two different \(y\) values.
In addition to the picture representation of a function, we may also represent a function via an algebraic equation, though a table of values, or by a set of coordinates.
For instance, consider the function \(f: \mathbb{R} \rightarrow \mathbb{R} \) defined by \(f(x) = x^2 \). This is the algebraic way to denote the function. Alternatively, we could construct a table of values as follows:
| \(x\) | \(y\) |
|---|---|
| \( \ldots \) | \( \ldots \) |
| -2 | 4 |
| -1 | 1 |
| 0 | 0 |
| 1 | 1 |
| 2 | 4 |
| \( \ldots \) | \( \ldots \) |
Alternatively, we may graph the function:
or list a set of coordinates: \( \{ \ldots, (-2,4), (-1,1), (0,0), (1,1), (2,4), \ldots \} = \{ (x,x^2 ) ~ | ~ x \in \mathbb{R} \} \)
The final way we may represent a function is by drawing it's graph. A quick way to check if a graph is indeed the image of a function is to apply the Vertical Line Test.
Theorem: A curve in the coordinate plane is the graph of a function provided that every vertical line intersects the curve at most.
Notice if there is some vertical line that intersects the curve more than once, then this is telling us for a single \(x\) value, there are multiple \(y\) values this particular \(x\) value gets mapped to and hence the curve fails to be a function.
Using Desmos, graph the equation \(x^2 + y^2 = 25 \). Does this equation represent a function?
- Answer
-
No, we see this function fails the Vertical Line Test.
Using Desmos, graph the equation \( y = x^2 \). Does this equation represent a function?
- Answer
-
Yes, we see this function passes the Vertical Line Test.
Determine if each rule stated below is a function.
1) \(f: \mathbb{R}^+ \rightarrow \mathbb{R}, f(x) = \sqrt{x} \)
2) \(f: \mathbb{R} \rightarrow \mathbb{R}, f(x) = \sqrt{x} \)
3) \(f: \mathbb{R}^+ \rightarrow \mathbb{Z}, f(x) = \sqrt{x} \)
- Answer
-
1) This is a function because every element in the alleged domain has the capability of being "plugged" into the function and upon doing so, the function always yields one and only one output.
2) This is NOT a function because we cannot plug in every element in the domain into our function. For instance, \( f(-1) = \sqrt{(-1)} \not\in \mathbb{R} \).
3) This is NOT a function because there are elements in the domain which do not get mapped to any element in the codomain. For instance, \( f(2) = \sqrt{2} \not\in \mathbb{Z} \).
Notice in \(f: \mathbb{R} \rightarrow \mathbb{R} \) defined by \(f(x) = x^2 \), not every possible value in the codomain gets mapped to. For instance, we will never find an element \(x\) in the domain such that \( f(x) = -1 \).
However, consider \(f: \mathbb{R} \rightarrow \mathbb{R} \) defined by \(f(x) = x \). Notice for this function, every element in the codomain gets mapped to.
The set of values for which a function maps to is called the range of the function.
Definition: If \(f: A \rightarrow B\) then the set \( \{ f(x) ~ | ~ x \in A \} \) is called the range of \(f\).
Intuitively, the range of \(f\) is the set of all \(y\)-values or the set of all outputs for the function.
For each function below, determine the domain and range.
1)
2)
3) \(f: \mathbb{R} \rightarrow \mathbb{R}, f(x) = 3 \).
4) \(f: \mathbb{R} \rightarrow \mathbb{R}, f(x) = x \).
5) \(f: \mathbb{R} \rightarrow \mathbb{R}, f(x) = x^2 \).
- Answer
-
1) The domain is \( \{a, b, c, d \} \) and the range is \( \{ e, f, g, h \} = B \).
2) The domain is \( \{ a, b, c, d \} \) and the range is \( \{ e, f, g \} \neq B \).
3) The domain is \( \mathbb{R} \) and the range is \( \{3\} \).
4) The domain is \( \mathbb{R} \) and the range is \( \mathbb{R} \).
5) The domain is \( \mathbb{R} \) and the range is \( [0, \infty) \).
Sometimes the domain of a function is not specified. In such a case, we take the domain to be the set of all real numbers which makes the function valid. Note that it is sometimes easier to ask yourself "when is the function not defined?" as opposed to asking "when is the function defined?"
Determine the domain of the following functions.
1) \( f(x) = \frac{1}{x} \)
2) \( f(x) = \sqrt{x-4} \)
3) \( f(x) = 3x^2 - 6 \)
4) \( f(x) = \frac{1}{x^2 - 5x + 6} \)
- Answer
-
1) The domain is \( (- \infty, 0) \cup (0, \infty) \).
2) The domain is \( 4, \infty) \).
3) The domain is \( \mathbb{R} \).
4) The domain is \( (- \infty, 2) \cup (2, 3) \cup (3, \infty) \).