πŸ‡¬πŸ‡§ English
πŸ‡¨πŸ‡Ώ Czech
πŸ‡ΈπŸ‡° Slovak

Functions

11 sections Β· Mathematics Level 2

1

What is a Function?

Function is like a machine that takes a number and transforms it into a different number.

Number x
⟢
Function machine
⟢
Different Number y

This machine works in a predictable manner. Try inserting numbers into the box and find the pattern.

Number
⟢
Function machine
⟢
Different Number ?

Press Enter to save to history

What is the pattern? Choose one:

2

The Function Notation

Great! We have found the generalisation of the rule.

Input x
⟢ f ⟢
Output 2x

Where x is the input number and f is the function (the machine).

Formally, we denote functions as

\( f(x) = y \)

So for our case above, y = 2x

\( f(x) = 2x \)

Function f acts on x and transforms it into 2x, which is the output y.

Quick comprehension test

Here are 4 different functions. Based on your input and output, try to guess the correct function for the machine.

Input
⟢ f ⟢
Output ?

Press Enter to save to history

Which function describes this machine?

3

Function as a Graph

To visualise functions, we can write down all the possible input numbers on the horizontal axis.

Then we can write down the possible output numbers on the vertical axis.

Now, we can draw a dot for each input–output pair.

Finally, we can connect the dots to see the shape of the function.

Try to figure out what function this graph represents.

4

Drawing a function graph

Let's draw the graph of the function f(x) = 2x βˆ’ 1.

On the right you can see an empty graph with the range of βˆ’3 to 3 on the x axis.

Click on the graph intersections to plot the points (x, f(x)):

x βˆ’3 βˆ’2 βˆ’1 0 1 2 3
y

Try any value:

f( ) = ?
5

Drawing a function graph II

Let's draw the graph of the function f(x) = (x βˆ’ 1)Β².

On the right you can see an empty graph with the range of βˆ’2 to 4 on the x axis.

Click on the graph intersections to plot the points (x, f(x)):

x βˆ’2 βˆ’1 0 1 2 3 4
y

No more help!

6

Shape recognition

Try to guess the expression based on the graph shape.

7

Expression recognition

Try to guess the graph based on the expression.

f(x) =
8

Functions in the eyes of a mathematician

So far, we thought of functions either as a machine

Input x
⟢
Function machine
⟢
Output y

or as a graph

f(x) = xΒ²

But those are just two useful representations of a deeper underlying concept.

What do you think is the essential property of a function?

The formal definition

A function is a correspondence that assigns exactly one output to every input in its domain.

Using more casual jargon

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

Here are some examples

1 2 3 A B C
Function βœ“
1 2 3 A B C
Not a function βœ—
1 2 3 A B C
Function βœ“

Let's test your understanding of the definition.

9

Open and closed sets

In mathematics, we use exact terminology to not just sound smart!

We use it so our definitions, claims and proofs are always clear and never open to interpretation.

(a, b) β€” open set of all real numbers with values between a and b, not including a and b themselves.

On the graph, we denote the endpoints a and b with open circles to indicate that they are not included in the set.

(1, 3)
a 1
b 3

[a, b] β€” closed set of all real numbers with values between a and b, including a and b themselves.

On the graph, we denote the endpoints a and b with closed circles to indicate that they are included in the set.

[1, 3]
a 1
b 3

A set can also be half-open, such as [a, b) which includes a but not b, or (a, b] which includes b but not a.

We also use a shorthand notation for some sets.

ℝ the set of all real numbers
ℝ = (-∞, ∞) another way to denote the set of all real numbers using interval notation

Some variations:

ℝ⁺ the set of all positive real numbers (0, ∞)
ℝ⁻ the set of all negative real numbers (-∞, 0)
ℝ+0 the set of all non-negative real numbers [0, ∞)

Let's test your understanding of interval notation.

10

Domain, codomain and image

Domain β€” the set of all possible inputs for a function

Domain a b c 1 2 3 4 5

Codomain β€” the set of all considered outputs for a function

Codomain a b c 1 2 3 4 5

Note: Not every element of a codomain must have a corresponding element in the domain!

Image β€” outputs actually produced by a function

Sometimes, image is also called "range", but it represents the same thing.

Image a b c 1 2 3 4 5

You can also visualise sets as areas.

Domain Codomain Image

You can see that the image is a subset of the codomain, and the function doesn't produce some of the outputs in the codomain at all.

A function should not produce values outside of the codomain. If it does, then we say that the function is not well-defined.

Domain Codomain Not well- defined output
1 2 3 -2 -1 0 1 2

A function f: XY is a mapping that assigns to every element xX exactly one element yY.

What do you think the domain is?

The image of a function Im(f) is:

(select all that apply)

Formally, we write

Im(f) = {f(x) : xX}

You now understand functions as a true mathematician!

11

Back to graphs

Now, since you already understand functions in an abstract way, let's go back to where we started and check what it means.

Let's consider a trivial function

f: ℝ → ℝ
with the rule f(x) = x

What do you think the image of the function is?

Note that we have chosen the largest domain and codomain for which the function is well defined.

If we defined the function

f: ℝ → ℝ+ with f(x) = x

then half of the domain elements have an image outside of the codomain!

This is not a well-defined function!

A common task a student might get is to find the largest domain X and image Im(f) for a given codomain which the function rule f(x) = y allows.

12

When ℝ is not enough

So far, it might seem like we can avoid all of our problems by declaring the domain and codomain to be the set of all real numbers ℝ.

Let's consider the function f(x) = √x with ℝ as the codomain.

What is the maximal domain for which the function is well defined?

This is the situation where the domain cannot be the same as the codomain, because some inputs land outside of the codomain.

f(x) = √x Domain Codomain Outside codomain

What do we need to do so that the function f(x) = √x is well defined with the domain ℝ?

Image f(x) = √x Domain Codomain

Such a set that can do it is the set of all complex numbers β„‚.

reminder

Now, we have created a function f: ℝ β†’ β„‚ with f(x) = √x.

This function takes a real number and maps it into a complex number, i.e. it's a complex function of a real variable.

13

Vertical line test