Functions in Algebra: Definition, Method and Examples

MathPublished

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 22, then add 11". For the inputs −1,0,1,-1, 0, 1, and 22, the function y=2x+1y = 2x + 1 produces the outputs −1,1,3,-1, 1, 3, and 55.


Here is how the exact same function looks across four representations:

  1. Table: The input column lists {−1,0,1,2}\{-1, 0, 1, 2\} and the output column lists {−1,1,3,5}\{-1, 1, 3, 5\}.
  2. Ordered pairs: {(−1,−1),(0,1),(1,3),(2,5)}\{(-1, -1), (0, 1), (1, 3), (2, 5)\}.
  3. Graph: Points plotted on a coordinate plane at the ordered pairs.
  4. Mapping diagram: Arrows pointing from each input directly to its single output.

A mapping diagram showing inputs -1, 0, 1, and 2 connected by single arrows to outputs -1, 1, 3, and 5 respectively.

In contrast, a relation is not a function if one input branches out to multiple outputs.

For example, the ordered pairs {(3,4),(3,7),(5,8)}\{(3, 4), (3, 7), (5, 8)\} represent a relation. Because the input 33 gives an output of 44 and an output of 77, 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 xx-value). If that vertical line crosses the graphed curve or points more than once, the input has multiple outputs (multiple yy-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.

Two graphs side by side. On the left, a parabola passes the vertical line test. On the right, a circle fails because a vertical line crosses it twice.


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 yy variable with a name for the function, such as f(x)f(x).


The expression f(x)=3x−4f(x) = 3x - 4 is read as "ff of xx equals 33 times xx minus 44."


Here, the function ff takes an input, multiplies it by 33, and subtracts 44. If you replace xx with a number, you are evaluating the function. For example, substituting x=5x = 5 yields f(5)=3(5)−4=11f(5) = 3(5) - 4 = 11.


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 {(2,4),(4,8),(6,8),(8,12)}\{(2, 4), (4, 8), (6, 8), (8, 12)\} represent a function?


Method:

  1. Identify the input values (xx-coordinates). The inputs are 2,4,6,2, 4, 6, and 88.
  2. Check if any input value repeats with a different output.
  3. Every input is unique and maps to exactly one output. The input 44 pairs with 88, and the input 66 pairs with 88, 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 g(x)=x2+5g(x) = x^2 + 5, what is the value of g(−3)g(-3)?


Method:

  1. Substitute the input −3-3 everywhere xx appears in the rule.
  2. Calculate the square: (−3)2=9(-3)^2 = 9.
  3. Add the constant: 9+5=149 + 5 = 14.

Answer: g(−3)=14g(-3) = 14.


Check: Verify the squaring of a negative number is positive.


Example 3: Analyzing mapping diagrams


Question: A mapping diagram shows the input 55 pointing to both 1010 and 1515. Does this represent a function?


Method:

  1. Recall the definition: each input must have exactly one output.
  2. Observe that the input 55 points to two different outputs.
  3. 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 22 and −2-2 gives 44). The only restriction is that one input cannot produce multiple outputs.


Another frequent error is confusing the function notation f(x)f(x) with multiplication. The expression f(x)f(x) means "ff as a function of xx," not the variable ff multiplied by the variable xx.

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 x=3x = 3), 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

Question

A mapping diagram showing the input 3 pointing to output 8, and the input 5 pointing to both output 10 and output 12.

Why does the mapping diagram shown fail to be a function?

  • The inputs and outputs are different sizes.

  • The input 55 has more than one output.

  • The output 88 only has one input.

  • The outputs are larger than the inputs.

Answer:

The input 55 has more than one output.

Question

A coordinate plane showing a sideways opening parabola. A dashed vertical line intersects the curve at two distinct points.

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 yy-value has exactly one xx-value.

  • It is not a function because the graph does not pass through the origin.

Answer:

It is not a function because the vertical line intersects the graph more than once.

Question

If f(x)=4x−7f(x) = 4x - 7, what is the value of f(3)f(3)?

  • −1-1

  • 00

  • 55

  • 1919

Answer:

55

Question

A table with x values 2, 4, 4, 8 and y values 5, 7, 9, 11.

Why does the table above not represent a function?

  • The yy-values are all odd numbers.

  • The xx-values are all even numbers.

  • The input 44 has two different outputs.

  • The output values are larger than the input values.

Answer:

The input 44 has two different outputs.

Question

A function is defined by the rule h(x)=2x+10h(x) = 2x + 10. If the output is 2424, what was the input?

  • 77

  • 1414

  • 2424

  • 5858

Answer:

77