AS & A Level Maths · Area 1 · Pure Mathematics 1

Functions

A function is a rule with a domain attached, and most of the marks in this topic come from the domain and range rather than the rule. This page covers what a function is, how to find a range, when a function is one-one, how to find an inverse and a composite, how the graph of an inverse relates to the graph of the function, and how the four transformations of y=f(x) move and stretch a curve.

Not started

Syllabus coverage

  • Understand the terms function, domain, range, one-one function, inverse function and composition of functions
  • Identify the range of a given function in simple cases, and find the composition of two given functions, including the condition that a composite function gf can only be formed when the range of f is within the domain of g
  • Determine whether or not a given function is one-one, and find the inverse of a one-one function in simple cases
  • Illustrate in graphical terms the relation between a one-one function and its inverse, with sketches showing the mirror line y=x
  • Understand and use the transformations of the graph of y=f(x) given by y=f(x)+a, y=f(x+a), y=af(x), y=f(ax) and simple combinations of these
  • Use the terms translation, reflection and stretch when describing a transformation

Part of the AS & A Level Maths syllabus 9709.

A function as a machine: one input, one outputinput xf(x) = 3x + 2multiply by 3, then add 2every input has exactly one outputoutput f(x)f(4) = 3 × 4 + 2 = 14 · f(-1) = 3 × (-1) + 2 = -1The inverse machine undoes the steps in reverse: subtract 2, then divide by 3.
A function as a machine: f(x)=3x+2 takes one input and gives exactly one output, so f(4)=14 and f(−1)=−1. The inverse machine undoes the steps in reverse - subtract 2, then divide by 3.

A function is a rule plus a domain

A function takes each value from a set of allowed inputs and gives back exactly one output. The set of allowed inputs is the domain, and the set of outputs that actually occur is the range. A function is not properly defined until both are known, which is why a question always writes something like f(x)=x2+3 for x≥0: the condition after the rule is part of the function, not a decoration.

The rule 'one output for each input' is what separates a function from a relation. y2=x is not a function of x, because x=4 gives both y=2 and y=−2. On a graph, a function has a single y-value for every x in its domain, so no vertical line through the domain can meet the graph twice. That is the vertical line test.

Notation matters as well. f(x) is the output when the input is x, and f(3) means 'put 3 in'. If f(x)=3x+2 then f(3)=11. The letter x is only a placeholder, so f(t) is the same function written with a different input letter.

TermMeaning
Functiona rule that gives exactly one output for each input
Domainthe set of inputs the function is allowed to take
Rangethe set of outputs the function actually produces
One-oneno two different inputs give the same output
Inversethe function that reverses the rule; it exists only when the function is one-one
Read the domain condition on the same line as the rule before you start any question in this topic. Almost every mark lost here comes from ignoring a condition such as x≥1.

Finding the range

The range is the set of outputs the function really produces. For a straight line it is quick: f(x)=9−2x for x≥1 decreases as x increases, so the largest output is at the smallest input, f(1)=7, and the range is f(x)≤7. A decreasing function swaps the ends round: the left end of the domain gives the biggest output.

For a quadratic you need the turning point, and completing the square finds it. g(x)=x2+6x+5=(x+3)2−4 has least value −4 at x=−3, so on the whole real line the range is g(x)≥−4. If the domain is restricted to x≥−3 the range does not change, because −3 is still allowed. If the domain were x≥0 the turning point would lie outside it, the function would be increasing throughout the domain, and the range would be g(x)≥5.

Some functions have a restricted range for a structural reason rather than because of a turning point. x−2 can never be negative, so its range is f(x)≥0 however generous the domain is. The reciprocal 1x never reaches zero, so its range is every real number except 0.

Restricting a domain can only leave the range the same or make it smaller. If your range for a restricted domain is wider than the range on the whole real line, something has gone wrong.

One-one functions

A function is one-one if no two different inputs produce the same output. f(x)=3x+2 is one-one: a larger input always gives a larger output, so two different inputs can never collide. f(x)=x2 on the whole real line is not one-one, because f(2) and f(−2) are both 4.

On a graph, a one-one function passes the horizontal line test: no horizontal line meets the graph more than once. The parabola y=x2 fails it, while the right-hand branch, y=x2 for x≥0, passes it comfortably.

One-one matters because it is exactly the condition for an inverse function to exist. To reverse a rule, every output must have come from a single input - otherwise 'the input that produced this output' would not name one number. That is why a question that wants the inverse of a quadratic restricts the domain first, and why you must say which branch you are working on.

  • f(x)=2x−7 for all real x: one-one
  • f(x)=x2 for all real x: not one-one
  • f(x)=x2 for x≥0: one-one
  • f(x)=1x for x≠0: one-one

Inverse functions

The inverse f−1 undoes f: if f(a)=b then f−1(b)=a. To find it, write y=f(x), make x the subject, and then relabel y as x. One fact about the domain carries most of the marks: the domain of f−1 is the range of f, and the range of f−1 is the domain of f.

Worked through: f(x)=x2−2x for x≥1. Completing the square gives y=(x−1)2−1, so (x−1)2=y+1. Because x≥1, the quantity x−1 is not negative, so the positive root is the one that applies: x=y+1+1. Relabelling gives f−1(x)=x+1+1, and since the range of f is f(x)≥−1, the domain of f−1 is x≥−1.

The two functions undo each other exactly: f−1(f(x))=x for every x in the domain of f, and f(f−1(x))=x for every x in the domain of f−1. Never read f−1(x) as 1f(x): the −1 is a label meaning 'inverse', not a power.

The square root step is where the domain condition earns its marks. Without x≥1 you could not choose between y+1+1 and −y+1+1, and each would be a correct answer to a different question.

Composite functions

A composite function applies one function and then another. In gf(x), read from the inside outwards: apply f first, then apply g to the result. So gf(x)=g(f(x)), and the function written closest to the x is the one that acts first.

With f(x)=3x−1 and g(x)=x2+2: gf(x)=g(3x−1)=(3x−1)2+2=9x2−6x+3, while fg(x)=f(x2+2)=3(x2+2)−1=3x2+5. Two different answers from the same pair of functions, so the order is part of the question rather than a detail.

gf can only be formed when the range of f fits inside the domain of g, because the outputs of f have to be legal inputs for g. If g is defined for x≥5 and the range of f is f(x)≥1, then outputs of f between 1 and 5 have nowhere to go, and gf does not exist. Checking the two ranges before substituting is worth a mark on its own.

CompositeMeansOrder of work
fg(x)f(g(x))g first, then f
gf(x)g(f(x))f first, then g
ff(x)f(f(x))f applied twice
Composite functions are usually not commutative: fg(x) and gf(x) are different functions unless the question is built to make them the same. Never assume the two are equal.

The graph of a function and its inverse

The graph of the inverse of a one-one function is the reflection of the graph of the function in the line y=x. The reason is arithmetic rather than geometric: if f sends the input a to the output b, then the point (a,b) lies on the graph of f, and f−1 sends b back to a, so (b,a) lies on the graph of f−1. Swapping the two coordinates is exactly what reflection in y=x does.

Two results follow immediately. A point on one graph has a mirror-image partner on the other, so a question that gives you a point on f and asks about f−1 is a one-line question. And the domain of f−1 is the range of f, which is why the inverse graph lives where you would expect: a range f(x)≥−1 becomes a domain x≥−1.

If the graph of a function meets its own inverse, the meeting point lies on the line y=x, because a point that survives the swap of coordinates must have equal coordinates. The whole inverse graph is found by reflecting the curve, so a vertical feature of f becomes a horizontal feature of f−1: a value that f never reaches becomes a value that f−1 is never given.

When a question asks you to sketch f−1 alongside f, draw the line y=x first and then reflect the key points - intercepts, turning points and any end points of the domain. Cambridge mark schemes specifically want the mirror line shown.

Transformations of the graph of y = f(x)

Four transformations cover everything the syllabus asks for, and they are easiest to remember by asking what each one does to the coordinates. Changes made outside the function, y=f(x)+a and y=af(x), act on the output, so they move or stretch the graph vertically. Changes made inside the function, y=f(x+a) and y=f(ax), act on the input, so they move or stretch the graph horizontally.

The counter-intuitive one is y=f(x+a), which slides the graph a units to the left rather than to the right. Test it with a=2: the curve y=f(x+2) takes the value f(3) when x=1, so whatever used to happen at x=3 now happens at x=1. Inside the bracket everything happens earlier, and the shift is the opposite of the sign you can see.

Stretches work the same way round. y=f(2x) squashes the graph horizontally: the value that f used to reach at x=4 is now reached at x=2, so every x-coordinate is halved. A negative a adds a reflection: y=−f(x) is a reflection in the x-axis, and y=f(−x) is a reflection in the y-axis. Combinations are read in the order the notation suggests, so in y=f(x−1)+5 the graph moves 1 unit to the right and then 5 units up.

TransformationWhat it does to the graphWhat happens to the coordinates
y=f(x)+atranslation of a units in the positive y-directionevery y-coordinate increases by a
y=f(x+a)translation of a units in the negative x-directionevery x-coordinate decreases by a
y=af(x)stretch parallel to the y-axis, scale factor aevery y-coordinate is multiplied by a; x-intercepts do not move
y=f(ax)stretch parallel to the x-axis, scale factor 1aevery x-coordinate is divided by a; the y-intercept does not move
Name the transformation the way the mark scheme wants it: 'translation of 4 units in the positive y-direction' or 'stretch parallel to the y-axis with scale factor 3'. 'It moves up' and 'it gets taller' will not score the description mark.

Key terms you must be able to define

Function
A rule that gives exactly one output for each input in its domain.
Domain
The set of values the input of a function is allowed to take.
Range
The set of values the output of a function actually takes.
Image
The output that a particular input is mapped to; the image of a under f is f(a).
One-one function
A function in which different inputs always give different outputs, so no horizontal line meets its graph twice.
Inverse function
The function f−1 that reverses f, so that f−1(f(x))=x. It exists only when f is one-one.
Composite function
A function formed by applying one function to the output of another, written gf(x)=g(f(x)).
Composite condition
gf can be formed only when the range of f lies inside the domain of g.
Mapping
The rule that sends each element of the domain to its image. A function is a one-one or many-to-one mapping, never one-to-many.
Vertical line test
A graph is the graph of a function if no vertical line meets it more than once.
Horizontal line test
A graph is the graph of a one-one function if no horizontal line meets it more than once.
Translation
A transformation that slides a graph without turning or stretching it. y=f(x)+a and y=f(x+a) are translations.
Reflection
A transformation that mirrors a graph in a line. y=−f(x) reflects in the x-axis and y=f(−x) reflects in the y-axis.
Stretch
A transformation that scales a graph in one direction only. y=af(x) stretches parallel to the y-axis and y=f(ax) stretches parallel to the x-axis.
Mirror line
The line y=x, in which the graph of a function and the graph of its inverse are reflections of each other.
Restricted domain
A domain that is deliberately limited, such as x≥1, usually so that the function becomes one-one and can be inverted.

Applied

At AS & A Level the marks sit in the setup: choosing the model, stating the variable and writing the equation before any working. These show the shape of a full-mark answer, then you do the algebra yourself.

Range on a restricted domain

The function f is defined by f(x)=4x−3 for 0≤x≤5. The rule increases, so the smallest output is at the left end of the domain and the largest at the right end: f(0)=−3 and f(5)=17, so the range is −3≤f(x)≤17.

Inverse of a linear function

f(x)=5−2x for all real x. Write y=5−2x, so 2x=5−y and x=5−y2. Relabelling gives f−1(x)=5−x2. Check it: f(3)=−1, and f−1(−1)=3, so the inverse really does undo the function.

A composite in one direction only

f(x)=x2 for x≥0, and g(x)=x+4 for all real x. Then gf(x)=g(x2)=x2+4, which is fine because every output of f is at least 0. But fg(x)=f(x+4)=(x+4)2 is defined only for x≥−4, because f will not accept an input below 0.

Transforming a known point

The curve y=f(x) has a minimum at (3,−2). For y=2f(x) every y-coordinate doubles, so the minimum becomes (3,−4). For y=f(2x) every x-coordinate halves, so it becomes (1.5,−2). For y=f(x−1)+5 it becomes (4,3).

Reflecting to get the inverse

f(x)=2x+1 passes through (0,1) and (2,5). Its inverse is f−1(x)=x−12, which passes through (1,0) and (5,2) - the same two points with the coordinates swapped, which is what reflection in y=x does.

Flashcards

Click a card to flip it. Mark honestly — the tracker uses this.

Q1What are the domain and the range of a function?
The domain is the set of allowed inputs; the range is the set of outputs that actually occur.
Q2How do you decide whether a graph is the graph of a one-one function?
Use the horizontal line test: if any horizontal line meets the graph more than once, the function is not one-one.
Q3Why does an inverse function only exist for a one-one function?
Reversing the rule needs each output to have come from one input. If two inputs share an output, the reverse rule would not give a single answer.
Q4What is the domain of f−1?
The range of f. The range of f−1 is the domain of f.
Q5Find the inverse of f(x)=5−2x.
f−1(x)=5−x2. Write y=5−2x, rearrange to x=5−y2, then relabel.
Q6What does gf(x) mean?
g(f(x)): apply f first, then apply g to the result.
Q7When can the composite gf be formed?
Only when the range of f lies inside the domain of g, so that every output of f is a legal input for g.
Q8Is fg(x) the same as gf(x)?
Usually not. Composite functions are not commutative unless the question is built that way.
Q9How is the graph of f−1 related to the graph of f?
It is the reflection of the graph of f in the line y=x. Each point (a,b) becomes (b,a).
Q10Describe the transformation y=f(x)+a.
A translation of a units in the positive y-direction. Every y-coordinate increases by a.
Q11Describe the transformation y=f(x+a).
A translation of a units in the negative x-direction. Inside the bracket, the shift is the opposite of the sign.
Q12Describe the transformation y=af(x).
A stretch parallel to the y-axis with scale factor a. Every y-coordinate is multiplied by a, and x-intercepts stay put.
Q13Describe the transformation y=f(ax).
A stretch parallel to the x-axis with scale factor 1a. Every x-coordinate is divided by a, and the y-intercept stays put.
Q14What is the range of g(x)=x2+6x+5?
g(x)≥−4, because g(x)=(x+3)2−4 and a square is never negative.
Q15A curve y=f(x) has a minimum at (3,−2). Where is the minimum of y=f(x−1)+5?
At (4,3): the graph moves 1 unit to the right and 5 units up.
0 of 15 marked as known

Exam-style questions

8 questions, 31 marks. Write your answer, then reveal the mark scheme and tick each point you actually made. Answering honestly here is what makes the rest of the site useful.

StateAO13 marks
The function f is defined by f(x)=9−2x for x≥1. State the range of f.
Write a number, a fraction such as 3/4, or an expression such as 3x+2.

Mark scheme — tick each point you actually made

  • B1
  • B1
  • B1the range is f(x)≤7not checked yet
Examiner tip: The domain starts at 1, so 1 is the input that matters. A decreasing function gives its biggest output at its smallest input, which is why the range runs downwards from 7.
CalculateAO24 marks
The function g is defined by g(x)=x2+6x+5 for x≥−3. Calculate the range of g.
Write a number, a fraction such as 3/4, or an expression such as 3x+2.

Mark scheme — tick each point you actually made

  • M1
  • B1
  • B1
  • A1the range is g(x)≥−4not checked yet
Examiner tip: The turning point at x=−3 is just inside the domain, so the range starts there. Had the domain been x≥0, the turning point would have been excluded and the range would have started at g(0)=5.
CalculateAO25 marks
The function f is defined by f(x)=x2−2x for x≥1. Calculate f−1(x), giving your answer in the form x+a+b.
Write a number, a fraction such as 3/4, or an expression such as 3x+2.

Mark scheme — tick each point you actually made

  • M1
  • M1
  • B1
  • M1
  • A1f−1(x)=x+1+1not checked yet
Examiner tip: Completing the square is what makes the inverse possible here: it turns the quadratic into a single squared bracket, which can then be undone. The domain condition is the reason the root is positive rather than negative.
SketchAO24 marks
The function f is defined by f(x)=x2−2x for x≥1, and its inverse is f−1(x)=x+1+1. Sketch the graphs of y=f(x) and y=f−1(x) on the same axes, showing the mirror line y=x.

Mark scheme — tick each point you actually made

  • B1
  • B1
  • B1
  • B1
Examiner tip: Draw the mirror line first and then reflect the key points across it: the turning point (1,−1) becomes the starting point (−1,1), and the intercept (2,0) becomes (0,2). A sketch with no y=x on it loses the mark Cambridge sets aside for the mirror line.
CalculateAO25 marks
The functions f and g are defined for all real x by f(x)=3x−1 and g(x)=x2+2. Calculate fg(2) and gf(x).
Write a number, a fraction such as 3/4, or an expression such as 3x+2.

Mark scheme — tick each point you actually made

  • M1
  • M1
  • A1fg(2)=17not checked yet
  • M1
  • A1gf(x)=9x2−6x+3not checked yet
Examiner tip: The two composites are worked in opposite directions, so read the notation carefully each time: fg(2) applies g first, and gf(x) applies f first. The answer to the second is not 3x2+5, which is fg(x).
StateAO23 marks
The curve y=f(x) passes through the point (3,−2). State the coordinates of the point to which this point is mapped on the curve y=f(x−1)+5.
Write a number, a fraction such as 3/4, or an expression such as 3x+2.

Mark scheme — tick each point you actually made

  • B1
  • B1
  • B1(4,3)not checked yet
Examiner tip: Take the two changes one at a time. The inside change moves the x-coordinate in the opposite direction to its sign, and the outside change moves the y-coordinate in the direction of its sign.
ExplainAO23 marks
The function f is defined by f(x)=x2+1 for all real x, and the function g is defined by g(x)=x−5 for x≥5. Explain why the composite function gf cannot be formed.

Mark scheme — tick each point you actually made

  • B1
  • B1
  • B1
Examiner tip: The explanation needs both sets named. Say what the range of the inner function is, say what the domain of the outer function is, and then state that the first does not fit inside the second.
DetermineAO24 marks
The function h is defined by h(x)=12x−1 for x>12. Determine h−1(x).
Write a number, a fraction such as 3/4, or an expression such as 3x+2.

Mark scheme — tick each point you actually made

  • M1
  • M1
  • B1
  • A1h−1(x)=x+12xnot checked yet
Examiner tip: Taking the reciprocal of both sides is the fastest first move with a function of this shape, because it lifts 2x−1 out of the denominator in one step.

Exam technique for this topic

  • Write the domain down first and refer to it at every step. A question that says 'for x≥1' is telling you which square root to take, what the range of the inverse is, and often where a composite stops being valid.
  • For a range question, decide first whether the function is increasing, decreasing or turning. Straight lines are decided by their gradient, quadratics by completing the square, and a restricted domain may cut the turning point out altogether.
  • Answer an inverse question in three moves: write y=f(x), make x the subject, relabel. State the domain of f−1 even when the question does not ask for it - it is often the next part of the question, and it is the part students lose.
  • Before substituting into a composite, check that the range of the inner function sits inside the domain of the outer one. When the question asks you to explain why a composite cannot be formed, the marks are for naming both the range of the inner function and the domain of the outer one.
  • Describe a transformation with its type, its direction and its size: 'translation of 3 units in the negative x-direction' or 'stretch parallel to the x-axis with scale factor 12'. Test a point from the original graph to decide the direction of a horizontal shift, because the sign inside the bracket is the opposite of the shift you see.

Why students lose marks here

A student wrotef(x)=x2 for all real x, so f−1(x)=x.
Why it loses marksOn the whole real line f is not one-one, so it has no inverse at all. Restricting the domain to x≥0 is what makes the inverse exist, and that restriction must be stated.
The answer that scoresFor f(x)=x2 with domain x≥0, f−1(x)=x with domain x≥0.
A student wrotegf(x) means f(g(x)).
Why it loses marksThe function nearest the x acts first. gf(x) applies f first and then g, which is the opposite of what the letters look like in order.
The answer that scoresWith f(x)=3x−1 and g(x)=x2+2: gf(x)=g(3x−1)=9x2−6x+3, while fg(x)=f(x2+2)=3x2+5.
A student wrotef(x)=9−2x for x≥1, so the range is f(x)≥7.
Why it loses marksThe rule decreases as x increases, so the smallest input gives the largest output. The range runs downwards from 7, not upwards.
The answer that scoresf(1)=7 is the largest output, so the range is f(x)≤7.
A student wrotey=f(x+3) moves the graph 3 units to the right.
Why it loses marksA change inside the bracket acts on the input and does the opposite of what the sign suggests. The value f(4) is now reached at x=1, so the graph has moved to the left.
The answer that scoresy=f(x+3) is a translation of 3 units in the negative x-direction.
A student wrotey=f(2x) doubles every x-coordinate.
Why it loses marksIt is the other way round: f(2x) reaches a given height twice as quickly, so each x-coordinate is halved. y=2f(x) is the one that doubles, and it doubles y-coordinates.
The answer that scoresy=f(2x) is a stretch parallel to the x-axis with scale factor 12.