Chapter 30 – Functions

← Chapter 29All chaptersChapter 31 →
Cambridge IGCSE & O Level Mathematics
Chapter 30

Functions

Learn how functions map inputs to outputs, how domain and range describe allowable values, how inverse functions undo a function, and how composite functions apply two functions in sequence.

By the end of this chapter, you should be able to

  • use function notation such as \(f(x)\) and evaluate functions;
  • solve equations involving a function and substitute expressions into a function;
  • identify the domain and range of a function, including restricted domains;
  • interpret one-to-one and many-to-one mapping diagrams;
  • find and use inverse functions \(f^{-1}(x)\);
  • form and evaluate composite functions such as \(gf(x)=g(f(x))\).
1

Subtopic 1

Function notation

A function is a rule that takes an input and produces an output. The mapping notation \(f:x\mapsto 2x-3\) means that function \(f\) maps \(x\) onto \(2x-3\). The same rule is commonly written as \(f(x)=2x-3\).

What the notation means

  • \(f(5)\) means substitute \(x=5\) into the rule for \(f\).
  • \(f(a)\) means substitute \(a\) wherever \(x\) appears.
  • \(f(x+4)\) means substitute the entire expression \(x+4\) in place of \(x\).
  • Different letters such as \(f\), \(g\) and \(h\) can name different functions.
Worked example · Easy

Evaluate a function

Given \(f(x)=3(x-2)\), find \(f(6)\).

\[f(6)=3(6-2)=3\times4=\boxed{12}\]
Worked example · Medium

Solve a function equation

Given \(f(x)=3(x-2)\), solve \(f(x)=6\).

\[3(x-2)=6\]\[x-2=2\]\[\boxed{x=4}\]
Worked example · Medium

Substitute an expression

Given \(f(x)=3(x-2)\), find and simplify \(f(x+4)\).

Replace every \(x\) in the rule by \(x+4\):

\[f(x+4)=3((x+4)-2)=3(x+2)=\boxed{3x+6}\]
Worked example · Exam-style

Compare two functions

Let \(f(x)=2x-3\) and \(g(x)=7-2x\). Solve \(f(x)=g(x)\).

\[2x-3=7-2x\]\[4x=10\]\[\boxed{x=2.5}\]
Common mistake

When substituting an expression, use brackets. For example, if \(h(x)=x^2-5\), then \(h(2x)=(2x)^2-5=4x^2-5\), not \(2x^2-5\).

Exam method

Evaluate a function by substituting the entire input. Parentheses matter especially for negative numbers and algebraic expressions.

Worked example 1 · Foundation

For \(f(x)=3x^2-2x\), find \(f(-2)\).

\(f(-2)=3(-2)^2-2(-2)=12+4=16\).

Worked example 2 · Exam-style

Given \(f(x)=2x-5\), find and simplify \(f(x+3)\).

\(f(x+3)=2(x+3)-5=2x+1\).

Try it yourself — from foundation to exam-style

Question 1: If \(f(x)=4x-7\), find \(f(3)\).

Show Answer

\(4(3)-7=5\).

Question 2: If \(g(x)=x^2+1\), find \(g(-3)\).

Show Answer

\((-3)^2+1=10\).

Question 3: If \(f(x)=5x+2\), solve \(f(x)=27\).

Show Answer

\(5x+2=27\), so \(x=5\).

Question 4: For \(h(x)=x^2-2x\), simplify \(h(x+1)\).

Show Answer

\((x+1)^2-2(x+1)=x^2-1\).

2

Subtopic 2

Domain and range

The domain is the set of permitted input values. The range is the set of output values produced by those inputs. Mapping diagrams show this input-output relationship clearly.

Textbook mapping diagram showing g of x equals 5x plus 2 for a finite domain
Textbook figure: a one-to-one mapping. Each input in the domain maps to a different output in the range.
Worked example · Easy

Find a range from a domain

For \(g(x)=5x+2\) and domain \(\{-1,0,1,2,3\}\), find the range.

Substitute each input:

\(g(-1)=-3\), \(g(0)=2\), \(g(1)=7\), \(g(2)=12\), \(g(3)=17\).

Range: \(\boxed{\{-3,2,7,12,17\}}\).

Textbook mapping diagram showing h of x equals 2x squared plus 3, with pairs of inputs mapping to the same output
Textbook figure: a many-to-one mapping. Different inputs can map to the same output. A function may be one-to-one or many-to-one, but not one-to-many.

Restricted domains

Some rules exclude certain inputs. For example, in \(g(x)=\frac{2}{x-4}\), the value \(x=4\) is not allowed because it would make the denominator zero.

Worked example · Medium

Restricted domain

For \(g(x)=\frac{2}{x-4}\), explain why \(4\) cannot be in the domain.

If \(x=4\), then the denominator is \(4-4=0\). Division by zero is undefined, so \(\boxed{x\ne4}\).

Worked example · Exam-style

Many-to-one function

For \(h(x)=2x^2+3\) and domain \(\{-5,-2,0,2,5\}\), find the range.

\(h(-5)=53\), \(h(-2)=11\), \(h(0)=3\), \(h(2)=11\), \(h(5)=53\).

Repeated outputs are listed once in the range:

\(\boxed{\{3,11,53\}}\).

Exam method

The domain is the set of allowed inputs. The range is the set of actual outputs. A finite domain must be evaluated point by point.

Worked example 1 · Foundation

Find the range of \(f(x)=2x^2-1\) on \(\{-2,-1,0,1,3\}\).

Outputs are 7, 1, -1, 1, 17. The range is \(\{-1,1,7,17\}\) (no repeats).

Worked example 2 · Exam-style

Find the range of \(f(x)=(x-2)^2+3\) for real \(x\).

A squared quantity cannot be negative; smallest output is 3 at \(x=2\). Range is \(f(x)\ge3\).

Try it yourself — from foundation to exam-style

Question 1: For domain \(\{-1,0,2\}\), find range of \(f(x)=x+4\).

Show Answer

Values 3, 4 and 6; range \(\{3,4,6\}\).

Question 2: Give the real domain of \(f(x)=1/(x-5)\).

Show Answer

All real numbers except \(x=5\), which makes the denominator zero.

Question 3: Find range of \(f(x)=x^2\) for real x.

Show Answer

\(f(x)\ge 0\), since squares are non-negative.

Question 4: For \(f(x)=x^2\) with \(1\le x\le 4\), find range.

Show Answer

On this non-negative interval, values increase from \(1^2=1\) to \(4^2=16\): \(1\le f(x)\le16\).

3

Subtopic 3

Inverse functions

An inverse function reverses the action of the original function. If \(f\) maps an input to an output, then \(f^{-1}\) maps that output back to the original input.

How to find \(f^{-1}(x)\)

  1. Write \(y\) in place of \(f(x)\).
  2. Rearrange the equation to make \(x\) the subject.
  3. Replace the rearranged \(y\) by \(x\), and write the result as \(f^{-1}(x)\).
Worked example · Easy

Find an inverse

Given \(f(x)=3x-5\), find \(f^{-1}(x)\).

\[y=3x-5\]\[y+5=3x\]\[x=\frac{y+5}{3}\]

Swap the role of the input variable:

\[\boxed{f^{-1}(x)=\frac{x+5}{3}}\]
Worked example · Medium

Use an inverse

For the function above, find \(f^{-1}(7)\).

\[f^{-1}(7)=\frac{7+5}{3}=\boxed{4}\]

This is equivalent to finding the original input that gives \(f(x)=7\).

Textbook mapping diagrams showing a function and the arrows reversed for its inverse
Textbook figure: the range of a function becomes the domain of its inverse. The arrows reverse direction, returning each value to its original input.
Worked example · Exam-style

Inverse of a reciprocal function

Given \(h(x)=\frac{12}{x+1}\), find \(h^{-1}(x)\).

\[y=\frac{12}{x+1}\]\[y(x+1)=12\]\[yx+y=12\]\[yx=12-y\]\[x=\frac{12-y}{y}=\frac{12}{y}-1\]

Therefore:

\[\boxed{h^{-1}(x)=\frac{12}{x}-1}\]

Inverse functions and many-to-one rules

A true inverse must give only one output for each input. For functions such as \(h(x)=2x^2+3\), the original domain must be restricted if we want an inverse function. With the non-negative branch, the inverse is

\[h^{-1}(x)=\sqrt{\frac{x-3}{2}}\]

and its domain is \(x\ge3\).

Check

Substitute a value into the original function, then pass the result through the inverse. You should recover the starting value.

Exam method

An inverse reverses a one-to-one mapping. Solve y=f(x) for x, then swap the labels. State domain restrictions where necessary.

Worked example 1 · Foundation

Find \(f^{-1}(x)\) for \(f(x)=5x-3\).

Set \(y=5x-3\), rearrange \(x=(y+3)/5\), hence \(f^{-1}(x)=(x+3)/5\).

Worked example 2 · Exam-style

Find the inverse of \(f(x)=(x-1)^2\) with \(x\ge1\).

\(y=(x-1)^2\); restricted \(x-1\ge0\), so \(x=1+\sqrt y\). Thus \(f^{-1}(x)=1+\sqrt x\), with \(x\ge0\).

Try it yourself — from foundation to exam-style

Question 1: Find inverse of \(f(x)=2x+7\).

Show Answer

\(y=2x+7\Rightarrow x=(y-7)/2\). Thus \(f^{-1}(x)=(x-7)/2\).

Question 2: Find inverse of \(f(x)=x/3-4\).

Show Answer

\(y=x/3-4\Rightarrow x=3(y+4)\), so \(f^{-1}(x)=3x+12\).

Question 3: Explain why \(f(x)=x^2\) has no inverse function over all real x.

Show Answer

Inputs 2 and -2 both give 4: not one-to-one. Restrict the domain, for example \(x\ge0\).

Question 4: Check inverse of \(f(x)=4x-1\) using \(f^{-1}(9)\).

Show Answer

\(f^{-1}(x)=(x+1)/4\), so \(f^{-1}(9)=10/4=2.5\), and \(f(2.5)=9\).

4

Subtopic 4

Composite functions

Composite functions apply one function and then another. The notation \(gf(x)\) means \(g(f(x))\): apply \(f\) first, then apply \(g\) to the result.

Textbook diagram showing x mapped through f to f of x and then through g to gf of x
Textbook figure: \(x\) first passes through \(f\), producing \(f(x)\), and that result then passes through \(g\), producing \(gf(x)\).

Order matters

In general, \(gf(x)\neq fg(x)\). Read from right to left: in \(gf(x)\), do \(f\) first.

Worked example · Easy

Evaluate a composite function

Let \(f(x)=2x+1\) and \(g(x)=3x-2\). Find \(gf(5)\).

First:

\[f(5)=2(5)+1=11\]

Then:

\[g(11)=3(11)-2=\boxed{31}\]
Worked example · Medium

Find a composite rule

For the same functions, find \(gf(x)\).

\[gf(x)=g(2x+1)\]\[=3(2x+1)-2\]\[=6x+3-2\]\[\boxed{gf(x)=6x+1}\]
Worked example · Medium

Compare \(gf\) and \(fg\)

For \(f(x)=2x+1\) and \(g(x)=3x-2\), find \(fg(x)\).

\[fg(x)=f(3x-2)\]\[=2(3x-2)+1\]\[=6x-4+1\]\[\boxed{fg(x)=6x-3}\]

So \(gf(x)\) and \(fg(x)\) are different.

Worked example · Exam-style

Composite function with a quadratic

Let \(g(x)=3(x+5)\) and \(h(x)=x^2\). Find \(hg(x)\), then solve \(hg(x)=36\).

\[hg(x)=h(3(x+5))=[3(x+5)]^2=9(x+5)^2\]

Now solve:

\[9(x+5)^2=36\]\[(x+5)^2=4\]\[x+5=\pm2\]\[\boxed{x=-3\text{ or }x=-7}\]
Exam method

In \(gf(x)=g(f(x))\), apply f first. The order can change the result, so always write the inner calculation.

Worked example 1 · Foundation

If \(f(x)=x+2\) and \(g(x)=3x\), find \(gf(x)\).

\(g(f(x))=g(x+2)=3(x+2)=3x+6\).

Worked example 2 · Exam-style

If \(f(x)=x^2-1\) and \(g(x)=2x+3\), find \(fg(x)\).

\(f(g(x))=(2x+3)^2-1=4x^2+12x+8\).

Try it yourself — from foundation to exam-style

Question 1: With \(f(x)=x+3\), \(g(x)=2x\), find \(gf(4)\).

Show Answer

First \(f(4)=7\), then \(g(7)=14\).

Question 2: With same f and g, find \(fg(4)\).

Show Answer

First \(g(4)=8\), then \(f(8)=11\).

Question 3: With \(f(x)=x^2\), \(g(x)=x-1\), find \(gf(x)\).

Show Answer

\(g(f(x))=g(x^2)=x^2-1\).

Question 4: For \(f(x)=2x+1\), \(g(x)=3-x\), solve \(gf(x)=0\).

Show Answer

\(g(f(x))=3-(2x+1)=2-2x\). Set zero: \(x=1\).

Chapter 30 practice

Begin with function notation and mapping, then move through inverses and composite functions. Keep answers hidden until you have attempted each question.

A. Function notation

1Evaluate[2 marks]

Given \(f(x)=4x+3\), find \(f(2)\).

Show Answer
\[f(2)=4(2)+3=\boxed{11}\]
2Negative input[2 marks]

Given \(g(x)=6-2x\), find \(g(-3)\).

Show Answer
\[g(-3)=6-2(-3)=6+6=\boxed{12}\]
3Substitute an expression[3 marks]

Given \(h(x)=x^2-5\), find and simplify \(h(2x)\).

Show Answer
\[h(2x)=(2x)^2-5=\boxed{4x^2-5}\]
4Solve using function notation[3 marks]

Given \(f(x)=5(2x+3)\), solve \(f(x)=0\).

Show Answer
\[5(2x+3)=0\Rightarrow2x+3=0\Rightarrow\boxed{x=-\frac32}\]

B. Domain and range

5Find the range[4 marks]

For \(f(x)=3(x+2)\) and domain \(\{0,1,2,3\}\), find the range.

Show Answer

Outputs: 6, 9, 12, 15.

Range: \(\boxed{\{6,9,12,15\}}\).

6Excluded input[2 marks]

For \(g(x)=\frac2{x-4}\), which value must be excluded from the domain?

Show Answer

\(x=4\), because it makes the denominator zero. So \(\boxed{x\ne4}\).

7Many-to-one[3 marks]

For \(h(x)=x^2\) and domain \(\{-2,-1,0,1,2\}\), find the range.

Show Answer

Outputs: 4, 1, 0, 1, 4.

Range: \(\boxed{\{0,1,4\}}\).

C. Inverse functions

8Find an inverse[4 marks]

Given \(f(x)=4x+3\), find \(f^{-1}(x)\).

Show Answer
\[y=4x+3\Rightarrow x=\frac{y-3}{4}\]

Therefore \(\boxed{f^{-1}(x)=\frac{x-3}{4}}\).

9Use the inverse[2 marks]

Using your answer to Question 8, find \(f^{-1}(11)\).

Show Answer
\[f^{-1}(11)=\frac{11-3}{4}=\boxed{2}\]
10Inverse with negative coefficient[4 marks]

Given \(g(x)=6-2x\), find \(g^{-1}(x)\).

Show Answer
\[y=6-2x\Rightarrow2x=6-y\Rightarrow x=\frac{6-y}{2}\]

So \(\boxed{g^{-1}(x)=\frac{6-x}{2}}\).

11Reciprocal inverse[5 marks]

Given \(h(x)=\frac{12}{x+1}\), find \(h^{-1}(x)\).

Show Answer
\[y=\frac{12}{x+1}\Rightarrow y(x+1)=12\Rightarrow x=\frac{12-y}{y}\]

Thus \(\boxed{h^{-1}(x)=\frac{12}{x}-1}\).

12Check an inverse[3 marks]

If \(f(x)=3x-5\) and \(f^{-1}(x)=\frac{x+5}{3}\), show that \(f^{-1}(f(4))=4\).

Show Answer
\[f(4)=12-5=7\]\[f^{-1}(7)=\frac{7+5}{3}=\boxed{4}\]

D. Composite functions

13Evaluate \(gf\)[3 marks]

Let \(f(x)=3x+4\) and \(g(x)=(x+2)^2\). Find \(gf(2)\).

Show Answer
\[f(2)=10\]\[g(10)=(10+2)^2=\boxed{144}\]
14Evaluate \(fg\)[3 marks]

Using the same functions, find \(fg(2)\).

Show Answer
\[g(2)=(2+2)^2=16\]\[f(16)=3(16)+4=\boxed{52}\]
15Find a composite rule[4 marks]

Let \(f(x)=2x+1\) and \(g(x)=3x+2\). Find and simplify \(gf(x)\).

Show Answer
\[gf(x)=g(2x+1)=3(2x+1)+2=\boxed{6x+5}\]
16Compare orders[4 marks]

For the functions in Question 15, find \(fg(x)\).

Show Answer
\[fg(x)=f(3x+2)=2(3x+2)+1=\boxed{6x+5}\]

In this particular case they happen to be equal, but this is not true in general.

17Composite equation[5 marks]

Let \(f(x)=2x-1\) and \(g(x)=x^2+4\). Solve \(gf(x)=13\).

Show Answer
\[gf(x)=(2x-1)^2+4\]\[(2x-1)^2+4=13\]\[(2x-1)^2=9\]\[2x-1=\pm3\]

So \(\boxed{x=2\text{ or }x=-1}\).

18Inverse and composite reasoning[6 marks]

Given \(f(x)=5x-7\) and \(g(x)=2x+3\), find \(f^{-1}(x)\) and hence simplify \(f^{-1}g(x)\).

Show Answer

First find the inverse:

\[y=5x-7\Rightarrow x=\frac{y+7}{5}\]

So \(f^{-1}(x)=\frac{x+7}{5}\).

Now substitute \(g(x)=2x+3\):

\[f^{-1}g(x)=\frac{(2x+3)+7}{5}=\frac{2x+10}{5}=\boxed{\frac{2x}{5}+2}\]

Chapter 30 high-grade checklist

Notation

I can evaluate \(f(a)\), solve equations such as \(f(x)=k\), and substitute expressions such as \(f(2x-1)\).

Domain and range

I distinguish inputs from outputs and spot excluded values such as a zero denominator.

Mapping diagrams

I understand one-to-one and many-to-one mappings, and know that a function cannot be one-to-many.

Inverse functions

I rearrange carefully and can check the inverse by applying it to an output of the original function.

Composite functions

I read \(gf(x)\) as \(g(f(x))\) and apply the right-hand function first.

Exam checking

I use brackets when substituting expressions and simplify only after the substitution is complete.

Chapter structure and figures: these notes follow the four Chapter 30 subtopics in the supplied Mathematics textbook. The mapping and composite-function figures displayed above are cropped directly from the supplied textbook, as requested; the surrounding explanations, worked examples and practice questions are written for IGCSE360.
← Chapter 29All chaptersChapter 31 →