Function

A function is a mathematical device that converts one value to another in a known way. We can think of it as a machine. You feed the machine an input, it does some calculations on it, and then gives you back another value - the result of the calculations.

Function as a machine showing input and outputs

  • The set of allowable inputs to a given function is called the domain of the function.
  • The set of possible outputs is called the range of the function.

First create a function

The first step is to create a function. We give it a name and describe how it works inside. We write a function like this:

  • The function's name is f. We can name it anything but single letters are common
  • The input* value is called x. Again we could use anything but x is common.
  • On the right of the equals sign we see what the function does with the input.
    Here, the function takes the input x, multiplies it by three, then gives that out as the output. The function could do almost any calculation you like, but we have chosen a simple one for clarity.

* The input to a function is often called its 'argument', or 'parameter'.

Using the function

We can now use this function in any expression. For example This would use the function with an input of 3. Since this function multiplies its input by three, the variable j is given the value 9.

Below is a table showing the output of f(x) for a few sample values in its domain (input). Because the definition of f(x) says so, every output is three times the input.

Input Function value (output)
3 9
12 36
-2.2 -6.6

Using a function many times

A function can be used multiple times. Using our example function again: In this equation, the function f is used twice. The first time with an input of 2, then again with an input of 5. The result is that k will be given the value of 21.

In fact, this is a primary value of functions: you can 'package' a calculation as a function and the use it many times later.

Inverse functions

For some (but not all) functions, there can be another function - the 'inverse function' - that operates in reverse. That is, given the output, it tells us what the input would have been. For the example function above, the inverse function could be It outputs the input divided by three.

How we say it

This is spoken as
"f of x is defined as 3x"
"j equals f of 3"

Graphing a function

A graph of a function is a picture that shows how the input and output are related. See the example on the right for the function It shows how the output changes as you gradually change the input. For more on this see Graphs.

Functions in computer programming

Functions are widely used in computer programming languages and spreadsheets. They are a fundamental tool used to structure the programs and are either user-written, or come built into the languages and spreadsheets themselves. See Functions in computer programming.

Pages referring to 'function'

How to find the general function that produces the derivative of another in calculus. Interactive calculus applet.
Not all integrals have antiderivatives that can be written down using the basic functions and operations that we know. Some functions are, in fact, defined using an integral. This page shows two such functions in calculus. Interactive calculus applet.
Explores the derivatives of invertible functions in calculus. Interactive calculus applet.
Definition of the cosine function as applied to right triangles in trigonometry
Domain of a function - the range of allowable values of the independent variables
Functions are used extensively in computer languages and spreadsheets
Graph of a function showing how the input affects the function's value
Interactive demonstration of the graph of the cosine function in trigonometry
Interactive demonstration of the graph of the sine function in trigonometry
Interactive demonstration of the graph of the tangent function in trigonometry
GFE is a free online function graphing tool that allows you to plot up to three functions on the same set of axes. In the functions you can refer to up to four independent variables that are controlled by sliders. The function grapher can plot sinusoidal and other trigonometric functions including sine (sin), cosine(cos) and tan. Similar to a graphing calculator.
Introduction to the 6 trigonometry functions - sine, cosine, tangent, secant, cosecant, cotangent
An interactive applet that allows you to graphically see the effects of changing the coeeficients in a linear function in the form ax+b using sliders
An interactive applet that allows you to graphically see the effects of changing the coeeficients in a linear function in the form mx+b using sliders
Definition of secant function in trigonometry as applied to right triangles
A memory aid for remembering the definitions of sin, cos, and tan
Definition and discussion of the inverse trigonomtery functions such as arc sin, arc cos, arc tan
Definition of the sine function as applied to right triangles in trigonometry
Definition of the tangent function as applied to right triangles in trigonometry
Definition of the arccos function in trigonometry. The inverse of the cosine function. The angle whose cosine is a given number.
Definition of the arcsin function in trigonometry. The inverse of the sine function. The angle whose sine is a given number.
Definition of the arctan function in trigonometry. The inverse of the tangent function. The angle whose tangent is a given number.
Definition of the arctan function in trigonometry. The inverse of the tangent function. The angle whose tangent is a given number.
Trigonometry functions are defined for any angle and for negative angles