A Function Relates An Input To An Output
A Function Relates An Input To An Output
html
f(x)
"f(x) = ... " is the classic way of writing a function.
And there are other ways, as you will see!
We will see many ways to think about functions, but there are always three main parts:
The input
The relationship
The output
1 of 12 15/02/2021, 17:22
What is a Function https://www.mathsisfun.com/sets/function.html
x2 (squaring) is a function
The most common name is "f", but we can have other names like "g" ... or even "marmalade"
if we want.
what goes into the function is put inside parentheses () after the name of the function:
f(x) = x2 shows us that function "f" takes "x" and squares it.
2 of 12 15/02/2021, 17:22
What is a Function https://www.mathsisfun.com/sets/function.html
Don't get too concerned about "x", it is just there to show us where the input goes and what
happens to it.
It could be anything!
So this function:
f(x) = 1 - x + x2
Is the same function as:
f(q) = 1 - q + q2
h(A) = 1 - A + A2
w(θ) = 1 - θ + θ2
The variable (x, q, A, etc) is just there so we know where to put the values:
f(2) = 1 - 2 + 22 = 3
y = x2
an input (x)
a relationship (squaring)
At the top we said that a function was like a machine. But a function doesn't really have belts
or cogs or any moving parts - and it doesn't actually destroy what we put into it!
3 of 12 15/02/2021, 17:22
What is a Function https://www.mathsisfun.com/sets/function.html
So we need something more powerful, and that is where sets come in:
4 of 12 15/02/2021, 17:22
What is a Function https://www.mathsisfun.com/sets/function.html
Each individual thing in the set (such as "4" or "hat") is called a member, or element.
So, a function takes elements of a set, and gives back elements of a set.
5 of 12 15/02/2021, 17:22
What is a Function https://www.mathsisfun.com/sets/function.html
(one-to-many) (many-to-one)
This is NOT OK in a function But this is OK in a function
When a relationship does not follow those two rules then it is not a function ... it is still a
relationship, just not a function.
X: x Y: x2
3 9
1 1
0 0
4 16
-4 16
... ...
It is a function, because:
6 of 12 15/02/2021, 17:22
What is a Function https://www.mathsisfun.com/sets/function.html
Some types of functions have stricter rules, to find out more you can read
Injective, Surjective and Bijective
My examples have just a few values, but functions usually work on sets with infinitely many
elements.
7 of 12 15/02/2021, 17:22
What is a Function https://www.mathsisfun.com/sets/function.html
We have a special page on Domain, Range and Codomain if you want to know more.
Functions have been used in mathematics for a very long time, and lots of different names and
ways of writing functions have come about.
Here are some common terms you should get familiar with:
Relationship
f, g, h, ...
maps to
8 of 12 15/02/2021, 17:22
What is a Function https://www.mathsisfun.com/sets/function.html
We often call a function "f(x)" when in fact the function is really "f"
Write the input and output of a function as an "ordered pair", such as (4,16).
They are called ordered pairs because the input always comes first, and the output second:
(input, output)
( x, f(x) )
9 of 12 15/02/2021, 17:22
What is a Function https://www.mathsisfun.com/sets/function.html
"if it contains (a, b) and (a, c), then b must equal c"
Which is just a way of saying that an input of "a" cannot produce two different results.
So a set of coordinates is also a function (if they follow the rules above,
that is)
10 of 12 15/02/2021, 17:22
What is a Function https://www.mathsisfun.com/sets/function.html
We can create functions that behave differently depending on the input value
Explicit is when the function shows us how to go directly from x to y, such as:
y = x3 − 3
When we know x, we can find y
x2 − 3xy + y3 = 0
When we know x, how do we find y?
11 of 12 15/02/2021, 17:22
What is a Function https://www.mathsisfun.com/sets/function.html
an input and its matching output are together called an ordered pair
12 of 12 15/02/2021, 17:22