13.1 Introduction to Functions

Introduction to Functions

Functions are an important part of Cambridge O Level Mathematics D. A function is simply a rule that takes an input, performs an operation, and gives an output.

You can think of a function as a machine:

Input → Function rule → Output

For example, suppose:

f(x) = 2x + 1

If the input is:

x = 3

then:

f(3) = 2(3) + 1

= 7

So the output is:

7


Concept

A function is a rule that maps each input to exactly one output.

For example:

f(x) = 2x + 1

This means:

  • multiply the input by 2
  • then add 1

If:

x = 1

then:

f(1) = 2(1) + 1

= 3

If:

x = 2

then:

f(2) = 2(2) + 1

= 5

If:

x = 3

then:

f(3) = 2(3) + 1

= 7

So the function produces:

1 → 3

2 → 5

3 → 7


What Is an Input?

The input is the value that goes into the function.

It is often represented by:

x

For example:

f(x) = 3x + 2

If:

x = 4

then 4 is the input.


What Is an Output?

The output is the value produced after the function rule is applied.

For:

f(x) = 3x + 2

and:

x = 4

we get:

f(4) = 3(4) + 2

= 14

So:

Input = 4

Output = 14


Function Notation

Functions are commonly written using notation such as:

f(x)

This is read as:

“f of x”

It does not mean:

f × x

Instead:

f(x)

means:

the value of the function f when the input is x


Example

Suppose:

f(x) = 2x + 5

Find:

f(3)

Substitute:

x = 3

So:

f(3) = 2(3) + 5

= 6 + 5

= 11

Answer:

11


Understanding f(x)

Suppose:

f(x) = 4x – 1

Then:

f(1) = 4(1) – 1 = 3

f(2) = 4(2) – 1 = 7

f(5) = 4(5) – 1 = 19

The number inside the brackets tells you what value to substitute for x.


Function Machine

A useful way to understand a function is to imagine a machine.

For:

f(x) = 2x + 1

the machine does:

Multiply by 2 → Add 1

Example:

Input:

4

Multiply by 2:

4 × 2 = 8

Add 1:

8 + 1 = 9

So:

f(4) = 9


Input-Output Table

A function can also be shown in a table.

For:

f(x) = 2x + 1

Each input has exactly one output.


Domain

The domain is the set of possible input values.

For example, suppose:

f(x) = x + 2

and the domain is:

{1, 2, 3, 4}

Then the only input values we use are:

1, 2, 3, 4

So:

Domain = {1, 2, 3, 4}


Range

The range is the set of output values produced by the function.

Using:

f(x) = x + 2

with domain:

{1, 2, 3, 4}

we get:

f(1) = 3

f(2) = 4

f(3) = 5

f(4) = 6

Therefore:

Range = {3, 4, 5, 6}


Domain vs Range

Remember:

Domain = input values

Range = output values

For:

x → f(x)

we can think:

Domain → Function → Range


One Input, One Output

This is one of the most important rules of functions.

A function gives exactly one output for each input.

For example:

x = 3

cannot produce both:

7 and 10

under the same function.

That would not satisfy the definition of a function.


Important A/A* Point

Different inputs can produce the same output.

That is still allowed.

For example:

f(x) = x²

Then:

f(2) = 4

and:

f(-2) = 4

Two different inputs give the same output.

That is still a function because each individual input has only one output.


Example Math

Example 1

Given:

f(x) = 3x + 4

find:

f(5)

Substitute:

x = 5

f(5) = 3(5) + 4

= 15 + 4

= 19

Answer:

19


Example 2

Given:

g(x) = 5x – 7

find:

g(4)

g(4) = 5(4) – 7

= 20 – 7

= 13

Answer:

13


Example 3

Given:

h(x) = x² + 3

find:

h(5)

h(5) = 5² + 3

= 25 + 3

= 28

Answer:

28


Substituting Negative Values

Be especially careful when the input is negative.

Suppose:

f(x) = x² + 2x

Find:

f(-3)

Substitute carefully:

f(-3) = (-3)² + 2(-3)

= 9 – 6

= 3

Answer:

3


Why Brackets Matter

If:

x = -3

write:

(-3)²

not:

-3²

because:

(-3)² = 9

but:

-3² = -9

Brackets help avoid sign errors.


Finding an Unknown Input

Sometimes you are given the output and asked to find the input.

Suppose:

f(x) = 3x + 2

and:

f(x) = 17

Then:

3x + 2 = 17

Subtract 2:

3x = 15

Divide by 3:

x = 5

Answer:

x = 5


Example Math

Given:

g(x) = 4x – 3

and:

g(x) = 21

find x.

Set:

4x – 3 = 21

Add 3:

4x = 24

Divide by 4:

x = 6

Answer:

6


Function Notation with Different Letters

Functions do not always use:

f(x)

You may see:

g(x)

h(x)

p(x)

and others.

For example:

g(x) = x + 4

h(x) = 2x²

These are simply different function names.


Two Functions

You may be given two functions.

For example:

f(x) = 2x + 1

g(x) = x²

Then:

f(3) = 7

and:

g(3) = 9

The same input can give different outputs under different functions because the rules are different.


Mapping Diagrams

Functions can also be represented by arrows.

For example:

1 → 3

2 → 5

3 → 7

4 → 9

This represents:

f(x) = 2x + 1

A mapping diagram helps you see how each input connects to an output.


Is It a Function?

Suppose:

1 → 4

2 → 5

3 → 6

This is a function.

Each input has exactly one output.

But if:

1 → 4

1 → 7

then the input 1 has two different outputs.

Therefore, this relation is not a function.


Formula

A function is usually written in the form:

f(x) = expression involving x

Examples:

f(x) = 2x + 1

f(x) = x² + 3

f(x) = 5 – x

f(x) = 1/x

The expression tells you what operation to perform on the input.


A/A* Exam Technique

When evaluating a function:

Step 1

Write the function.

Example:

f(x) = 3x² – 2

Step 2

Replace every x with the given value.

If:

x = 4

write:

f(4) = 3(4)² – 2

Step 3

Follow the correct order of operations.

= 3(16) – 2

= 48 – 2

= 46

Step 4

Check your substitution.

Make sure every x has been replaced.


Exam Tip

When substituting a negative number, always use brackets.

For example, if:

f(x) = x² + 4x

and:

x = -2

write:

f(-2) = (-2)² + 4(-2)

This greatly reduces sign errors.


Common Mistakes

Mistake 1: Thinking f(x) Means f × x

It does not.

f(x)

means:

the value of function f at x


Mistake 2: Forgetting to Substitute Every x

Suppose:

f(x) = x² + 3x

Find:

f(2)

Correct:

f(2) = 2² + 3(2)

= 4 + 6

= 10

Do not replace only one x.


Mistake 3: Forgetting Brackets for Negative Inputs

Suppose:

f(x) = x²

Find:

f(-4)

Correct:

(-4)² = 16


Mistake 4: Confusing Domain and Range

Remember:

Domain = inputs

Range = outputs


Mistake 5: Thinking Every Relation Is a Function

If one input produces two different outputs, it is not a function.


Question & Answer

1. What is a function?

A rule that maps each input to exactly one output.


2. What does f(x) mean?

The value of function f when the input is x.


3. Does f(x) mean f multiplied by x?

No.


4. What is the domain?

The set of possible input values.


5. What is the range?

The set of output values.


6. If f(x) = 2x + 3, what is f(4)?

f(4) = 2(4) + 3

= 11


7. If f(x) = x², what is f(-3)?

f(-3) = (-3)²

= 9


8. Can two different inputs have the same output?

Yes.

That can still be a function.


9. Can one input have two different outputs?

No.

Then it would not be a function.


10. What does n have to do with functions?

Usually nothing directly. In sequence notation, n often means term number, while in function notation x usually represents the input.


Practice Questions

1

Given:

f(x) = 2x + 5

find:

f(3)

2

Given:

g(x) = 4x – 1

find:

g(6)

3

Given:

h(x) = x² + 2

find:

h(5)

4

Given:

f(x) = x² – 3x

find:

f(-2)

5

Given:

f(x) = 3x + 4

and:

f(x) = 25

find x.

6

Given:

g(x) = 5 – 2x

and:

g(x) = -7

find x.

7

The domain is:

{1, 2, 3}

and:

f(x) = x + 4

Find the range.

8

The domain is:

{-2, -1, 0, 1, 2}

and:

f(x) = x²

Find the range.

9

Is this relation a function?

1 → 3

2 → 5

3 → 7

10

Is this relation a function?

1 → 4

1 → 8

2 → 6


Answers

1

f(3) = 2(3) + 5

= 11


2

g(6) = 4(6) – 1

= 23


3

h(5) = 25 + 2

= 27


4

f(-2) = (-2)² – 3(-2)

= 4 + 6

= 10


5

3x + 4 = 25

3x = 21

x = 7


6

5 – 2x = -7

-2x = -12

x = 6


7

f(1) = 5

f(2) = 6

f(3) = 7

Range:

{5, 6, 7}


8

Outputs:

4, 1, 0, 1, 4

So the range is:

{0, 1, 4}

Remember: repeated values are written only once in a set.


9

Yes.

Each input has exactly one output.


10

No.

The input 1 has two different outputs.


Want to Know More?

After understanding the basics of functions, continue with:

  • Function Notation
  • Domain and Range
  • Evaluating Functions
  • Finding Unknown Inputs
  • Composite Functions
  • Inverse Functions
  • Functions and Graphs
  • Mapping Diagrams
  • One-to-One Functions

These topics build directly on the ideas of input, output and function rules.


Final Exam Reminder

For functions, remember:

Input → Function rule → Output

For example:

f(x) = 2x + 1

Input:

x = 3

Output:

f(3) = 2(3) + 1

= 7

And remember the three key ideas:

Function: each input gives exactly one output.

Domain: possible input values.

Range: output values.

For A/A* level questions, always substitute carefully, use brackets for negative inputs, and check that you understand exactly what the function notation is asking.