## What you need to know

### Functions

In maths, a function is something that takes an input and produces an output. Functions may be given in the form of function machines – or they may be given as mathematical expressions. In this example, we’ll see how you can get from one to the other.

The function given by 3x+1 where x is the input. To express this more formally, we write

f(x) = 3x+1

If we were then to input 10 into this function that would look like:

f(\textcolor{red}{10}) = 3\times \textcolor{red}{10} + 1 = 31.

If we want to talk about multiple different functions at the same time, we might call the others g(x), h(x) and so on.

### Composite Functions

A composite function is the result of one function being applied immediately after the other. Suppose we have two functions: f(x) and g(x). Then,

fg(x)

is a composite function. What this notation means is basically substitute the g(x) expression into the f(x) expression, each time you see an x. It sounds complicated but gets a lot easier with practise.

**Inverse Functions**

An inverse function is a function acting in reverse. The inverse function of f(x) is given by f^{-1}(x), and it tells us how to go from an output of f(x) back to its input. The process of finding an inverse function amounts to a little bit of algebraic rearranging. Having a great knowledge of rearranging equations will be required for inverse functions, so if you haven’t already head over there to revise first.

### Example 1: Function Machine

Determine the output of the inputting the following 4 terms: 3, -2, x, 4m into the function machine below. Bonus: what input gives the output of 16?

This function tells us that the first thing done to our input is to multiply it by 3. Then, we must add 1 to result of that first multiplication to get the output.

- Input of 3: 3\times 3=9, and 9+1=10, so 10 is the output.
- Input of -2: -2\times 3=-6, and -6+1=-5, so -5 is the output.
- Input of x:\hspace{2mm}x\times 3=3x, and 3x+1 cannot be written more simply, so 3x+1 is the output.
- Input of 4m:\hspace{2mm}4m\times 3=12m, and 12m+1 cannot be written more simply, so 12m+1 is the output.

The third output here is precisely the function machine written as an expression. In other words, this function can be expressed like

3x+1

where x is the input.

### Example 2: Composite Functions

Let f(x)=x-3 and g(x)=x^2.

Find:

a) fg(10)

b) (-4)

c) an expression for fg(x)

a) We must find g(10) then apply f(x) to the answer.

g(10) = 10^2 = 100,\text{ so } fg(10) = f(100) = 100 - 3 = 97.

b) we must find f(-4) then apply g(x) to the answer.

f(-4) = -4-3 = -7,\text{ so } gf(-4) = g(-7) = (-7)^2 = 49.

c) we need to input g(x) into f(x). So, we get

fg(x) = f\left(g(x)\right) = g(x) - 3 = x^2 - 3.

If you consider that when working out fg(10) we first squared 10 and then subtracted 3, this answer makes sense.

### Example 3: Inverse Functions

Find the inverse function of f(x) = 3x - 9.

To do this, write the function as y=3x-9 and rearrange this equation to make x the subject. Once this is done, swap every y with an x – and vice versa – and you have the correct expression of the inverse function.

So, adding 9 to both sides of the equation, we get

y + 9 = 3x

Then, dividing both sides by 3 makes x the subject:

\dfrac{y + 9}{3} = x

Now, swap each x with a y and vice versa to get

y = \dfrac{x + 9}{3}

Which we express properly like the following

f^{-1}(x) = \dfrac{x + 9}{3}.

### Example Questions

1) The diagram below shows a function machine. For the following inputs and outputs of that machine, calculate the corresponding output or input.

\text{Input}\longrightarrow \boxed{ \div6 } \longrightarrow \boxed{ -5 } \longrightarrow \text{Output}

a) \text{Input} = 12

b) \text{Output} = -9

c) \text{Input} = 42a

d) \text{Output} = z+4

e) \text{Input} = 3x

Here we will write both function machine operations in one go, putting brackets around the first one since we must do that one first. In the case of going from output to input, we must do the opposite operations and start with the one on the right first.

a) (12 \div 6) - 5 = (2) - 5 = -3

b) (-9 + 5) \times 6 = (-4) \times 6 = -24

c) (42a \div 6) - 5 = (7a) - 5 = 7a - 5

d) (z + 4 + 5) \times 6 = (z + 9) \times 6 = 6z + 54

e) (3x \div 6) - 5 = \dfrac{x}{2} - 5 = \dfrac{x}{2} - \dfrac{10}{2} = \dfrac{x - 10}{2}

2) Let f(x) = \dfrac{10}{3x-5}

a) Find f(10)

b) Find gf(2)

c) Find gf(-1)

(HIGHER ONLY)

a) Substituting x=10 into f(x), we find,

f(10) = \dfrac{10}{3(10)-5} = \dfrac{10}{25}= \dfrac{2}{5}=0.4

b) Substituting x=2 into f(x), we find,

f(10) = \dfrac{10}{3(2)-5} = \dfrac{10}{1}= 10

c) Substituting x=-1 into f(x), we find,

f(10) = \dfrac{10}{3(-1)-5} = \dfrac{10}{-8}=-\dfrac{5}{4} =1.25

3) Let f(x) = \dfrac{15}{x} and g(x) = 2x - 5

a) Find fg(4)

b) Find gf(-30)

c) Find gf(x)

(HIGHER ONLY)

a) Substituting x=4 into g(x), then substituting the result into f(x),

g(4) = (2\times 4) - 5 = 8 - 5 = 3

fg(4) = f(3) = \dfrac{15}{3} = 5

b) For gf(-30) we must first find f(-30) and then substitute the result into g(x),

f(-30) = \dfrac{15}{-30} = -\dfrac{1}{2}

gf(-30) = g(-\dfrac{1}{2}) = 2(-\dfrac{1}{2}) - 5 = -1 - 5 = -6

c) To find an expression for gf(x), substitute f(x) in for every instance of x in g(x),

gf(x) = 2(f(x)) - 5 = 2\times(\dfrac{15}{x}) - 5 = \dfrac{30}{x} - 5

4) Find the inverse function of f(x) = \dfrac{5}{x-4}

(HIGHER ONLY)

So, we need to write the function as y=\frac{5}{x-4} and rearrange this equation to make x the subject. Then, we will swap every y with an x – and vice versa.

We won’t be able to get x on its own whilst it’s in the denominator, so our first step will be multiplying both sides by (x-4):

y(x-4)=5

Then, divide both sides by y:

x-4=\dfrac{5}{y}

Finally, add 4 to both sides to make x the subject:

x=\dfrac{5}{y}+4

Now, swap each x with a y and vice versa to get

f^{-1}(x)=\dfrac{5}{x}+4

5) Find the inverse function of g(x) = \dfrac{4}{x}+3

(HIGHER ONLY)

So, we need to write the function as g=\frac{4}{x}+3 and rearrange this equation to make x the subject. Then, we will swap every g with an x – and vice versa.

The first step is to subtract 3 from both sides,

g-3=\dfrac{4}{x}+\cancel{3}-\cancel{3}

Then, multiply both sides by x:

x(g-3)=4

Finally, divide both sides by (g-3) to make x the subject:

x=\dfrac{4}{g-3}

Now, simply swap each x with a g and vice versa to get,

g^{-1}(x)=\dfrac{4}{x-3}

### Worksheets and Exam Questions

#### (NEW) Functions (The basics) Exam Style Questions - MME

Level 4-5#### (NEW) Functions (Composite and inverse) Exam Style Questions - MME

Level 6-8#### Functions - Drill Questions

Level 6-8### Videos

#### Functions Q1

GCSE MATHS#### Functions Q2

GCSE MATHS#### Functions Q3

GCSE MATHS### Learning resources you may be interested in

We have a range of learning resources to compliment our website content perfectly. Check them out below.