## Functions

The concept of a function is more central in mathematics than the
concept of a number. In this class we use functions only in a very
narrow context, but if you go on in mathematics you will encounter
functions ubiquitously in every class you take.

### Domain, Range, and Rule

For the purposes of this class, you can think of a function as a
machine that takes a number (the input), processes it, and produces
another number (the output). A given input always produces the same
output, but the same output can be produced by different inputs. The
way a particular function processes the input is usually described by
an algebraic expression (sometimes called the **rule**). Processing a particular input
is
called **evaluating** the function at .
The set of all numbers for which you can in fact evaluate the function
is called the **domain** of the function,
the set of all possible outputs you obtain in this manner is called
the **range** of the function.

For example, consider the equation

This defined a function whose name is . (Any letter can be used
to be the name of a function, but and are used particularly
frequently.) To obtain the function value (or the value of ) at
a number we divide by and add . For example,
when we obtain
The ** domain** of is the set of all real numbers except
since we must not divide by zero. The ** range** of is the set
of all real numbers except since in order for to equal
, the expression
would have to be zero which is
not possible.
Sometimes you will be asked to determine the domain of a
function. There are more subtle situations, but in this class the
domain is always the set of all real numbers, except those where
you cannot evaluate the expression. Usually the only reason you might
be unable to evaluate a function is that the relevant expression might
call for a division by zero, or the computation of a square root of a
negative number.

For example, the domain of the function

is the set of all real numbers except and , and the
domain of the function
is the set of all
non-negative numbers (i.e., ).

### Evaluating a Function

It is easy to be confused about just what it means to evaluate a
function. Functions can be evaluated not just at numbers, but also at
algebraic expressions, and at other function values. Let's look at
some examples. Suppose that is defined

Then

### Combining Functions

Functions can be combined in various ways to create new
functions. Suppose and are two functions, and
is one of the arithmetic operations , ,
, or . Then a new function

is
defined by
In other
words, the value of the sum, difference, product, or ratio of two
functions is the sum, product, difference, or ratio of the
corresponding function values.
For example, suppose as before that

and let
Then

### Composition of Functions

A function can be evaluated at the value of another (or the same)
function. This is called the **composition** of functions. The
composition of two functions and is denoted by

where
For example, letting and
be defined as before we have
Note that, on the other hand,

Thus

In other words, it matters in
what sequence we compose two functions. This is a major fact of life
in mathematics! Mathematicians are fond of
expressing this fact as

###
Function composition does not commute.

There are subtle issues regarding the domain and range of the
functions involved. In particular, when we consider a composition
like the range of must be a subset of the domain of
.

The **graph** of a function is the
graph of the equation

The Figure below shows the graphs of some of the functions on
this page, as indicated by color (yellow), (blue),
(red), and (green).