What Is a Function in Math? – Intuitive Guide, Graphs & Memes
Connect inputs, outputs, domains and graphs to the definition of a function.
Quick Answer
A function is a relation between a set of inputs (domain) and a specified set of outputs (codomain), where each input is related to exactly one output.
What is a Function in Mathematics?
Definition
A function is a relation between a set of inputs (domain) and a specified set of outputs (codomain), where each input is related to exactly one output.
f(x) = y
For a relation to be a function, each input value (x) must have exactly one corresponding output value (y).
Key Characteristics
Domain: The set of all possible input values (x)
Range: The set of output values actually attained by the function; a subset of its codomain
Vertical Line Test: A graph represents a function if any vertical line intersects it at most once
Notation: Usually written as f(x), where x is the input and f(x) is the output
Function Evaluator
Enter a function and input values to see how it works
Function Results
f(x) =
Function Table
x
f(x)
Function Examples
Linear Function:
When x = 2, f(x) = 2(2) + 3 = 7
This is a straight line with slope 2 and y-intercept 3
Quadratic Function:
When x = 3, f(x) = 3² - 4 = 9 - 4 = 5
This is a parabola with vertex at (0, -4)
Absolute Value Function:
When x = -5, f(x) = |-5| = 5
When x = 5, f(x) = |5| = 5
Trigonometric Function:
When x = 0, f(x) = sin(0) = 0
When x = 1.57 (≈ π/2), f(x) ≈ sin(π/2) ≈ 1
“If I pour coffee beans into the machine and it sometimes spits out tea… we’ve got a problem.” Imagine a teacher opening class with that analogy, then adding: “A function is a rule that never double-crosses you.” The point is consistency: each allowed input has exactly one output.
Fast-Track FAQ
Question
Snack-size Answer
One-liner definition?
A function assigns exactly one output to each input.
Notation decoded?
f(x) means “feed x into rule f, collect f(x).”
Biggest rookie mistake?
Assuming every relation is a function. For a graph of y versus x, check the Vertical Line Test.
1. Function, Demystified
Human-speak Version
Think of a vending machine that always gives one snack per code. Punch B7? You always get chips—never chips and soda, for every code in the allowed domain. Replace codes with numbers and snacks with outputs; voilà, you’ve met a function.
Math-speak Definition
A function f from set A (domain) to set B (codomain) pairs every element in A with one and only one element in B.
2. My “Coffee-Bean Test” ☕
I ask: “If I drop the same bean in twice, will the machine ever hand me two different drinks?” If yes, the rule’s not a function. For a graph of y versus x, one vertical line fixes one x-value. It may intersect the graph at most once; each x in the domain must have one output.
3. Real-World Cameos
Scenario
Input
Output
Why It’s a Function
Track Lookup (fixed catalog)
Song ID
Audio stream
Each ID selects one specified track. A random shuffle choice is a different process.
Currency Converter
$100
€92 (hypothetical)
Fix a hypothetical rate of €0.92 per $1, with no fees; this is not a live quote.
Pizza Oven Timer
Dial 15 min
Beep @ 15
For a fixed start time, the duration determines one scheduled end time.
Pull Quote: “Functions are contract law for numbers: one clause, no loopholes.”
4. Visual Pop-Quiz
A: CircleB: Vertical lineC: Parabola
Which graph gives exactly one y-value for each x in its domain? Imagine moving a vertical line across each graph.
Reveal the answer
Only C is a function of x. A has two y-values for some x-values; B has many y-values at x = 0. C passes the vertical line test. Different inputs may still share the same output.
Original schematic diagrams by HeLovesMath; axes are not numerically scaled.
5. Common Pitfalls & How I Dodge Them
Broken Machines (Non-Functions) A full circle of positive radius gives two y-values for some x-values—cool art, bad vending machine.
Domain Blindness Over the real numbers, √x requires x ≥ 0. I scribble domain limits beside every radical like sticky notes.
Try the evaluator above with x^2 at x = −2 and x = 2. Both outputs are 4: many-to-one relations can still be functions.
7. Mini Case Study – Glucose Sensor App
As a fictional algebra illustration, consider G(v) = 1.37v − 0.22: each allowed v produces one numerical output. For v = 2, G(2) = 2.52. These invented coefficients are not a validated blood-glucose calibration and must not be used for health decisions. Being a function guarantees a single output, not measurement accuracy.
Feel-Good Wrap (No Dry Conclusion)
Next time f(x) pops up, picture that faithful coffee machine or your go-to playlist ID. Functions aren’t abstract jailers—they’re reliability in equation form. Now go plot one, sprinkle emojis, and show math who’s boss.
Advertisement
Read the rule in both directions
Suppose a machine squares its input and then subtracts one. Feeding in three gives eight. Feeding in negative three also gives eight. This repeated output is allowed because each individual input still has just one output. Running the rule backwards from eight produces two possibilities unless the original domain was restricted. A table with only a few rows can demonstrate how the machine behaves at those inputs.
Determining Whether a Relation Represents a Function
A relation is a set of ordered pairs. The set of the first components of each ordered pair is called the domain and the set of the second components of each ordered pair is called the range. Consider the following set of ordered pairs. The first numbers in each pair are the first five natural numbers. The second number in each pair is twice that of the first.
The domain is
The range is
Note that each value in the domain is also known as an input value, or independent variable, and is often labeled with the lowercase letter Each value in the range is also known as an output value, or dependent variable, and is often labeled lowercase letter
A function is a relation that assigns a single value in the range to each value in the domain. In other words, no x-values are repeated. For our example that relates the first five natural numbers to numbers double their values, this relation is a function because each element in the domain, is paired with exactly one element in the range,
Now let’s consider the set of ordered pairs that relates the terms “even” and “odd” to the first five natural numbers. It would appear as
Notice that each element in the domain,
is not paired with exactly one element in the range,
For example, the term “odd” corresponds to three values from the range,
and the term “even” corresponds to two values from the range,
This violates the definition of a function, so this relation is not a function.
diagram compares relations that are functions and not functions.
(a) This relationship is a function because each input is associated with a single output. Note that input and both give output (b) This relationship is also a function. In this case, each input is associated with a single output. (c) This relationship is not a function because input is associated with two different outputs.
Determining If Menu Price Lists Are Functions
The coffee shop menu, shown in diagram consists of items and their prices.
ⓐ Is price a function of the item?
ⓑ Is the item a function of the price?
Solution
ⓐ Let’s begin by considering the input as the items on the menu. The output values are then the prices. See diagram.
Each item on the menu has only one price, so the price is a function of the item.
ⓑ Two items on the menu have the same price. If we consider the prices to be the input values and the items to be the output, then the same input value could have more than one output associated with it. See diagram.
Therefore, the item is a not a function of price.
Determining If Class Grade Rules Are Functions
In a particular math class, the overall percent grade corresponds to a grade point average. Is grade point average a function of the percent grade? Is the percent grade a function of the grade point average? table shows a possible rule for assigning grade points.
Percent grade
0–56
57–61
62–66
67–71
72–77
78–86
87–91
92–100
Grade point average
0.0
1.0
1.5
2.0
2.5
3.0
3.5
4.0
Solution
For any percent grade earned, there is an associated grade point average, so the grade point average is a function of the percent grade. In other words, if we input the percent grade, the output is a specific grade point average.
In the grading system given, there is a range of percent grades that correspond to the same grade point average. For example, students who receive a grade point average of 3.0 could have a variety of percent grades ranging from 78 all the way to 86. Thus, percent grade is not a function of grade point average.
Using Function Notation
Once we determine that a relationship is a function, we need to display and define the functional relationships so that we can understand and use them, and sometimes also so that we can program them into computers. There are various ways of representing functions. A standard function notation is one representation that facilitates working with functions.
To represent “height is a function of age,” we start by identifying the descriptive variables
for height and
for age. The letters and are often used to represent functions just as we use and to represent numbers and
and to represent sets.
Remember, we can use any letter to name the function; the notation shows us that depends on The value must be put into the function to get a result. The parentheses indicate that age is input into the function; they do not indicate multiplication.
We can also give an algebraic expression as the input to a function. For example means “first add a and b, and the result is the input for the function f.” The operations must be performed in this order to obtain the correct result.
Using Function Notation for Days in a Month
Use function notation to represent a function whose input is the name of a month and output is the number of days in that month. Assume that the domain does not include leap years.
Solution
The number of days in a month is a function of the name of the month, so if we name the function we write
or The name of the month is the input to a “rule” that associates a specific number (the output) with each input.
For example, because March has 31 days. The notation reminds us that the number of days, (the output), is dependent on the name of the month, (the input).
Interpreting Function Notation
A function gives the number of police officers, in a town in year What does represent?
Solution
When we read we see that the input year is 2005. The value for the output, the number of police officers is 300. Remember, The statement tells us that in the year 2005 there were 300 police officers in the town.
Representing Functions Using Tables
A common method of representing functions is in the form of a table. The table rows or columns display the corresponding input and output values. In some cases, these values represent all we know about the relationship; other times, the table provides a few select examples from a more complete relationship.
table lists the input number of each month (January = 1, February = 2, and so on) and the output value of the number of days in that month. This information represents all we know about the months and days for a given year (that is not a leap year). Note that, in this table, we define a days-in-a-month function where identifies months by an integer rather than by name.
Month number, (input)
1
2
3
4
5
6
7
8
9
10
11
12
Days in month, (output)
31
28
31
30
31
30
31
31
30
31
30
31
table defines a function Remember, this notation tells us that is the name of the function that takes the input and gives the output
1
2
3
4
5
8
6
7
6
8
table displays the age of children in years and their corresponding heights. This table displays just some of the data available for the heights and ages of children. We can see right away that this table does not represent a function because the same input value, 5 years, has two different output values, 40 in. and 42 in.
Age in years, (input)
5
5
6
7
8
9
10
Height in inches, (output)
40
42
44
47
50
52
54
Identifying Tables that Represent Functions
Which table, table, table, or table, represents a function (if any)?
Input
Output
2
1
5
3
8
6
Input
Output
–3
5
0
1
4
5
Input
Output
1
0
5
2
5
4
Solution
table and table define functions. In both, each input value corresponds to exactly one output value. table does not define a function because the input value of 5 corresponds to two different output values.
When a table represents a function, corresponding input and output values can also be specified using function notation.
The function represented by table can be represented by writing
table cannot be expressed in a similar way because it does not represent a function.
Finding Input and Output Values of a Function
When we know an input value and want to determine the corresponding output value for a function, we evaluate the function. Evaluating will always produce one result because each input value of a function corresponds to exactly one output value.
When we know an output value and want to determine the input values that would produce that output value, we set the output equal to the function’s formula and solve for the input. Solving can produce more than one solution because different input values can produce the same output value.
Evaluation of Functions in Algebraic Forms
When we have a function in formula form, it is usually a simple matter to evaluate the function. For example, the function can be evaluated by squaring the input value, multiplying by 3, and then subtracting the product from 5.
Evaluating Functions at Specific Values
Evaluate at:
ⓐ
ⓑ
ⓒ
ⓓ Now evaluate
Solution
Replace the
in the function with each specified value.
ⓐ Because the input value is a number, 2, we can use simple algebra to simplify.
ⓑ In this case, the input value is a letter so we cannot simplify the answer any further.
ⓒ With an input value of we must use the distributive property.
ⓓ In this case, we apply the input values to the function more than once, and then perform algebraic operations on the result. We already found that
and we know that
Now we combine the results and simplify.
Evaluating Functions
Given the function evaluate
Solution
To evaluate we substitute the value 4 for the input variable in the given function.
Therefore, for an input of 4, we have an output of 24.
Solving Functions
Given the function solve for
Solution
If either or (or both of them equal 0). We will set each factor equal to 0 and solve for in each case.
This gives us two solutions. The output when the input is either or We can also verify by graphing as in diagram. The graph verifies that and
Evaluating Functions Expressed in Formulas
Some functions are defined by mathematical rules or procedures expressed in equation form. If it is possible to express the function output with a formula involving the input quantity, then we can define a function in algebraic form. For example, the equation expresses a functional relationship between
and We can rewrite it to decide if is a function of
Finding the Algebraic Form of a Function
Express the relationship as a function if possible.
Solution
To express the relationship in this form, we need to be able to write the relationship where is a function of which means writing it as
Therefore, as a function of is written as
Expressing the Equation of a Circle as a Function
Does the equation represent a function with as input and as output? If so, express the relationship as a function
Solution
First we subtract from both sides.
We now try to solve for in this equation.
We get two outputs corresponding to the same input, so this relationship cannot be represented as a single function
Evaluating a Function Given in Tabular Form
As we saw above, we can represent functions in tables. Conversely, we can use information in tables to write functions, and we can evaluate functions using the tables. For example, how well do our pets recall the fond memories we share with them? There is an urban legend that a goldfish has a memory of 3 seconds, but this is just a myth. Goldfish can remember up to 3 months, while the beta fish has a memory of up to 5 months. And while a puppy’s memory span is no longer than 30 seconds, the adult dog can remember for 5 minutes. This is meager compared to a cat, whose memory span lasts for 16 hours.
The function that relates the type of pet to the duration of its memory span is more easily visualized with the use of a table. See table.http://www.kgbanswers.com/how-long-is-a-dogs-memory-span/4221590. Accessed 3/24/2014.
Pet
Memory span in hours
Puppy
0.008
Adult dog
0.083
Cat
16
Goldfish
2160
Beta fish
3600
At times, evaluating a function in table form may be more useful than using equations. Here let us call the function
The domain of the function is the type of pet and the range is a real number representing the number of hours the pet’s memory span lasts. We can evaluate the function at the input value of “goldfish.” We would write Notice that, to evaluate the function in table form, we identify the input value and the corresponding output value from the pertinent row of the table. The tabular form for function seems ideally suited to this function, more so than writing it in paragraph or function form.
ⓐEvaluating means determining the output value of the function for the input value of The table output value corresponding to is 7, so
ⓑSolving means identifying the input values, that produce an output value of 6. The table below shows two solutions: and
1
2
3
4
5
8
6
7
6
8
When we input 2 into the function our output is 6. When we input 4 into the function our output is also 6.
Finding Function Values from a Graph
Evaluating a function using a graph also requires finding the corresponding output value for a given input value, only in this case, we find the output value by looking at the graph. Solving a function equation using a graph requires finding all instances of the given output value on the graph and observing the corresponding input value(s).
ⓐ To evaluate locate the point on the curve where then read the y-coordinate of that point. The point has coordinates so See diagram.
ⓑ To solve we find the output value on the vertical axis. Moving horizontally along the line we locate two points of the curve with output value and These points represent the two solutions to or This means and or when the input is or the output is See diagram.
Determining Whether a Function is One-to-One
Some functions have a given output value that corresponds to two or more input values. For example, in the stock chart shown in the figure at the beginning of this chapter, the stock price was $1000 on five different dates, meaning that there were five different input values that all resulted in the same output value of $1000.
However, some functions have only one input value for each output value, as well as having only one output for each input. We call these functions one-to-one functions. As an example, consider a school that uses only letter grades and decimal equivalents, as listed in table.
Letter grade
Grade point average
A
4.0
B
3.0
C
2.0
D
1.0
This grading system represents a one-to-one function, because each letter input yields one particular grade point average output and each grade point average corresponds to one input letter.
To visualize this concept, let’s look again at the two simple functions sketched in source illustration or discussion(a) and source illustration or discussion(b). The function in part (a) shows a relationship that is not a one-to-one function because inputs and both give output The function in part (b) shows a relationship that is a one-to-one function because each input is associated with a single output.
Determining Whether a Relationship Is a One-to-One Function
Is the area of a circle a function of its radius? If yes, is the function one-to-one?
Solution
A circle of radius has a unique area measure given by so for any input, there is only one output, The area is a function of radius
If the function is one-to-one, the output value, the area, must correspond to a unique input value, the radius. Any area measure is given by the formula Because areas and radii are positive numbers, there is exactly one solution: So the area of a circle is a one-to-one function of the circle’s radius.