Allday Education

Introduction to Functions

A function is a rule that takes an input and gives back exactly one output. Feed it a number, get one number back — every time, no exceptions. The set of pairs {(1,3),(2,5),(3,7)}\{(1, 3), (2, 5), (3, 7)\} is a function because each input appears once. The set {(2,4),(2,6)}\{(2, 4), (2, 6)\} is not, because the input 22 can't make up its mind.

That one-output rule is the entire definition, and everything else in this article — mapping diagrams, the vertical line test, f(x)f(x) notation — is just a different way of checking or writing the same idea. Get comfortable with it now, because every graph you meet from here through Algebra 2 is a function first.

One output per input

Think of a function as a machine: input goes in, output comes out. The rule for being a function is strict about inputs but relaxed about outputs. An input may never produce two different outputs — but two different inputs are allowed to share the same output. The set {(1,5),(2,5),(3,5)}\{(1, 5), (2, 5), (3, 5)\} is a perfectly good function even though every output is 55.

To test a list of ordered pairs, scan the xx-values. If any xx-value repeats with different yy-values, it is not a function. In a mapping diagram — inputs in one oval, outputs in the other, arrows between — the same test reads as: every input has exactly one arrow leaving it. The diagram below is a function: input 33 and input 44 both land on 55 (a shared output is fine), but no single input splits into two arrows.

A function: every input has exactly one arrowInputOutput234567

Function notation: what f(x) means

Instead of writing y=2x+1y = 2x + 1, we often write f(x)=2x+1f(x) = 2x + 1. Nothing about the rule changed — f(x)f(x) is just a smarter name for yy. The letter ff names the function, the xx in parentheses is the input, and f(x)f(x) is the output the rule produces.

The payoff is that the notation carries the input with it. f(4)f(4) means the output when the input is 44: substitute 44 everywhere you see xx. For f(x)=2x+1f(x) = 2x + 1, that gives f(4)=2(4)+1=9f(4) = 2(4) + 1 = 9. One important warning: f(x)f(x) is not ff times xx. The parentheses here mean is a function of, not multiplication.

A table lines the inputs up with their outputs — each row is one ordered pair (x,f(x))(x, f(x)). Reading the table for f(x)=2x+1f(x) = 2x + 1: the input 33 sits in the same row as the output 77, which is the ordered pair (3,7)(3, 7).

f(x)=2x+1f(x) = 2x + 1
xxf(x)f(x)
0011
1133
2255
3377
4499

The vertical line test

On a graph, the inputs run along the horizontal axis. So the one-output rule becomes a visual test: if any vertical line crosses the graph more than once, some input has two outputs, and the graph is not a function. If every vertical line crosses at most once, it is.

The parabola below passes the test. Slide an imaginary vertical line from left to right — at every position it touches the curve exactly once, so each input has exactly one output. A circle, by contrast, fails the test: most vertical lines through a circle hit it twice.

-3-2-11234-3-2-11234xy

Worked examples

Example 1: is this set of pairs a function?

Is the relation {(1,3),(2,5),(2,8),(4,1)}\{(1, 3), (2, 5), (2, 8), (4, 1)\} a function?

List the inputs1,  2,  2,  41, \; 2, \; 2, \; 4
Look for a repeated input — the input 22 appears twice
Check its outputs: 22 maps to both 55 and 88
One input with two different outputs breaks the rule

Answer: Not a function — the input 22 has two different outputs

Example 2: evaluate a function

If f(x)=3x4f(x) = 3x - 4, find f(5)f(5).

Write the rulef(x)=3x4f(x) = 3x - 4
Substitute 55 for every xxf(5)=3(5)4f(5) = 3(5) - 4
Multiplyf(5)=154f(5) = 15 - 4
Subtractf(5)=11f(5) = 11

Answer: f(5)=11f(5) = 11

Example 3: evaluate with a negative input

If g(x)=x22xg(x) = x^2 - 2x, find g(3)g(-3).

Substitute 3-3 with parenthesesg(3)=(3)22(3)g(-3) = (-3)^2 - 2(-3)
Square the inputg(3)=92(3)g(-3) = 9 - 2(-3)
Multiply — subtracting a negative becomes additiong(3)=9+6g(-3) = 9 + 6
Addg(3)=15g(-3) = 15

Answer: g(3)=15g(-3) = 15

Example 4: work backwards from the output

If f(x)=4x5f(x) = 4x - 5, what value of xx makes f(x)=15f(x) = 15?

Set the rule equal to the target output4x5=154x - 5 = 15
Add 55 to both sides4x=204x = 20
Divide both sides by 44x=5x = 5
Check by evaluatingf(5)=4(5)5=15f(5) = 4(5) - 5 = 15

Answer: x=5x = 5

Try one yourself

xx
yy
456123

Common questions

Can two different inputs have the same output?

Yes. The function rule only restricts inputs: each input gets exactly one output. Outputs are free to repeat. {(1,5),(2,5),(3,5)}\{(1, 5), (2, 5), (3, 5)\} is a function; {(1,5),(1,6)}\{(1, 5), (1, 6)\} is not.

Is f(x)f(x) the same thing as yy?

For graphing purposes, yes — y=2x+1y = 2x + 1 and f(x)=2x+1f(x) = 2x + 1 describe the same line. Function notation just adds information: f(4)=9f(4) = 9 tells you both the input and the output in one statement, where y=9y = 9 only tells you the output.

Does f(x)f(x) mean ff multiplied by xx?

No. In function notation the parentheses mean the function ff applied to the input xx, not multiplication. f(4)f(4) is the output at input 44 — you find it by substituting, never by multiplying a letter by 44.

Want the video version?

Allday Everyday Math has video lessons, practice, and an AI tutor for every topic, Pre-Algebra through Algebra 2.

Try it for $1