Functions

A function maps one number to another

We have looked at triangle, square and cube number sequences

And we have defined functions for all of these but we didn’t use the word function

For triangle numbers we mapped n to the number in the sequence, X_n

X_n = \frac{n(n+1)}{2}

We did the same for square numbers

X_n = n^2

And cube numbers

X_n = n^3

These are all like functions except that functions are written in a different way.

The function for square numbers can be written as

f(x) = x^2

This is read as “f of x equals x-squared”

We can then plug numbers in to the function in place of x

f(2) = 2^2 = 4

f(9) = 9^2 = 81

Letters other than f can be used to name functions. f is the most common but other letters are used, g and h for example.

For triangle numbers

f(x) = \frac{x(x+1)}{2}

f(2) = \frac{2\times 3}{2} = \frac{6}{2} = 3

For cube numbers

g(x) = x^3

g(3) = 3^3 = 9