What is a Function?

A function relates an input to an output.

function cogs

It is like a automobile that has an input and an output.

And the output is related somehow to the input.

  f(x)

"f(x) = ... " is the classic way of writing a function.
And there are other ways, equally you will see!

Input, Human relationship, Output

We volition see many ways to retrieve well-nigh functions, but there are always three chief parts:

  • The input
  • The relationship
  • The output

Case: "Multiply past ii" is a very simple function.

Here are the 3 parts:

Input Relationship Output
0 × ii 0
ane × 2 2
7 × 2 xiv
10 × 2 20
... ... ...

For an input of 50, what is the output?

Some Examples of Functions

  • x2 (squaring) is a function
  • x3+1 is also a part
  • Sine, Cosine and Tangent are functions used in trigonometry
  • and there are lots more!

Merely nosotros are non going to look at specific functions ...
... instead nosotros will expect at the full general idea of a role.

Names

Commencement, it is useful to give a function a name.

The most common name is " f ", just we can have other names like " chiliad " ... or fifty-fifty " marmalade " if we desire.

But let'due south use "f":

f(x) = x^2

We say "f of x equals x squared"

what goes into the function is put inside parentheses () later on the name of the function:

So f(ten) shows us the function is chosen " f ", and " x " goes in

And nosotros usually meet what a role does with the input:

f(x) = x2 shows usa that function " f " takes " x " and squares it.

Example: with f(x) = xtwo :

  • an input of 4
  • becomes an output of sixteen.

In fact we tin can write f(iv) = 16.

The "x" is Simply a Place-Holder!

Don't go besides concerned nearly "10", it is just there to bear witness us where the input goes and what happens to it.

It could be annihilation!

So this function:

f(10) = 1 - 10 + x2

Is the same function as:

  • f(q) = one - q + q2
  • h(A) = i - A + Aii
  • w(θ) = 1 - θ + θ2

The variable (x, q, A, etc) is just there so we know where to put the values:

f(2) = 1 - 2 + two ii = 3

Sometimes In that location is No Function Name

Sometimes a function has no proper name, and we see something like:

y = x2

Just in that location is still:

  • an input (ten)
  • a relationship (squaring)
  • and an output (y)

Relating

At the tiptop nosotros said that a function was similar a auto. But a function doesn't really accept belts or cogs or any moving parts - and it doesn't actually destroy what we put into it!

A office relates an input to an output.

Proverb "f(4) = 16" is like maxim four is somehow related to 16. Or 4 → 16

tree

Example: this tree grows 20 cm every year, so the height of the tree is related to its historic period using the function h :

h(age) = historic period × 20

And then, if the age is 10 years, the height is:

h(10) = 10 × 20 = 200 cm

Here are some example values:

age h(age) = historic period × 20
0 0
1 20
three.2 64
xv 300
... ...

What Types of Things Do Functions Process?

"Numbers" seems an obvious reply, only ...


... which numbers?

For case, the tree-height office h(historic period) = age×20 makes no sense for an historic period less than zero.


... it could also be messages ("A"→"B"), or ID codes ("A6309"→"Pass") or stranger things.

And then we need something more powerful, and that is where sets come in:

various real numbers

A fix is a collection of things.

Here are some examples:

  • Prepare of even numbers: {..., -4, -2, 0, 2, 4, ...}
  • Set of clothes: {"hat","shirt",...}
  • Set of prime numbers: {two, three, five, 7, eleven, 13, 17, ...}
  • Positive multiples of iii that are less than ten: {iii, half dozen, 9}

Each individual affair in the fix (such as "4" or "hat") is chosen a member, or element.

Then, a function takes elements of a set, and gives back elements of a set.

A Office is Special

But a role has special rules:

  • It must work for every possible input value
  • And it has only one relationship for each input value

This tin be said in ane definition:

function sets X to Y

Formal Definition of a Role

A office relates each element of a prepare
with exactly one element of some other prepare
(mayhap the same prepare).

The Two Important Things!

1.

"...each element..." means that every chemical element in X is related to some element in Y.

Nosotros say that the function covers X (relates every element of it).

(But some elements of Y might non be related to at all, which is fine.)

2.

"...exactly one..." means that a office is single valued . Information technology volition not give dorsum 2 or more results for the same input.

And so "f(two) = 7 or 9" is not right!

"One-to-many" is non allowed, but "many-to-1" is allowed:

function function
(i-to-many) (many-to-i)
This is NOT OK in a function Just this is OK in a office

When a human relationship does not follow those two rules so it is non a function ... information technology is yet a relationship, just not a function.

Instance: The relationship x → x2

function

Could also be written as a table:

Ten: x Y: x2
iii 9
1 one
0 0
4 16
-4 16
... ...

It is a function, considering:

  • Every element in X is related to Y
  • No element in Ten has two or more relationships

So it follows the rules.

(Discover how both 4 and -4 relate to 16, which is allowed.)

Example: This relationship is non a function:

function

Information technology is a relationship, only information technology is non a office, for these reasons:

  • Value "three" in Ten has no relation in Y
  • Value "four" in X has no relation in Y
  • Value "5" is related to more than ane value in Y

(But the fact that "6" in Y has no relationship does not matter)

function not single valued

Vertical Line Test

On a graph, the idea of single valued ways that no vertical line ever crosses more than i value.

If information technology crosses more than once it is withal a valid curve, but is not a function.

Some types of functions have stricter rules, to observe out more you can read Injective, Surjective and Bijective

Infinitely Many

My examples take merely a few values, but functions usually work on sets with infinitely many elements.

Example: y = x3

  • The input set "X" is all Real Numbers
  • The output set "Y" is also all the Real Numbers

We can't prove ALL the values, then here are just a few examples:

Ten: 10 Y: xthree
-ii -viii
-0.i -0.001
0 0
1.1 1.331
iii 27
and so on... and then on...

Domain, Codomain and Range

In our examples higher up

  • the set "X" is called the Domain,
  • the set "Y" is called the Codomain, and
  • the set up of elements that get pointed to in Y (the bodily values produced by the function) is chosen the Range.

We have a special page on Domain, Range and Codomain if you want to know more.

So Many Names!

Functions have been used in mathematics for a very long time, and lots of different names and ways of writing functions accept come nigh.

Here are some common terms you should get familiar with:

Function Parts

Case: z = 2u3 :

  • "u" could be chosen the "independent variable"
  • "z" could be called the "dependent variable" (it depends on the value of u)

Example: f(4) = 16:

  • "iv" could be chosen the "argument"
  • "16" could be called the "value of the part"

Example: h(yr) = 20 × year:

eq

  • h() is the function
  • "year" could be called the "statement", or the "variable"
  • a fixed value like "20" can be chosen a parameter

Nosotros often call a office "f(10)" when in fact the function is actually "f"

Ordered Pairs

And here is some other way to think about functions:

Write the input and output of a role as an "ordered pair", such every bit (4,xvi).

They are called ordered pairs because the input always comes first, and the output second:

(input, output)

So it looks like this:

( x, f(x) )

Example:

(iv,sixteen) ways that the part takes in "4" and gives out "16"

Prepare of Ordered Pairs

A function can then be defined equally a ready of ordered pairs:

Example: {(2,four), (iii,five), (7,iii)} is a function that says

"two is related to 4", "3 is related to 5" and "7 is related 3".

Also, find that:

  • the domain is {2,3,seven} (the input values)
  • and the range is {iv,5,3} (the output values)

Merely the function has to be unmarried valued, and so we also say

"if information technology contains (a, b) and (a, c), then b must equal c"

Which is just a way of proverb that an input of "a" cannot produce two different results.

Instance: {(2,4), (two,5), (7,3)} is non a function because {two,iv} and {2,5} means that 2 could be related to 4 or 5.

In other words it is not a function because it is not single valued

interactive-cartesian-coordinates

A Do good of Ordered Pairs

We can graph them...

... because they are also coordinates!

So a fix of coordinates is also a function (if they follow the rules above, that is)

A Part Can be in Pieces

We can create functions that comport differently depending on the input value

Instance: A role with 2 pieces:

  • when x is less than 0, it gives 5,
  • when x is 0 or more it gives xii
Piecewise Function Hither are some example values:
x y
-3 5
-i 5
0 0
2 4
4 sixteen
... ...

Read more at Piecewise Functions.

Explicit vs Implicit

One concluding topic: the terms "explicit" and "implicit".

Explicit is when the function shows us how to go directly from x to y, such as:

y = 10three − iii

When we know x, we tin find y

That is the archetype y = f(x) style that nosotros often work with.

Implicit is when it is non given directly such equally:

x2 − 3xy + ythree = 0

When we know ten, how practise nosotros find y?

It may exist hard (or impossible!) to get directly from 10 to y.

"Implicit" comes from "implied", in other words shown indirectly.

Graphing

  • The Function Grapher can merely handle explicit functions,
  • The Equation Grapher tin can handle both types (but takes a trivial longer, and sometimes gets it wrong).

Determination

  • a function relates inputs to outputs
  • a function takes elements from a set (the domain) and relates them to elements in a set (the codomain).
  • all the outputs (the bodily values related to) are together called the range
  • a function is a special type of relation where:
    • every chemical element in the domain is included, and
    • whatever input produces but one output (not this or that)
  • an input and its matching output are together called an ordered pair
  • so a function can also be seen as a set of ordered pairs

5571, 5572, 535, 5207, 5301, 1173, 7281, 533, 8414, 8430