Every time a streaming app recommends a song based on what you played, every time a ride-share app estimates a fare from distance, and every time a science class tracks temperature over time, the same mathematical idea appears: one input produces one output. That idea is the heart of a function. Functions help us describe patterns, make predictions, and connect equations, tables, and graphs into one powerful language.
In algebra, a function is more than just a formula. It is a rule that connects values in a precise way. If you know the input, the function tells you exactly what the output is. This makes functions useful in physics, economics, biology, and computer science. A function can describe the height of a ball after \(t\) seconds, the cost of buying \(x\) concert tickets, or the amount of money in an account after a certain number of months.
What makes functions special is consistency. If the same input gave two different outputs, prediction would break down. A navigation system could not give a definite travel time. A thermometer could not give a definite reading. Mathematics requires a function to be unambiguous.
A function is a rule that assigns to each element of one set exactly one element of another set. The set of inputs is called the domain, and the set of actual outputs is called the range.
Function, domain, and range are central ideas in algebra. A function matches each input with exactly one output. The domain is the set of allowed inputs. The range is the set of outputs that actually occur.
[Figure 1] Suppose a rule takes a number \(x\) and adds \(3\). If the input is \(2\), the output is \(5\). If the input is \(-1\), the output is \(2\). This rule is a function because every input has one and only one output.
That last detail matters: different inputs can share the same output, and the relation can still be a function. For example, in the rule \(f(x)=x^2\), both \(2\) and \(-2\) give the output \(4\). This is allowed because the rule still gives exactly one output for each input.

A relation is not a function if even one input has more than one output. For instance, if the input \(3\) were assigned to both \(7\) and \(8\), the rule would fail to be a function. The phrase "exactly one" is the key requirement.
The domain of a function is the set of all allowed input values. The range is the set of all actual output values. In some problems, the domain is given explicitly. In others, you determine it from context or from the expression itself.
For example, consider \(f(x)=2x+1\). If there is no restriction mentioned, the domain is often taken to be all real numbers, because you can substitute any real value for \(x\). The range is also all real numbers, because the outputs can be any real number as \(x\) varies.
Now consider \(g(x)=\sqrt{x-4}\). Here the expression under the square root must be nonnegative, so \(x-4\ge 0\), which means \(x\ge 4\). The domain is all real numbers greater than or equal to \(4\). The outputs of a square root are never negative, so the range is all real numbers greater than or equal to \(0\).
When you find the domain of a formula, remember earlier algebra rules: denominators cannot be \(0\), and expressions inside even roots must be at least \(0\).
Sometimes the domain is a small set rather than all real numbers. If a school function assigns each student ID to a locker number, the domain is the set of student IDs being considered. The range is the set of locker numbers actually assigned. Functions do not have to use continuous numbers; they can connect any kind of objects as long as each input has one output.
Function notation is a compact way to write the output of a function. If \(f\) is a function and \(x\) is in its domain, then \(f(x)\) means "the output of \(f\) for the input \(x\)."
This notation is often read as "\(f\) of \(x\)." It does not mean \(f\cdot x\). The parentheses indicate the input being used, not multiplication. For example, if \(f(x)=3x-2\), then \(f(4)=3(4)-2=10\).
Function notation lets us talk clearly about changing inputs. If \(f(2)=7\), that tells us the output when the input is \(2\). If \(f(a)=a^2+1\), then the input is the variable \(a\), and the output depends on whatever value \(a\) has.
Why notation matters
Function notation keeps the rule and the input separate. In \(f(x)=x^2-5\), the symbol \(f\) names the function, while \(x\) is the input. Changing the letter does not change the function's meaning. For example, \(f(t)=t^2-5\) describes the same rule as \(f(x)=x^2-5\).
Sometimes more than one function appears in the same problem, such as \(f(x)=2x+3\) and \(g(x)=x^2\). Then \(f(4)=11\) while \(g(4)=16\). The function name tells you which rule to use.
A function can appear in several forms: as a verbal description, a table, a set of ordered pairs, a mapping diagram, an equation, or a graph. These are different windows into the same relationship.
Consider the rule "multiply by \(2\), then add \(1\)." In equation form, this is \(y=2x+1\), or in function notation, \(f(x)=2x+1\). In a table, it may look like this:
| Input \(x\) | Output \(f(x)\) |
|---|---|
| \(-1\) | \(-1\) |
| \(0\) | \(1\) |
| \(1\) | \(3\) |
| \(2\) | \(5\) |
Table 1. A table of values for the function \(f(x)=2x+1\).
Each row pairs one input with one output. The table represents a function because no input appears with two different outputs. If \(x=1\) appeared once with output \(3\) and again with output \(6\), the table would not represent a function.
Ordered pairs tell the same story: \((-1,-1)\), \((0,1)\), \((1,3)\), and \((2,5)\). Each pair is of the form \((x,y)\), where the first coordinate is the input and the second coordinate is the output.
[Figure 2] The graph of a function \(f\) is the graph of the equation \(y=f(x)\). This means that every point on the graph has coordinates \((x,f(x))\). In other words, you take an input \(x\), compute the output \(f(x)\), and plot the point.
For example, if \(f(x)=2x+1\), then \(f(0)=1\), \(f(1)=3\), and \(f(2)=5\). So \((0,1)\), \((1,3)\), and \((2,5)\) are points on the graph. When you plot many such points, they line up on a straight line because the rule is linear, as Figure 2 illustrates.

A graph helps you see how outputs change as inputs change. If the graph rises from left to right, the function is increasing. If it falls, the function is decreasing on that interval. A graph also gives a visual sense of the domain and range, especially when only part of a graph is shown.
Graphs are not just pictures. They are another form of the same rule. A table gives sample values. An equation gives a symbolic rule. A graph shows all the ordered pairs visually.
Some relations are not functions. The main reason is simple: one input is paired with more than one output. On a graph, the most common test for this is the vertical line test.
Why does this test work? A vertical line \(x=a\) fixes one input value. If that line hits the graph twice, then the same input \(a\) has two different outputs. That violates the definition of a function, as Figure 3 shows.

For example, the graph of \(y=x^2\) is a function. Any vertical line hits it at most once. But the graph of a circle such as \(x^2+y^2=9\) is not a function of \(x\), because some vertical lines intersect it in two places, one above the \(x\)-axis and one below.
This idea also applies to sets of ordered pairs. The relation \(\{(1,4),(2,5),(3,4)\}\) is a function, because each first coordinate appears only once. But \(\{(1,4),(2,5),(2,7)\}\) is not, because the input \(2\) is paired with both \(5\) and \(7\).
Working through examples makes the definitions more precise. Notice how each solution checks the one-output rule or uses function notation carefully.
Worked example 1: Evaluate a function using notation
Let \(f(x)=x^2-3x+2\). Find \(f(5)\).
Step 1: Substitute the input \(5\) for \(x\).
\(f(5)=5^2-3(5)+2\).
Step 2: Compute each part.
\(5^2=25\), so \(f(5)=25-15+2\).
Step 3: Simplify.
\(25-15=10\), and \(10+2=12\).
The output is \(f(5)=12\).
Function notation tells you exactly which input is being used. A common mistake is to write \(f\cdot 5\), but that would mean multiplication, not evaluation.
Worked example 2: Decide whether a set of ordered pairs represents a function
Consider the relation \(\{(-2,1),(0,3),(4,1),(0,5)\}\). Is it a function?
Step 1: Look at the inputs, which are the first coordinates.
The inputs are \(-2\), \(0\), \(4\), and \(0\).
Step 2: Check whether any input is paired with more than one output.
The input \(0\) is paired with \(3\) and also with \(5\).
Step 3: Apply the definition.
Because one input has two different outputs, the relation fails the definition of a function.
The relation is not a function.
Notice that repeated outputs are fine, but repeated inputs with different outputs are not. This is the same idea we saw earlier in [Figure 1]: two inputs may share an output, but one input may not split into two outputs.
Worked example 3: Find values from a graph rule
Suppose \(g(x)=2x+1\). Find the points on the graph when \(x=-1\), \(x=0\), and \(x=3\).
Step 1: Evaluate the function at each input.
\(g(-1)=2(-1)+1=-2+1=-1\)
\(g(0)=2(0)+1=1\)
\(g(3)=2(3)+1=6+1=7\)
Step 2: Write the ordered pairs.
The points are \((-1,-1)\), \((0,1)\), and \((3,7)\).
Step 3: Connect this to the graph.
Each point has the form \((x,g(x))\), which is exactly how the graph of \(y=g(x)\) is built.
The points on the graph are \((-1,-1)\), \((0,1)\), and \((3,7)\).
These plotted points match the pattern shown earlier in [Figure 2], where each input-output pair becomes one point on the line.
Worked example 4: Use the vertical line test
Does the graph of \(x=y^2\) represent \(y\) as a function of \(x\)?
Step 1: Think about what the equation means.
If \(x=4\), then \(y^2=4\), so \(y=2\) or \(y=-2\).
Step 2: Interpret this in terms of outputs.
The single input \(x=4\) gives two outputs for \(y\).
Step 3: Apply the vertical line test.
A vertical line at \(x=4\) hits the graph twice, just like the non-function example in [Figure 3].
So \(x=y^2\) does not represent \(y\) as a function of \(x\).
Functions describe many relationships you already encounter. If a taxi charges a base fee of \(\$4\) and \(\$2\) per mile, then the cost function can be written as \(C(m)=2m+4\), where \(m\) is the number of miles. Each mileage input gives exactly one cost output, so this is a function.
Temperature conversion is another example. The rule from Celsius to Fahrenheit is \(F(C)=\dfrac{9}{5}C+32\). If the Celsius temperature is known, there is one Fahrenheit output. For \(C=20\), the output is \(F(20)=\dfrac{9}{5}(20)+32=36+32=68\).
In science, distance as a function of time is a common idea. If a runner moves at a steady speed of \(6\) meters per second, then distance can be modeled by \(d(t)=6t\). At \(t=5\), the distance is \(30\) meters. A graph of \(d(t)\) lets you see how the runner's position changes over time.
Computer programs rely heavily on function-like ideas. A function in programming often takes an input, processes it by a rule, and returns exactly one output value, closely matching the mathematical definition.
In economics, revenue, cost, and profit are often modeled as functions. In medicine, dosage may depend on body mass. In engineering, stress may depend on load. Across these fields, the point is the same: a predictable relationship can be represented by a function.
One common mistake is confusing \(f(x)\) with multiplication. Remember that \(f(x)\) names the output of function \(f\) at input \(x\). Another mistake is assuming that a graph must be a line to be a function. Many curves represent functions, including parabolas and square root graphs, as long as each input has only one output.
Students also sometimes mix up domain and range. The domain answers, "What inputs are allowed?" The range answers, "What outputs actually happen?" Thinking in terms of input-output machines can help, but the formal definition is more precise: each element of the domain is assigned exactly one element of the range.
Finally, remember that the graph of \(f\) is the graph of \(y=f(x)\). Every point on that graph has the form \((x,f(x))\). This single idea links equations, notation, tables, and graphs into one coherent picture of functions.