Before graphs, before algebra, before any of the fancy stuff: a function is a machine. You feed it a number, it follows its rule, and it hands you back a number. That's it. Everything on this page is about writing that machine down, running it, drawing it, and running it backward.
Here's one in action. Its rule is "double the number, then add 1." Watch a few inputs go through, and keep an eye on the table on the right: every input gets paired with the output it produced.
We need a short way to say "the output of this machine when 3 goes in." Writing out "double it and add one" every time gets old fast, so we give the machine a name, usually $f$, and write the input in parentheses after it.
Function notation names a function's output: $f(x)$, read "$f$ of $x$," is the output of the function $f$ when the input is $x$. In $f(x) = 2x + 1$, $f$ is the name, $x$ is the input, and $2x + 1$ is the rule.
So $f(3) = 7$ is a whole sentence: "when 3 goes into $f$, out comes 7." The animation above was just writing $f(3) = 7$, $f(-1) = -1$, $f(0) = 1$, and $f(5) = 11$, one at a time.
Those parentheses do not mean multiplication. $f(3)$ is not "$f$ times 3": $f$ isn't a number, it's the name of a machine. The parentheses just hold whatever you're feeding it.
Now flip it around. Below is a machine whose rule is hidden. You get to feed it numbers and watch what comes out, and once you've seen a couple of pairs, name the rule. Careful: two pairs can fit more than one rule.
Rules are built out of steps, like "times 3" and "minus 4," and the order of the steps is part of the rule. Build a few machines yourself and see what changes when you swap two steps.
Running the machine by hand has a name.
To evaluate a function at an input, replace every $x$ in the rule with that input, in parentheses, and simplify. The result is the output.
The word that matters is every. Take this rule, which has three $x$'s in it:
$$ f(x) = x^2 - 3x + 5 $$To find $f(-2)$, each of those $x$'s gets its own copy of $(-2)$:
Once the input is in, it's plain order of operations. Here's one with a positive input.
Evaluate $g(3)$ for the function $g(x) = 2x^2 + x - 1$.
Replace every $x$ with $(3)$, then simplify using the order of operations.
\begin{align*} g(3) &= 2(3)^2 + (3) - 1 \\ &= 2(9) + 3 - 1 \\ &= 20 \end{align*}
Negative inputs are where those parentheses earn their keep. The letter doesn't have to be $x$, either: here the input is called $t$.
Evaluate $h(-2)$ for the function $h(t) = -4t + 10$.
Replace every $t$ with $(-2)$:
\begin{align*} h(-2) &= -4(-2) + 10 \\ &= 8 + 10 \\ &= 18 \end{align*}
Here's what happens if you skip the parentheses. Same rule, same input, two very different answers:
The input doesn't even have to be a number. You can feed a function a letter, or a whole expression, and the swap works exactly the same way. Try a few, including the weird one.
What if I feed it the word "red"? I'd get $\text{red}^2 - 3(\text{red}) + 5$. Totally legal substitution. Completely uncomputable. Somebody should tell this function to only accept numbers. (Somebody will: that's what a domain is.)
Feeding in a letter is how you'll see functions in later classes all the time, so let's do it carefully once.
For $f(x) = x^2 - 3x + 5$, find $f(a)$ and $f(a + 1)$.
For $f(a)$, every $x$ becomes $a$: $f(a) = a^2 - 3a + 5$.
For $f(a + 1)$, every $x$ becomes $(a + 1)$, parentheses and all:
\begin{align*} f(a + 1) &= (a + 1)^2 - 3(a + 1) + 5 \\ &= a^2 + 2a + 1 - 3a - 3 + 5 \\ &= a^2 - a + 3 \end{align*}
The two places people slip are both inside the parentheses.
The square hits everything in the parentheses. For $f(x) = x^2$, $f(2a) = (2a)^2 = 4a^2$, not $2a^2$, and $f(a + 1) = (a + 1)^2 = a^2 + 2a + 1$, not $a^2 + 1$. Same with the $-3$: it multiplies the whole $(a + 1)$, giving $-3a - 3$.
Now you be the teacher. Each round, three students evaluated the same thing and one of them slipped. Find the slip.
A function makes pairs: an input and the output it produced. To see all of them at once, we put them on a coordinate plane, with inputs along the horizontal $x$-axis and outputs along the vertical $y$-axis. First, the vocabulary.
Order matters because $(2, 5)$ and $(5, 2)$ are different points. For a function, the input always goes first.
So every row of a table becomes a point. Here's $f(x) = x^2 - 2x - 2$, one row at a time:
That last caption is worth saying slowly. A point is on the graph exactly when its height is the function's output at its $x$.
$f(a) = b$ means exactly the same thing as: the point $(a, b)$ is on the graph of $f$.
That works in both directions, so you can read function values straight off a picture.
Use the graph of $f(x) = x^2 - 2x - 2$ above to find $f(3)$. Then decide which point is on the graph: $(1, -3)$ or $(-3, 1)$?
Find $x = 3$ on the horizontal axis and go straight up to the curve. It's at height 1, so $f(3) = 1$. (Check with the rule: $9 - 6 - 2 = 1$.)
For the points, the input comes first. $f(1) = 1 - 2 - 2 = -3$, so $(1, -3)$ is on the graph. But $f(-3) = 9 + 6 - 2 = 13$, not 1, so $(-3, 1)$ is not: it's the same two numbers in the wrong order.
Drag an input along the axis and watch its point ride along the graph. Try all three functions.
And going the other way: given a rule, can you put the point in the right spot before you see the graph?
Often you're handed the output and asked for the input that produced it. Instead of plugging a number in for $x$, set the whole rule equal to that output and solve.
If $f(x) = 3x - 4$, find $x$ such that $f(x) = 11$.
Don't plug 11 in for $x$: 11 is the output. Replace the whole $f(x)$ with 11 and solve.
\begin{align*} 3x - 4 &= 11 \\ 3x &= 15 \\ x &= 5 \end{align*}
So the input is 5, and we can write $f(5) = 11$.
Solving that equation is just running the machine in reverse. The machine multiplied by 3 and then subtracted 4, so going backward you undo the subtraction first, then the multiplication.
Your turn to wire up the reverse machine. Pick the blocks that undo each step, in the right order.
On a graph, working backward means looking across instead of up. To solve $f(x) = 11$, find where the graph reaches a height of 11, then drop down to read the input.
A line reaches each height once. A curve can reach the same height more than once, and then there's more than one answer.
For $f(x) = x^2 - 2x - 2$ (the parabola from the graphing section), solve $f(x) = 1$.
The horizontal line $y = 1$ crosses the parabola twice, above $x = -1$ and above $x = 3$. Check both: $f(-1) = 1 + 2 - 2 = 1$ and $f(3) = 9 - 6 - 2 = 1$. So $x = -1$ or $x = 3$.
Two inputs with the same output is completely fine for a function, and it's a classic place to stop too early.
When you solve $f(x) = k$ from a graph, follow the line $y = k$ all the way across and count every crossing. A parabola usually gives two answers, one at its turning point gives one, and a height it never reaches gives none.
Hunt down every input for each output below.
We've been treating a function as a machine, and that picture never stops being useful. But in careful mathematics, the one thing that makes something a function is a single rule about inputs and outputs.
"Exactly one" is the whole definition, and it's easiest to see with arrows from inputs to outputs:
Notice which way the rule cuts. Two inputs sharing an output is fine (that's why $f(-1) = f(3)$ above was no problem). One input with two outputs is what breaks it: a machine that sometimes gives back 2 and sometimes $-2$ for the same input isn't a machine you can trust.
Which inputs is a function allowed to take, and which outputs can it actually produce? That's the next page. There's also a one-glance test for "exactly one output" that works straight off a graph.
The definition also explains the red thought from earlier: the set of inputs a function accepts is part of the function, and that's where we pick up next.
Each question below is one skill from this page, in the order the page teaches them. Hit "Generate New Variation" as many times as you like.
Loading practice engine...
Loading practice engine...
Loading practice engine...
Loading practice engine...
Loading practice engine...
Loading practice engine...
Loading practice engine...
Alright, if you've made it this far, here's something with a little heat. These chain the whole page together: evaluate, then work backward; substitute an expression, then simplify; or turn two facts about a line into a third. Write down what each piece of notation means before you compute anything.
Loading practice engine...