Professional Documents
Culture Documents
Table of Contents
What is a function?
You may have heard several possible definitions of a function. We’ll discuss
these, in order to clarify what we’re talking about!
A function might be described in the following ways. But some of these
descriptions are more accurate than others, and some are more correct
than others!
A function f : X → Y is ...
Some of these notions are more rigorous than others! Let’s see how they
stack up.
A function always has a domain and a codomain. Letting the function be
f , the domain A and the codomain B, we write f : A → B.
We can define a function with domain A and codomain B as follows.
√
Here’s a function. Let A = {Blue, Horse, π} and B = {0, 2, Love}. We
can define a function f : A → B by declaring that
Again, this is a well-defined function. It’s a bit more meaningful than the
previous function, because the elements of M are all surnames of mathe-
maticians who won the Fields medal. There’s a ‘formula’ for the function
f , given by
Examples of functions
Most of the functions you will meet in life will be defined on R, or subsets
of R. In this section we consider some examples of such functions.
Graphs of functions
Let us suppose we have a function f (x) whose inputs and outputs are real
numbers. The graph of f is drawn by plotting all the points (x, y) in the
Cartesian plane such that y = f (x).
For example, we consider the graphs of some of the examples above.
1. The graph of a constant function
f (x) = c is the horizontal line
y = c. The graph consists of all
the points (x, c), where x is a real
number.
For example, the graph of the
function f (x) = 2 is a horizontal
line at height 2.
2. The graph of a linear function
f (x) = mx + c is, as the name
suggests, a line. Moving along the
line one unit to the right, you go
up by m units; we say the line has
gradient m. If m = 0, it intersects
the x-axis (or indeed any horizon-
tal line) exactly once.
3. The graph of a quadratic function
f (x) = ax2 + bx + c is a parabola.
(We discuss quadratics in a later
section.) It intersects the x-axis y=f(x)
1
Graph of f (x) = x2 −2x
Graph of f (x) = 1/x
6. For a positive real number a, the graph of the exponential function
f (x) = ax , and the logarithm function g(x) = loga x, are as shown.
One graph is obtained from the other by reflecting in the line y = x.
(Actually, this is true of any two inverse functions, as we’ll see below.)
The elements of this set are ordered pairs (x, y), where x ∈ X and y ∈ Y .
Functions 7
The set of all pairs (x, y), where x varies over all elements of X, and y
varies over all elements of Y , is called the product X × Y of the sets X
and Y .
X × Y = {(x, y) : x ∈ X, y ∈ Y }
The set above describing f is a subset of X × Y :
{(x, y) : x ∈ X, y = f (x)} ⊂ X × Y.
When we draw the graph y = f (x), we plot the set of points (x, y) where
y = f (x), i.e. the points of the above set.
In general, any function f : X → Y is described by a subset of X × Y .
But not every subset of X × Y comes from a function! A subset of X × Y
in general is called a relation.
Example 1
Consider the function f : [0, 1] → [0, 1], f (x) = x. It corresponds to the
set
{(x, x) : x ∈ [0, 1]} ⊂ [0, 1] × [0, 1].
Example 2
Define the function g : [0, 1] → [0, 1] by
g(x) = x − x2 . You can check g is well-
defined: whenever 0 ≤ x ≤ 1, the value
of x − x2 always lies between 0 and 1 (in
fact between 0 and 14 ). The correspond-
ing set is
Example 3
However, consider the following set.
(x, y) : x ∈ [0, 1], y = 14 − x2 ⊂ [0, 1]×[0, 1]