5.1 - Introduction to functions
Definition: A function is a correspondence or mapping
from a first set of numbers, called the domain of the function,
to a second set of numbers, called the range of the function,
such that for each member of the domain there is exactly one member of
the range, as shown in this picture:
The function machine concept and functional notation
It is useful to think of a function as a machine with a number from the domain as the input and a
corresponding number of the range as output. The function is given a name like f
(short for the word “function”), and if the number going into the machine is
called x, then the corresponding number returned by or coming out of the machine
is denoted f (x). Here is a picture:
The functional notation f (x) literally means
“function of x”.
Ways of expressing a function
A function can be expressed in various ways:
A function can be expressed in list form, especially if the
domain and range are small. Here is an example of a function in list form:
If this function is called f then f (10) = 3 and
f (2) = 15.
- A function can be expressed in graph form.
The function is represented by a curve drawn on a cartesian plane.
The domain is plotted horizontally (in the x direction) and the range is
plotted vertically (in the y direction).
To find the range value y corresponding to a given domain value x
you start at the domain value on the x axis, go vertically
until you reach the graph, then go horizontally until you reach the
y axis. Here is an example of a function in graph form:
If this function is called g then for example g (−1) = 1 and
g (2) = 2.5. Click here
to see the graphs of a variety of function types.
- A function can be expressed in formula form.
The formula is used to calculate the range value for any given domain value.
Here is an example of a function in formula form:
h (x) = x 2 − 2 x
This function is called h . Here is an example showing how
the formula is used to calculate a value of the range for a value of the domain, say 4.
The domain value 4 is substituted in for x wherever x occurs and then the formula is
simplified to yield the range value:
h (4) = 4 2 − 2 · 4 = 8.
Here is another example with the domain value 5:
h (5) = 5 2 − 2 · 5 = 15.
Another way to write the above function is this:
y = x 2 − 2 x.
In this form h (x) has been replaced by a new variable y so
that there are now two variables, x and y.
Variable y is the value of the
range that corresponds to the value of variable x of the domain.
Variable y is called the dependent variable and
variable x is called the independent variable.
This form plays down the function aspect of the relationship and just gives an equation
connecting values of the domain and range.
Yet another way to write the function is in two parts, like this:
y = h (x), where h (x) = x 2 − 2 x.
The first part gives a name to the function and the second part gives the formula for the function.
The argument and value of a function
The value of the domain that goes into the function machine is also called the
argument of the function and the value of the range that comes out of
the function machine is also called the value of the function.
For example suppose that f (5) = 15. Then we say that the
argument of the function f is 5 and the value of f is 15.
Identifying the domain and range of a function
The domain and range of a function isn’t always the set of all real numbers.
If a function is expressed in list or graph form you can identify the
domain and range by simply looking at the list or graph. But if
the function is expressed in formula form then you must do the following:
- Substitute potential domain values into the formula and make sure
that they don’t cause an undefined operation to occur (such as division
by zero or the square root of a negative number). If they do then they are
not in the domain.
- Once the domain is known, you can find the range by substituting
various domain value into the formula.
Example: Consider the function
. The domain
must be because
otherwise we are trying to take the square root of a negative number.
Then if we substitute various values of the domain into the formula,
we see that the range is .
Here is a graph of this function which corroborates our findings:
The vertical line test for a function
The definition of function states that for each member of the domain there
can be only one member of the range. Thus the graph of a function cannot
look like this:
where there is an x value for which there are two or more corresponding
y values. If the graph does not pass this so-called vertical line
test then it is not the graph of a function.
Instead we say that it is the graph of a relation
between x and y.
One-to-one and many-to-one functions
A function is said to be one-to-one if every y value has exactly
one x value mapped onto it, and many-to-one if there are
y values that have more than one x value mapped onto them.
This graph shows a many-to-one function. The three dots indicate three x
values that are all mapped onto the same y value.
One complication with a many-to-one function is that it can’t have an
inverse function. If it could, that inverse
would be one-to-many and this would violate the
definition of a function.
Substituting expressions into functions
Often, especially in calculus, we use the formula form of a function
and we let the argument be an expression instead of
just a number. The only complication in this case is that we must usually
put brackets around the argument to preserve the proper order of operations.
This is because the formula is just a recipe for what
to do to the input (the argument) to get the output (the function value).
For example the functional notation:
f (x) = x 2 − 2 x
means that the function value is gotten by taking the square of the argument
and subtracting twice the argument from it. It doesn’t actually matter
what letter we use for the argument; it is how the function works that
Thus the following are all valid substitutions:
- f (4) = 4 2 − 2 · 4
- f (t) = t 2 − 2 t
- f (x+ h) = (x+ h) 2 − 2 (x+ h)
- f (a x) = (a x) 2 − 2 (a x)
Warning: Don’t be confused by the brackets.
On the left side of each example the brackets indicate functional notation. Thus:
means that we have a function named f and that its argument is
whatever. We are not multiplying f by whatever !
On the right side we are using brackets to preserve the order of operations.
Composition of functions
Just as we can substitute an expression into a function, so we can
substitute another function into a function. For example in the previous
section we defined the function:
f (x) = x 2 − 2 x
If we substitute another function g (x) into this function
then we get:
For example if g (x) = x + 3 then:
We can also switch the order and substitute f into g,
Notice that the result is completely different.
If we think of f and g as machines, then substituting
f into g means that the output of
f is the input of g, as shown here:
The composition of functions is important because this method can be used
to create complicated functions out of simple components.
Inverse of a function
Suppose that a function f maps x onto y and that
another function g maps y back onto the original x as shown here:
Then function g is called the inverse function of function f
and the composition of f and g has no overall effect.
Note that function f must be one-to-one for it to have an inverse.
One way to derive the inverse function g for any function f is this:
- Set f (x) equal to y.
- Solve the equation y = f (x) for x.
If there is exactly one solution then the inverse exists; otherwise it doesn’t.
- In the equation just found, rename x to be g (y).
Example: Find the inverse function g of the function
f (x) = 2 x + 3.
Example: Try to find the inverse function of the function
f (x) = x 2.
Notice that function f takes its argument, multiplies it by 2 and then adds 3.
The inverse function, g,
does exactly the opposite steps in the opposite order.
It takes its argument, first subtracts 3 and then divides by 2.
This is exactly what you would expect the inverse to do.
||Set f (x) equal to y
Solve for x
Rename x as g (y). This is the inverse.
Notice that f maps two points onto every point. For example
f (2) = 4 and f (−2) = 4. Thus the inverse would have to
map the point 4 back to both points 2 and −2. But this violates
the definition of a function so there is no inverse.
||Set f (x) equal to y
Solve for x. There are two solutions so the inverse doesn’t exist.
If you found this page in a web search you won’t see the
Table of Contents in the frame on the left.
Click here to display it.