6.1 What is a function?
Mathematicians use functions to describe relationships between quantities. Examples of functions you may seen before are:
-
•
quadratic functions, e.g. ;
-
•
trigonometric functions: e.g. , and ;
-
•
exponential functions, e.g. and ; and
-
•
logarithmic functions, e.g. and .
We give a more formal definition of a function and then discuss how this aligns with the intuitive ideas you will have learned in your previous studies.
Definition 6.1 (Function, domain, codomain, graph).
A function is an object consisting of three sets:
-
(i)
a set called its domain;
-
(ii)
a set called its codomain; and
-
(iii)
a subset of called its graph.
These three sets must have the properties:
-
(a)
for every , there exists such that ; and
-
(b)
if and then .
Note, we typically give the function a name such as . Writing ‘’ means that . The two defining properties (a) and (b) of a function in Definition 6.1 state that each element of the domain is matched with exactly one element of the codomain. [Check that you see why.]
Example 6.2.
You may have seen statements like ‘’ in your previous studies. Let’s discuss what this means in terms of the formal definition above.
The variable in ‘’ can be any real number. So the domain could be .
The result of calculating for a real number will also be a real number. So in this example the codomain could be .
Here we define the graph as the set in Definition 6.1. Since elements of are pairs of real numbers, these can be plotted on a pair of coordinate axes to create a geometric object in the plane.
This geometrical representation of the graph is consistent with how you will have used the term in the past.
Note from the graph that for all real , and so we could define the codomain of the function to be instead of the whole of .
Definition 6.3 (Function notation).
The notation ‘’ means is a function with domain and codomain . We say ‘ maps to ’. In this situation the graph is not yet specified.
The notation ‘’ means the element of the codomain corresponding to in the domain under . In other words, if and only if . We say ‘ is the value of the function at ’.
When is a variable, can be thought of as a formula that specifies how to calculate the element of the codomain corresponding to any in the domain.
The notation ‘’ can be used to mean the same thing as . We say ‘ sends (or maps) to ’.
When referring to a function, you should use its name (e.g. ) and not the value at a point, e.g. . If you want to refer to the value of a function evaluated for a specific element of the domain then you should use .
There are several ways of visualising what a function is; Figure 6.1 shows the two most common ones. In Figure 6.1(a), we visualise a function as a machine that takes an element as an input, processes it, and then outputs . In Figure 6.1(b), we visualise a function as a mapping from its domain to its codomain.
You will sometimes see functions defined loosely using just a formula with no mention of a domain or codomain. For example, you may see phrases such as ‘let ’. This informality rarely causes problems, but you should remember that a function always has a domain and codomain.
When a domain is not stated explicitly, you can infer the implied domain from the context. For now, we define it to be the largest subset of for which the formula makes sense. The implied codomain is usually . However, to avoid ambiguity, it is good practice always to state the domain and codomain explicitly.
Exercise 6.4.
What is the implied domain of the function ? Following Definition 6.1, write down a domain, codomain and graph of . Sketch the graph of .
Solution (please try for yourself before looking)
The expression is undefined when and so cannot be in the domain of defined by . The (implied) domain of is .
The codomain could be . The codomain could also be since there is no such that .
With the graph is the set
Exercise 6.5.
What is the implied domain of the function ?
Solution (please try for yourself before looking)
The fraction is undefined whenever , i.e. when . So the implied domain of is .
Two functions are said to be equal when their domains, codomains and graphs are equal as sets.
Example 6.6.
-
(a)
Functions with and with are not equal, even though they are defined by the same formula, because their domains (and therefore also their graphs) are different.
-
(b)
If we consider the functions and with their implied domains, these functions are not equal because the implied domain of cannot contain the value , whereas the implied domain of is which does contain 1. However, the functions and with the above definitions are equal because their domains, codomains and graphs
and
are equal.
When defining a function, it is our job to choose an appropriate domain for whatever purpose the function is serving. For example, if we wish to prove something about integers, then it may make more sense to define function rather than function in the example above.
The importance of the codomain may not yet be clear. For now, you can think of the codomain as specifying the sort of object that a function outputs. Paying attention to the codomain becomes more important when we start to think about composing functions in Section 6.4.
Exercise 6.7.
Let and consider the set
-
1.
Sketch the set . [You may wish to start by listing some elements of .]
-
2.
The definition of a function with graph in Definition 6.1 has two conditions on the sets, namely:
-
(a)
for every , there exists such that ; and
-
(b)
if and then .
Explain why , and in this example do fit the definition of a function.
-
(a)
Solution (please try for yourself before looking)
-
1.
You may recognise the set as a unit circle centred at .
-
2.
Consider the conditions that must be satisfied by a function:
-
(i)
for every , there exists such that ; and
-
(ii)
if and then .
Condition (i) is not satisfied because for any or there is no such that . This can be seen from the sketch of the graph.
Condition (ii) is not satisfied because, for example, and both belong to , but .
-
(i)