This page introduces the idea of a function and looks at some common types, including linear, quadratic, exponential and logarithmic functions.

In brief, it covers the following:

What is a function?

A function is a relationship between input values and output values. In this relationship, every input value has exactly one output value that matches it. You can picture this relationship like this:

Two ovals, one labelled 'input' and one labelled 'output'. Both ovals contain small black circles representing values. The four values in the 'input' oval map to values in the 'output' oval, with two of them mapping to the same output value.

In this image, the group of input values is called the domain of the function. The group of all the output values that are possible is called the codomain. The group of output values that the input values actually match up to is called the range.

It’s fine for more than one input value to match up to the same output value, as shown in the image above. However, one input value can never match up to more than one output value. If this happens, the relationship is not a function.

As an example of a function, have a look at the linear relationship:

\[y = 2x + 3\]

This function takes a number \(x\) and changes it by multiplying it by \(2\) and then adding \(3,\). This gives you an output value called \(y\). Here are some examples of these input and output values:

Input value (x) Output value (y)
-1 1
0 3
1 5
2 7

The function \(y = 2x + 3\) works for all real numbers. However, this is not always the case for every relationship. Sometimes in order for a relationship to count as a function, you need to limit domain and/or the codomain.

For example, lok at the relationship \(y = \sqrt{x}\). This relationship does not give any real output values for negative input values. It also gives two output values for each positive input value. For example, the square root of \(9\) could be either \(-3\) or \(3\). Becuase of this, the relationship is only a function if both the domain and codomain are limited to non-negative real numbers (zero or higher).

If you have a graph of a relationship, you can check whether it is a function by using the vertical line test. This test says that the relationship is a only a function if every vertical line crosses the graph no more than once.

For example, look at the relationship on the left: \(y = 2x + 3\). This is a function, because there is no wat to draw a vertical line that crosses the graph more than once. However, the relationship on the right is not a function. This is because there is at least one point (in fact, there are many points) where a vertical line crosses the graph twice.

Plots of two relationships. The first relationship is a function as a vertical line at any point only intersects the graph once. The second relationship is not a function as a vertical line intersects the graph twice at some points.

Check your understanding of functions by completing the following activity:

Function names

A function can simply be written using \(x\) and \(y\) (or other variable names depending on the situation), like the function \(y = 2x + 3\) that we saw earlier. However, functions are usually given a name. The most common name used is \(f\).

For example, the linear function \(y = 2x + 3\) could be written as:

\[f(x) = 2x + 3\]

In this example:

  • \(f\) is the name of the function. We read this as \(f\) of \(x\) is equal to \(2x + 3\)
  • \(x\) is the input value that goes into the function.

For example, if we use an input value of \(x = 2\) for this function, we can write the following (note that this matches the \(y\) value shown in the table above):

\[f(2) = 7\]

Check your understanding of function names by completing the following activity:

\(f(z) = z^2 + 7\)

\(f(10) = 25\)

Types of functions

There are many different types of functions, Here, we will look at four types that have been covered in this module. These are:

  • Linear functions: Linear equations with two variables are examples of functions. In particular, they are called linear functions. For example, \(f(x) = 2x + 3\) is a linear function.

  • Quadratic functions: Quadratic functions follow the form \(f(x) = ax^2 + bx + c, \) where \(a \neq 0.\) For example, \(f(x) = 2x^2 + 3x -2\) is a quadratic function.

  • Exponential functions: Exponential functions follow the form \(f(x) = a^x,\) where \(a > 0.\) For example, \(f(x) = 3^x\) is an exponential function.

  • Logarithmic functions: Logarithmic functions follow the form \(f(x) = \log_a{x},\) where \(a > 0\) and \(a \neq 1.\) For example, \(f(x) = log_{10}{x}\) is a logarithmic function.

Check your understanding of different types of functions by completing the following activity:

This is an exponential function.

This is a quadratic function.