Functions in Algebra: Definition, Method and Examples
A function is a relationship that assigns exactly one output to each input. It can be shown with a rule, table, mapping, ordered pairs or graph; a relation is not a function if one input is paired with more than one output.
In algebra, recognizing functions allows you to mathematically model predictable behaviors and solve equations with confidence.
What is a function?
A function is a specific mathematical rule where every valid input value produces exactly one unique output value.
When you put a number into a function, the rule tells you exactly what single number comes out. You can think of it as a predictable machine. If you input the same number multiple times, the function must always return the identical output.
In a function, an input can never map to two different outputs.
Functions and relations
A relation is any set of ordered pairs that connects input values to output values. A function is a special type of relation that follows a stricter rule.
While all functions are relations, not every relation is a function. A relation becomes a function only if each input maps to exactly one output.
Consider a relation that groups students (inputs) with the subjects they study (outputs). If one student studies both mathematics and history, that input has two outputs. This relationship is a relation, but it is not a function.
You must evaluate all the inputs. If even one input pairs with multiple outputs, the entire relation fails to be a function.
Multiple inputs can share the same output, but one input cannot have multiple outputs.
Represent a function
A function can be represented in multiple ways. The same mathematical relationship can be shown as a mapping diagram, a table, a set of ordered pairs, or a graph.
Organizing data into input output tables is a helpful way to structure these pairs before graphing them.
Let the rule be "multiply by , then add ". For the inputs and , the function produces the outputs and .
Here is how the exact same function looks across four representations:
- Table: The input column lists and the output column lists .
- Ordered pairs: .
- Graph: Points plotted on a coordinate plane at the ordered pairs.
- Mapping diagram: Arrows pointing from each input directly to its single output.

In contrast, a relation is not a function if one input branches out to multiple outputs.
For example, the ordered pairs represent a relation. Because the input gives an output of and an output of , this relation is a clear non-function counterexample.
When you learn more about mapping sets, you will formalize these groups of inputs and outputs as the domain and range of the relation.
Use the vertical line test
When a relation is graphed on a coordinate plane, you can visually determine if it is a function using the vertical line test.
Imagine drawing a straight vertical line anywhere on the graph. A vertical line represents a single input (a specific -value). If that vertical line crosses the graphed curve or points more than once, the input has multiple outputs (multiple -values).
- Passes the test: Any vertical line intersects the graph exactly once. The graph represents a function.
- Fails the test: A vertical line intersects the graph at two or more points. The graph does not represent a function.

This visual test makes classifying relations rapid and reliable.
Read function rules
A function rule defines the exact operations performed on an input to generate its output. Often, these rules are written using function notation, which replaces the variable with a name for the function, such as .
The expression is read as " of equals times minus ."
Here, the function takes an input, multiplies it by , and subtracts . If you replace with a number, you are evaluating the function. For example, substituting yields .
You will frequently encounter these relationships when exploring number patterns and graphing linear equations, where the input and output depend on one another. The inputs and outputs are formally known as the independent and dependent variables.
Worked examples
Example 1: Identifying a function from ordered pairs
Question: Does the set of ordered pairs represent a function?
Method:
- Identify the input values (-coordinates). The inputs are and .
- Check if any input value repeats with a different output.
- Every input is unique and maps to exactly one output. The input pairs with , and the input pairs with , which is allowed.
Answer: Yes, the relation is a function.
Check: Ensure no two ordered pairs share the same first number with different second numbers.
Example 2: Evaluating a function
Question: If , what is the value of ?
Method:
- Substitute the input everywhere appears in the rule.
- Calculate the square: .
- Add the constant: .
Answer: .
Check: Verify the squaring of a negative number is positive.
Example 3: Analyzing mapping diagrams
Question: A mapping diagram shows the input pointing to both and . Does this represent a function?
Method:
- Recall the definition: each input must have exactly one output.
- Observe that the input points to two different outputs.
- A single input generating multiple outputs violates the rule.
Answer: No, the relationship is not a function.
Check: A predictable machine cannot output two different values simultaneously for the same input.
Common mistakes
Many learners assume that if two different inputs produce the same output, the relation is not a function. This is incorrect. A function can give the same output for different inputs (for example, squaring both and gives ). The only restriction is that one input cannot produce multiple outputs.
Another frequent error is confusing the function notation with multiplication. The expression means " as a function of ," not the variable multiplied by the variable .
Finally, do not assume that every graphed shape is a function. Circles, ellipses, and horizontal parabolas fail the vertical line test and are non-functions.
Frequently asked questions
Are all straight lines functions?
Almost all straight lines are functions because they pass the vertical line test. The only exception is a perfectly vertical line (like ), which represents a single input mapping to infinitely many outputs.
What is the difference between an input and an output?
The input is the starting value you put into the function rule. The output is the resulting value produced after the math operations are applied.
Can a function be represented without numbers?
Yes. A function is simply a predictable relationship. Mapping names of countries (inputs) to their capital cities (outputs) is a valid function, because each country has exactly one designated capital.
Practice questions

Why does the mapping diagram shown fail to be a function?
The inputs and outputs are different sizes.
The input has more than one output.
The output only has one input.
The outputs are larger than the inputs.
The input has more than one output.

What does the vertical line test prove about the graphed relation?
It is not a function because the vertical line intersects the graph more than once.
It is a function because the curve is smooth.
It is a function because every -value has exactly one -value.
It is not a function because the graph does not pass through the origin.
It is not a function because the vertical line intersects the graph more than once.
If , what is the value of ?

Why does the table above not represent a function?
The -values are all odd numbers.
The -values are all even numbers.
The input has two different outputs.
The output values are larger than the input values.
The input has two different outputs.
A function is defined by the rule . If the output is , what was the input?
