What Is a Function?
Progress can't be saved in this browser, so this lesson's status can't be set.
Learning goals
- Require exactly one output for each allowed input
- Read and evaluate function notation such as and
- Apply the vertical line test to a graph
- State the domain and range of a simple rule
- Show one function as a rule, table, graph or words
A function is a rule with one output for each allowed input
A function assigns exactly one output to each allowed input. The input is what you put into the rule; the output is what it returns. Doubling is a function: input gives , and input gives . Everyday rules work the same way: “assign to each person their exact height right now” is a function, since every person has one height at this moment, but “assign to each height the person who is that tall” is not, since many different people can share a height.
A function may send different inputs to the same output. Squaring sends both and to : each input still has just one result. A rule fails to be a function when one input has two or more different outputs.
Consider instead “pair a number with every real value whose square equals it.” Give it the input and there are two numbers whose square is , namely and :
The input has two outputs, so this pairing is not a function.
Why function notation?
Function notation records two things that a bare leaves out: which rule produced the output and which input was used.
You might track a car’s distance, speed and fuel at once. Calling every output makes those rules hard to tell apart. Function notation names the rule. Write to say ” is the name of the rule, and is the output it produces.” For the rule , this becomes
read aloud as ” of equals .” Different letters name different rules, so , , and can sit on the same page as three distinct machines.
Function notation also keeps the input attached to its output. Compute the output of at and at :
Here and are outputs of the same rule at different inputs. The notation tells you which input produced and which produced .
Reading and evaluating
In , names the function, the quantity in parentheses is the input, and the whole expression is the output. Names such as and work too. A descriptive name, such as for an area or for a cost, can help you remember what the rule does.
The parentheses in do not mean multiplication. means “apply the rule to input ,” not ” times .”
To evaluate a function at a particular input, substitute that number for everywhere it appears, then simplify. This uses the substitution you already know.
Worked example 1 Evaluating at several inputs
The rule is “triple the input, then subtract .” Substitute each input for and simplify.
At , replace every with :
At :
At , keep the parentheses so the sign is handled correctly:
The same substitution works even when the input is a letter instead of a number. At , replace every with and simplify only what can be simplified:
The value of is unspecified, so cannot be evaluated to a single number yet. Notice also that : an input of zero need not produce an output of zero.
An entire expression can be the input. Replace every in the rule with the whole expression :
This changes the input before applying the rule. Adding to the output is different:
For example, at these give and . In general, does not mean .
Check your understanding
If , what is ?
Substitute for in the rule and simplify.
The input is and the output is . The parentheses tell you to apply the rule, not to multiply by .
Check your understanding
If , what is ?
Replace with , just as you would substitute a chosen number.
The value of is unspecified, so leave the output as .
When a rule is not a function
An input-output pairing is called a relation. To decide whether a relation is a function, check whether any input has two different outputs. The same check works for pairs, tables and graphs.
As a set of ordered pairs, a relation is a function when no input value is paired with two different output values. The set is a function, and so is , where every input lands on the same output (repeated outputs are allowed). But is not a function, because the input is paired with both and .
As a table, the same test reads down the input column: if any input appears twice with different outputs beside it, the relation is not a function. As a graph, there is a quick visual version of the test, worth knowing because you have already plotted points and lines in the coordinate plane.
Because a point’s input is its horizontal position, a vertical line fixes one input. The vertical line test asks whether any such line meets the graph more than once. One line with two crossings is enough to rule out a function; passing requires every vertical line to meet the graph at most once.
A closer look at why the vertical line test works#
The points and lie on the same vertical line, . If both belong to a relation’s graph, input has two outputs, and , so the relation is not a function. If there is just one point on the line , that input has one output. If there is none, is not an allowed input.
Now fix any input . A point has input as its horizontal coordinate and output as its vertical coordinate. The heights of the points where the graph meets are exactly the outputs paired with input . No point with a different input lies on that line.
A function has exactly one output at each allowed input, so each vertical line meets its graph at most once. Conversely, if every vertical line meets a relation’s graph at most once, every input that appears has just one output. The graph therefore represents a function on those inputs. A vertical line may miss it entirely: that input is outside its domain.
Check your understanding
Look at Graph B above, on the right. Find where its dashed vertical line meets the curve. Based on the vertical line test, is Graph B a function, and why?
Every point on the dashed vertical line shares one input. Its two marked crossings on Graph B give that input two different outputs, so Graph B fails. Graph A is a nonvertical straight line: every vertical line meets it at most once, so it passes. One failing vertical line is enough to reject a graph; one successful line alone does not prove that a whole graph is a function.
Worked example 2 Deciding whether a rule is a function
Test each relation against the one rule: does any input have two different outputs?
The set is a function. The inputs are , , and , all different, and each has a single output. The output appears twice, but that is allowed, since it comes from two different inputs.
The table below is not a function:
| input | ||||
|---|---|---|---|---|
| output |
The input shows up twice with two different outputs, and , so the relation is not a function:
Finally, the equation is not a function of . Choose the input and solve for the output: gives or , two outputs for one input. A vertical line at would cross its graph twice, so the graph fails the vertical line test as well.
Check your understanding
Which set of input-output pairs is NOT a function?
Scan each set for an input that is paired with two different outputs. In the third set the input appears twice with different outputs.
Because that one input has two outputs, the third set is not a function. The second set repeats the output , but its inputs are all different, so it is a perfectly good function.
Domain and range
The domain of a function is the set of all inputs it is allowed to take. The range is the set of all outputs it actually produces. Input goes with domain, output goes with range, and you can describe each in plain words without any special symbols. In this lesson, “number” means a real number, the kind you already plot on a number line.
Unless a problem restricts the inputs, rules built only from adding, subtracting and multiplying accept all real numbers. For other rules, check which operations are defined. A denominator must not be zero, and a real square root needs a nonnegative number inside it. For example, has domain “all numbers except ,” because would divide by zero. The square root rule has domain “all numbers greater than or equal to ,” because a negative input has no real square root.
The range takes a little more thought, because it depends on what the rule can actually reach. For , every output is a square, and a square is never negative, so no output can be below . Every nonnegative number is reached too: to land exactly on some target , use the input , since . So the range is “all numbers greater than or equal to .”
Worked example 3 Finding a domain and a range
Find the domain of , and find the range of .
For the domain of , the only danger is a zero denominator. Set the denominator equal to zero to find the forbidden input:
Every other number is fine, so the domain of is “all numbers except .”
For the range of , start from what can do. Since for every input, adding pushes every output up by one:
A table of sample values shows the pattern; the smallest entry is , at :
No output can fall below . And every number is actually reached: solve for , which gives , a real number precisely because . So the range of is “all numbers greater than or equal to .”
Check your understanding
What is the domain of ?
The rule divides by , so the one forbidden input is the value that makes the denominator zero.
Every other number gives a valid output, so the domain is all numbers except .
Check your understanding
What is the range of ?
Since for every input, adding pushes every output up by .
The smallest output is , reached at . Every number is also reached, by solving to get , so the range is all numbers greater than or equal to .
Four ways to show the same function
A function can be described by a rule, a table, a graph or words. For “double the input and add one”:
As a rule (an equation), it is compact and ready to evaluate:
As a table, it lists sample inputs beside their outputs:
| input | ||||
|---|---|---|---|---|
As a graph, it is the collection of points in the coordinate plane, which for this rule is the straight line you would get from . As words, it is the sentence “double the input, then add one.” All four describe the very same pairing of inputs with outputs. The rule and the words tell you how to produce any output; the table shows a handful of sample pairs, while the graph pictures every pair the function has, over whatever stretch of inputs is drawn.
Check your understanding
A rule sends , , and . Which equation matches this rule?
Test each input against : , , and . All three match. The other rules fail somewhere: gives , not ; gives , not ; and gives , not .
Worked example 4 Turning words into a rule, then reading it back
A rule says “square the input, then subtract .” Write it in function notation, then find .
Translate the sentence one operation at a time. “Square the input” is , and “subtract ” appends :
Now evaluate at , substituting carefully: