Resources · Education
What Is a Function in Math?
A function is a rule that assigns exactly one output to each input. Put 4 into f(x) = 2x + 3 and you get 11, every time. This guide covers the defining rule and why two inputs may share an output, the vertical line test, how to read f(x) notation, domain and range, and how a function differs from a relation and from an equation. The domain calculatorworks out the allowed inputs for an expression.
7 min read
What is a function in math?
A function is a rule that assigns to each input exactly one output. That is the whole definition, and the words that carry it are each and exactly one.
Put 4 into the rule f(x) = 2x + 3 and you get 2(4) + 3 = 11. Put 4 in again and you get 11 again, every time. A rule that could return 11 on one occasion and 12 on another would not be a function.
The one rule that decides it
A relationship is a function if and only if no input maps to two different outputs. Two things follow that people often get backwards:
- Two inputs may share an output. g(x) = x² sends both 3 and −3 to 9. That is perfectly fine; it is still a function.
- One input may not have two outputs. A rule sending 4 to both 11 and 12 fails, and is called a relation rather than a function.
A useful image: a function is a vending machine. Press the same button and you must get the same item. Two buttons may dispense the same item, which is annoying but legal. One button dispensing different items on different days is a broken machine, and a broken machine is not a function.
How to tell if something is a function
Three forms turn up in questions, and each has its own quick check.
- A table or list of pairs. Scan the input column for a repeat. If the same input appears twice with different outputs, it is not a function. The pairs (1, 5), (2, 7), (3, 5) are a function — 5 appears twice, but as an output, which is allowed. The pairs (1, 5), (1, 9) are not.
- A graph. Apply the vertical line test below.
- An equation. Solve for y and see whether any x produces more than one value. y = 2x + 3 gives exactly one y per x, so it is a function. y² = x gives two, a positive and a negative root, so it is not.
Evaluating a function once you have one is substitution and nothing more. For f(x) = 2x + 3: f(0) = 2(0) + 3 = 3, f(4) = 2(4) + 3 = 11, and f(−2) = 2(−2) + 3 = −1. Each input returns one value, which is the definition being satisfied in practice.
The vertical line test
On a graph, the rule above has a shortcut. If any vertical line crosses the graph more than once, that x-value has more than one y-value, so the graph is not a function.
A straight line passes. A parabola opening upward passes. A full circle fails, because a vertical line through the middle meets it twice — which is why x² + y² = 25 is an equation but not a function, and why it has to be split into an upper and a lower half before it can be written as one.
Function notation
f(x) is read “f of x”. It does not mean f multiplied by x, and reading it that way is a genuine source of algebra errors.
The letter f names the rule and x names the input. Substituting a value replaces every x on the right-hand side:
- f(x) = 2x + 3
- f(0) = 2(0) + 3 = 3
- f(4) = 2(4) + 3 = 11
- f(−2) = 2(−2) + 3 = −1
Other letters are used freely — g, h, or a descriptive name like cost(n) — and none of them change how the notation works.
Domain and range
Every function comes with two sets. The domain is the inputs it accepts; the range is the outputs it produces. Alphabetical order matches the flow: domain before range, input before output.
Some functions accept anything. f(x) = 2x + 3 has domain all real numbers. Others do not: f(x) = 1/x excludes 0 from its domain because dividing by zero is undefined, and f(x) = √x excludes negatives if you are working in the reals.
Finding the domain is usually a matter of asking what would break: a zero denominator, a negative under an even root, a non-positive argument to a logarithm. The domain calculator works through those restrictions for an expression, and what range means in math covers the output side in more depth.
Function vs relation vs equation
These three overlap enough to be worth separating.
- Relation: any set of input-output pairs, with no restriction. Every function is a relation.
- Function: a relation in which each input has exactly one output. Not every relation qualifies.
- Equation: a statement that two expressions are equal. y = 2x + 3 happens to define a function; x² + y² = 25 does not.
So “is it a function?” is a question about the input-to-output mapping, not about whether something is written with an equals sign.
Common mistakes
- Reading f(x) as multiplication. It names a rule applied to x.
- Thinking repeated outputs disqualify it. Two inputs sharing one output is fine; one input with two outputs is not.
- Forgetting to exclude values from the domain, particularly a zero denominator.
- Applying the vertical line test to a table instead of just checking for a repeated input with different outputs.
Quick summary
- A function assigns exactly one output to each input.
- Two inputs may share an output; one input may not have two.
- The vertical line test is that rule applied to a graph.
- Domain is what goes in, range is what comes out.




