What is a Function?
Function is like a machine that takes a number and transforms it into a different number.
This machine works in a predictable manner. Try inserting numbers into the box and find the pattern.
Press Enter to save to history
What is the pattern? Choose one:
The Function Notation
Great! We have found the generalisation of the rule.
Where x is the input number and f is the function (the machine).
Formally, we denote functions as
So for our case above, y = 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.
Press Enter to save to history
Which function describes this machine?
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.
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)):
Try any value:
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)):
No more help!
Shape recognition
Try to guess the expression based on the graph shape.
Expression recognition
Try to guess the graph based on the expression.
Functions in the eyes of a mathematician
So far, we thought of functions either as a machine
or as a graph
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
Using more casual jargon
Here are some examples
Let's test your understanding of the definition.
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.
[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.
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.
Some variations:
Let's test your understanding of interval notation.
Domain, codomain and image
Domain β the set of all possible inputs for a function
Codomain β the set of all considered outputs for a function
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.
You can also visualise sets as areas.
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.
A function f: X → Y is a mapping that assigns to every element x ∈ X exactly one element y ∈ Y.
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) : x ∈ X}
You now understand functions as a true mathematician!
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
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
then half of the domain elements have an image outside of the codomain!
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.
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.
What do we need to do so that the function f(x) = βx is well defined with the domain β?
Such a set that can do it is the set of all complex numbers β.
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.