Intermediate level

What a function is

A function is an unambiguous assignment: every argument gets exactly one value. Meet the f(x) notation, the domain and the range, the four ways to define a function, and the vertical line test on a graph.

Before you start

This topic builds on earlier ideas. Before you start, it's worth working through the lessons below — they'll make everything click:

All formulas

  • A function from X into Y

    f ⁣:XYf \colon X \to Y

    assigns exactly one element of Y to every element of X

  • The value notation

    y=f(x)y = f(x)

    x is the argument, y the value of the function at it

  • Domain

    Df={x:f(x) exists}D_f = \{x : f(x) \text{ exists}\}

    the set of all arguments

  • Range

    Rf={f(x):xDf}R_f = \{f(x) : x \in D_f\}

    the set of all values the function takes

  • Zero of a function

    f(x0)=0f(x_0) = 0

    an argument whose value is zero

  • The graph

    graph of f={(x,f(x)):xDf}\text{graph of } f = \{(x,\, f(x)) : x \in D_f\}

    the set of points (argument, value)

A function is an unambiguous assignment: to every element of one set it assigns exactly one element of another set.

f ⁣:XYf \colon X \to Y

The easiest picture is a machine: you put a number in, a number comes out. The same number put in twice must give the same result — otherwise the machine is broken, and the assignment is not a function.

Argument, value, and the f(x) notation

The number going in is the argument, the number coming out is the value of the function at that argument:

y=f(x)y = f(x)

We read f(3)=5f(3) = 5 as "the value of ff at the argument 33 is 55". This is not ff multiplied by 33 — the bracket here says "compute the result for this input", not "multiply".

Let f(x) = 2x − 1. Find f(3) and f(−4).

The question can also be turned around: we know the value and look for the argument. That is an equation:

For which argument does f(x) = 2x − 1 take the value 7?

Domain and range

The domain DfD_f is the set of all arguments the function is defined for — what may go into the machine:

Df={x:f(x) exists}D_f = \{x : f(x) \text{ exists}\}

The range RfR_f is the set of everything that comes out of it:

Rf={f(x):xDf}R_f = \{f(x) : x \in D_f\}

For f(x)=2x1f(x) = 2x - 1 the domain is every real number — any number can be doubled and reduced by one. It is not always so: the formula f(x)=1xf(x) = \frac{1}{x} makes no sense at x=0x = 0, because we do not divide by zero, and f(x)=xf(x) = \sqrt{x} makes no sense for negative numbers. The domain is therefore not a formality but the first thing to check when you look at a formula.

The domain can also be imposed by the wording of a problem: if xx counts the pupils in a class, then no formula, however pretty, will allow x=3x = -3 or x=2.5x = 2.5.

The graph of a function

The graph of a function is the set of points whose first coordinate is an argument and whose second one is the matching value:

graph of f={(x,f(x)):xDf}\text{graph of } f = \{(x,\, f(x)) : x \in D_f\}

It is the most convenient way to look at a function: everything about it is visible at once. A value is read in two moves — from the argument up to the graph, then left to the vertical axis:

−10123456−202468xyf(3) = 5f(x) = 2x − 1
Reading a value off the graph: the dashed guide runs from the argument 3 to the value 5.

The same path travelled the other way — from a value on the vertical axis right to the graph and down to the horizontal one — gives the preimage, that is the answer to "for which xx does the function take this value".

The vertical line test

Since one argument must have exactly one value, every vertical line can meet the graph of a function at most once:

−4−3−2−101234−202468xyx = 2g(x) = x² − 1
The vertical line x = 2 meets the graph at a single point — the argument 2 has exactly one value.

This is why a circle is not the graph of a function: a vertical line through its interior hits two points, so one xx would have two different values of yy. The reverse is allowed: two different arguments may share a value — the parabola above assigns the same value 33 to both 2-2 and 22 and remains a function.

Four ways to define a function

The same function can be described in several ways:

  • by a formulaf(x)=2x1f(x) = 2x - 1;
  • by a table — a finite list of argument–value pairs;
  • by a graph — a set of points in the plane;
  • in words — "assign to every number its double, less one".
xx2-21-100112233
f(x)=2x1f(x) = 2x - 15-53-31-1113355

A table is convenient but incomplete — it shows six pairs, while the function assigns a value to every real number. The formula and the graph carry all of it at once.

A function assigns to the side of a square its perimeter. Give the formula, the domain and the range.

A zero, and the value at zero

Two numbers that are very easy to confuse:

  • a zero of the function is an argument x0x_0 with f(x0)=0f(x_0) = 0 — on the graph, a crossing with the xx-axis;
  • the value at zero is the number f(0)f(0) — on the graph, the crossing with the yy-axis.

For f(x)=2x1f(x) = 2x - 1 the zero is x0=12x_0 = \frac{1}{2} and the value at zero is f(0)=1f(0) = -1. Two entirely different numbers with misleadingly similar names; we come back to both in the linear function.

Exercises

The questions cover both directions of the assignment: sometimes you are given the argument and asked for the value, sometimes given the value and asked which argument it came from. Type the number alone.

Practice

Work through a set of exercises — they get harder as you go. At the end you'll see your score and the mistakes worth reviewing.

Exercise 1 of 8Score: 0
f(x) = x + 6 → f(4)

Common mistakes

  • Reading f(x)f(x) as a productf(3)f(3) is the value at three, not f3f \cdot 3.
  • Confusing a zero with f(0)f(0) — the first is an argument, the second a value.
  • Losing a sign at a negative argument — in f(4)f(-4) substitute (4)(-4), brackets included.
  • Skipping the domain1x\frac{1}{x} fails at zero and x\sqrt{x} fails for negative numbers.
  • Taking every curve for a graph of a function — a circle is not one; it fails the vertical line test.
  • Mixing up domain and range — the domain lives on the horizontal axis, the range on the vertical one.

Formula card

Topic: What a function is

  • A function from X into Y

    f ⁣:XYf \colon X \to Y

    assigns exactly one element of Y to every element of X

  • The value notation

    y=f(x)y = f(x)

    x is the argument, y the value of the function at it

  • Domain

    Df={x:f(x) exists}D_f = \{x : f(x) \text{ exists}\}

    the set of all arguments

  • Range

    Rf={f(x):xDf}R_f = \{f(x) : x \in D_f\}

    the set of all values the function takes

  • Zero of a function

    f(x0)=0f(x_0) = 0

    an argument whose value is zero

  • The graph

    graph of f={(x,f(x)):xDf}\text{graph of } f = \{(x,\, f(x)) : x \in D_f\}

    the set of points (argument, value)

−10123456−202468xyf(3) = 5f(x) = 2x − 1
Reading a value: from the argument 3 up to the graph and left to the y-axis — f(3) = 5.
−4−3−2−101234−202468xyx = 2g(x) = x² − 1
The vertical line test: a vertical line meets the graph of a function at most once — one argument, one value.

Frequently asked questions

Related articles