A function is a rule that takes an input and produces exactly one output. Give it a number, and it returns a number — always the same output for the same input, never ambiguous, never uncertain. This consistency is what makes functions the central object of study in mathematics: they capture relationships that are predictable and repeatable.
The notation f(x) names both the rule and its output. The letter f identifies the function, the variable x represents an arbitrary input, and f(x) denotes the output that results. From this simple framework emerges the machinery for describing motion, growth, change, and structure across every branch of mathematics and its applications.
Key Terms
Core Concepts
Function— a rule assigning exactly one output to each input
Relation— any set of ordered pairs, with no uniqueness requirement
Six rules that match inputs to outputs. Which of them can be relied on to give one definite answer?
A: country → capital. B: age → a person of that age. C: x→x2+1. D: x→ a number whose square is x. E: person → birthday. F: x→ a number bigger than x.
Counting the outputs for one input settles it: A, C and E always give exactly one; B, D and F do not.
rule
outputs for one input
function?
A: each country → its capital
exactly one
yes
B: each age → a person of that age
many people, no single answer
no
C: x → x² + 1
exactly one
yes
D: x → a number whose square is x
two for x = 4: 2 and −2
no
E: each person → their birthday
exactly one
yes
F: x → a number bigger than x
infinitely many
no
B, D and F leave a choice: given the input, the output is still not decided.
This uniqueness is what separates functions from more general relationships. A relationship might associate a single input with multiple outputs — given a person's age, there could be many people with that age. A function cannot do this. Given an input, the output is determined completely. There is no ambiguity, no choice, no list of possibilities.
The definition
A function is a rule that assigns exactly one output to each allowed input.
A function is a rule that assigns exactly one output to each input. The input is a value chosen from some allowed set, the output is the value the rule produces, and the defining requirement is uniqueness: each input yields one and only one output.
So A, C and E are functions; B, D and F are not.
A function is a rule written as f(x): name the input, and the output follows.
The notation f(x)=x2+1 defines a function. The rule says: take the input x, square it, add one. For x=3, the output is f(3)=10. For x=−2, the output is f(−2)=5. Each input produces exactly one result.
One output per input
Left: f(x) = x² + 1 on four inputs. Exactly one arrow leaves each input; −2 and 2 both land on 5, which is allowed — sharing an output breaks nothing. Right: pairing each number with its square roots sends 4 to both 2 and −2 (and 1, 9 likewise), so an input has two outputs and the rule is not a function.
The test is only about arrows leaving an input: several arrows arriving at one output are fine.
The rule works in one direction only: one input gives one output, but one output may come from many inputs.
Multiple inputs can share the same output — both f(2) and f(−2) equal 5 in the example above — and this is perfectly acceptable. The restriction runs only one direction: one input, one output. The reverse, one output coming from multiple inputs, is allowed.
Fact: Almost no function has a formula
Formulas are finite strings of symbols, so they can be listed one by one; the functions from R to R cannot. Nearly every function pairs inputs with outputs in a way no formula can write.
Rules that allow several outputs are relations, compared with functions in functions vs relations.
The rest of the page covers functions and relations, domain and range, notation, ways of representing functions, and the main types of functions.
Functions vs Relations
A relation is any set of ordered pairs — any collection of input-output associations, with no restrictions on how many outputs an input can have.
COROLLARY
Every function is a relation, but not every relation is a function.
The relation {(1,2),(1,3),(2,5)} is not a function because the input 1 is paired with two different outputs, 2 and 3. There is no single answer to "what output does 1 produce?" The relation {(1,2),(2,3),(3,5)} is a function because each input appears exactly once.
Fact: Only 27 of 512 relations are functions
On the set {1,2,3} a relation may include any of the 9 possible pairs, so there are 29=512 relations. A function picks exactly one output for each of the 3 inputs, which leaves 33=27, about one in nineteen.
The equation x2+y2=1 defines a relation: the set of all points on the unit circle. But it is not a function of x, because most x-values correspond to two y-values. At x=0, both y=1 and y=−1 satisfy the equation. A function would have to choose one or the other.
The distinction matters because functions have predictable behavior that relations lack. Knowing the input determines the output — this is the property that makes functions useful for modeling, calculation, and analysis. The table below sets the two ideas side by side and shows the example diagnostics that separate them.
Property or example
Relation?
Function?
Definition
any set of input–output pairs
a relation with each input mapped to exactly one output
Uniqueness requirement
none — same input may map to many outputs
every input has exactly one output
Example: {(1, 2), (1, 3), (2, 5)}
✓
✗
Example: {(1, 2), (2, 3), (3, 5)}
✓
✓
Example: x² + y² = 1 (unit circle)
✓
✗
A function is a relation that keeps one promise: every input gets exactly one output.
The Vertical Line Test
The vertical line test determines whether a graph represents a function.
RULEVertical Line Test
If every vertical line intersects the graph at most once, the graph is a function. If any vertical line intersects the graph more than once, the graph is not a function.
The test works because a vertical line consists of all points with a fixed x-value. If the line crosses the graph twice, those two intersection points have the same x-coordinate but different y-coordinates — meaning the same input produces two different outputs, violating the definition of a function.
Pitfall: Testing with horizontal lines
Checking y=x2 with the horizontal line y=4 finds two crossings, at x=−2 and x=2, and rejects the graph. Two inputs sharing the output 4 is allowed, so the graph is still a function; only vertical lines decide it.
A parabola opening upward passes the test: every vertical line hits it at most once. A circle fails: vertical lines through the interior hit it twice. A horizontal line passes: each vertical line intersects it exactly once. A vertical line fails spectacularly: a single vertical line intersects it infinitely many times.
The test applies only to graphs in the standard xy-plane where x represents input and y represents output. It is a visual check, useful for quickly identifying whether a curve could represent a function.
A parabola passes, a circle fails
Each dashed line holds x fixed. On the parabola y = x² − 1 every such line meets the curve exactly once, so each input has one output. On the circle x² + y² = 4 the line x = 1 meets it at y = √3 and y = −√3: one input, two outputs, so the circle is not the graph of a function.
The upper half alone, y = √(4 − x²), passes the test: cutting the circle along the x-axis leaves two functions.
Representing Functions
Functions can be represented in multiple forms, each with its own advantages.
An equation gives an explicit formula: f(x)=3x−7 tells exactly how to compute the output from any input. Equations are precise, compact, and allow calculation at any point in the domain.
A table lists specific input-output pairs. It shows concrete values but only at selected points — the function's behavior between listed values must be inferred or interpolated.
A graph displays the function visually, showing shape, trends, and features at a glance. It reveals where the function increases or decreases, where it reaches maximum or minimum values, and how it behaves across its entire domain. Reading exact values from a graph requires estimation.
A verbal description explains the rule in words: "the function that doubles its input and subtracts five." Verbal forms connect functions to real-world contexts but lack the precision of equations.
Each representation captures the same underlying relationship. Converting between them — writing an equation from a graph, building a table from an equation, describing a pattern in words — is a fundamental skill. The table below pairs each representation with what it gives, where it shines, and where it falls short.
Representation
What it gives
Strength
Limitation
Equation
explicit formula relating input to output
precise; computable at any allowed input
abstract — overall behavior is hard to see
Table
specific input–output pairs
concrete values; easy direct lookup
behavior between listed inputs must be inferred
Graph
visual curve over the domain
reveals shape, trends, and extreme values at a glance
The grammar of the whole subject in one mark: what f(x) names, which letters take its place, and how substitution reads. Everything here — and the interval, composition, and inverse marks met later — is catalogued among the function symbols, with LaTeX code for each; the mathematical keyboard types them directly.
One mark, two jobs: f names the rule, f(x) its output at x — "f of x", never "f times x". The parentheses are application, not multiplication, and f(x) is a single object.
CasesNamed versus anonymous: f(x)=x2+1 can be referenced later by name; the bare expression x2+1 cannot — naming turns a rule into an object.
Do not confuseA product. Reading f(x) as f⋅x makes f(y)f(x) "cancel" to yx — the same cancellation error the trig abbreviations suffer.
g(t) · P(n)
g of t; P of n
The letter wardrobe: f,g,h queue up as function names, and the input letter signals context — t for time, n for counting numbers, x for a generic real. Same grammar, different costume.
CasesTwo functions in one problem take consecutive names — the f and g that feed composition; capitals mark context-laden rules (P for population, A for area), and subscripted names f1,f2 enumerate families.
Do not confuseNew mathematics. g(t)=3t−7 and f(x)=3x−7 are the same rule — renaming letters changes nothing, and treating each letter set as a new species multiplies the subject needlessly.
f(a) · f(x+1)
f at a; f of x plus one
Substitution notation: whatever sits in the parentheses replaces the variable wholesale. f(3) is a number, f(a) a value at an unspecified point, f(x+1) a new expression — Evaluating Functions below runs the mechanics.
CasesCompound inputs keep their parentheses through the substitution — f(a+2)=(a+2)2+1, brackets intact; dropping them is the order-of-operations error Evaluating Functions below warns about.
Do not confuseDistribution. f(x+1)=f(x)+1 and f(x+1)=f(x)+f(1) — the input shifts, the output does whatever the rule says; linearity is a property some functions have, not a notation rule.
Evaluating a function means finding the output for a given input. The process depends on how the function is represented.
From an equation, evaluation is substitution. To find f(5) when f(x)=2x2−3x+1, replace every x with 5:
Evaluating Functions
f(5)=2(5)2−3(5)+1=50−15+1=36
From a table, evaluation is lookup. Find the input value in one column and read the corresponding output from the other column. If the exact input is not listed, the table does not directly provide the answer.
From a graph, evaluation is geometric. Locate the input value on the horizontal axis, move vertically to the curve, then read the output from the vertical axis. Precision depends on the scale and clarity of the graph.
Evaluating with expressions as input requires careful substitution. For f(x)=x2+1, finding f(a+2) means replacing x with a+2:
Evaluating Functions
f(a+2)=(a+2)2+1=a2+4a+4+1=a2+4a+5
Pitfall: Squaring a sum term by term
Writing (a+2)2 as a2+4 gives f(a+2)=a2+5, which at a=1 is 6, not f(3)=10. The square has a middle term: (a+2)2=a2+4a+4, so f(a+2)=a2+4a+5.
The parentheses around a+2 are essential — without them, order of operations produces errors.
Once the substitution is written, the rest is ordinary algebra: the bracket is expanded and like terms are collected. The result is a new expression in a, the output of f for every input of the form a+2.
Input, Output, and Variables
The input to a function is called the independent variable — its value is chosen freely from the allowed set. The output is the dependent variable — its value depends on, and is determined by, the input.
Convention uses x for the independent variable and y for the dependent variable, so y=f(x) states that y is determined by x through the function f. But variables can be named anything. A function describing position over time might use t for time and s for position: s=f(t).
The set of all allowed inputs is the domain. The set of all possible outputs is the range. Together, domain and range describe what goes in and what comes out.
The language of dependence appears throughout applications. "Revenue depends on price." "Temperature depends on time." "Height depends on age." Each statement implies a functional relationship, with the second quantity determined by the first. Identifying which variable is independent and which is dependent is essential for setting up function models correctly.
Determining Whether a Relationship is a Function
Different representations require different tests to determine whether a relationship qualifies as a function.
From a set of ordered pairs, check for repeated inputs with different outputs. The set {(2,5),(3,7),(2,9)} is not a function because 2 appears twice with different outputs. The set {(2,5),(3,7),(4,5)} is a function — the repeated output 5 causes no problem.
From a table, examine the input column. If any input value appears more than once with different corresponding outputs, the table does not represent a function.
From a graph, apply the vertical line test. If any vertical line crosses the graph more than once, the relationship is not a function.
From an equation, consider whether solving for y yields a unique value for each x. The equation y=x2 defines a function: each x gives exactly one y. The equation y2=x does not define y as a function of x: for x=4, both y=2 and y=−2 satisfy the equation.
Pitfall: Dropping the negative root
Solving y2=x as y=x keeps one root and makes the equation look like a function. At x=9 both y=3 and y=−3 satisfy it, since y=±x; it does not define y as a function of x.
Solving for y is where the equation test is decided. What matters is how many values of y the solved form returns for a single x: exactly one for every x means a function, two or more for any x means a relation that is not a function.
From a verbal description, analyze the rule. "Assign to each person their biological mother" defines a function. "Assign to each person their sibling" does not — a person may have multiple siblings or none.
The table below collects the diagnostic in each representation along with an example of a relation that fails the test.
Representation
Diagnostic test
Example of failure
Set of ordered pairs
scan for an input that appears twice with different outputs
{(2, 5), (3, 7), (2, 9)} — input 2 maps to both 5 and 9
Table
check the input column for duplicates pointing to different outputs
x = 4 listed twice with different y-values
Graph
vertical line test — any vertical line crossing the curve more than once
unit circle x² + y² = 1 — vertical lines through the interior hit twice
Equation
solve for y and check whether each x gives a unique value
y² = x — for x = 4 both y = 2 and y = −2 satisfy
Verbal description
analyze the rule for ambiguity in the output
"assign each person their sibling" — people may have none or many
Every test, in every representation, asks the same question: does some input have more than one output?
Special Values
Certain outputs carry particular significance and receive special attention.
The zeros of a function are the input values where the output equals zero — the solutions to f(x)=0. On a graph, zeros correspond to x-intercepts, the points where the curve crosses the horizontal axis. Finding zeros is central to solving equations: the equation x2−5x+6=0 asks for the zeros of f(x)=x2−5x+6.
The y-intercept is the output when the input is zero, namely f(0). On a graph, this is the point where the curve crosses the vertical axis.
RULE
Not every function has a y-intercept — if 0 is not in the domain, f(0) does not exist.
Pitfall: Confusing zeros with the y-intercept
Answering "find the zeros of f(x)=x2−5x+6" with f(0)=6 finds the y-intercept instead. The zeros solve f(x)=0: (x−2)(x−3)=0, so x=2 and x=3.
Zeros and the y-intercept both involve setting something equal to zero, which is why they sit side by side here. For zeros, the output is set to 0 and the equation is solved for the input; for the y-intercept, the input is set to 0 and the output is computed. On a graph, the first are read on the horizontal axis, the second on the vertical one.
Undefined points are inputs where the function has no output. Division by zero, square roots of negative numbers, and logarithms of non-positive numbers all produce undefined results. The function f(x)=1/x is undefined at x=0. The function g(x)=x is undefined for x<0 when restricted to real outputs.
Identifying these special values — where the function equals zero, where it is undefined, where it crosses the axes — anchors the analysis of any function.
Functions in Context
Functions model relationships in the real world. The input and output carry units, the domain reflects physical constraints, and the function values have practical meaning.
A function C(n) might give the cost in dollars to produce n items. Here n must be a non-negative integer (or non-negative real, if fractional production makes sense), and C(n) represents actual currency. The statement C(100)=450 means producing 100 items costs 450 dollars.
A function d(t) might give the position in meters, measured from the starting point, after t seconds. The domain might be [0,10] if the motion is observed for ten seconds. The zeros of d indicate when the object is at the starting position. The range indicates how far from the start the object gets.
Pitfall: Reading function values backwards
Reading d(4)=12 as "after 12 seconds the object has gone 4 meters" swaps input and output. The input sits inside the parentheses, t=4 seconds; the output is the distance, 12 meters.
Interpreting functions in context means translating between mathematical statements and real-world meaning. What does f(5)=20 mean? What does it mean for the function to be increasing? What real-world constraint limits the domain?
Context also imposes restrictions absent from pure mathematics. Time cannot be negative, populations must be non-negative integers, percentages lie between 0 and 100. These constraints shape the domain when functions model reality.
Common Pitfalls
Six mistakes come up again and again in first work with functions. Five are marked where they happen in the sections above; rejecting a shared output is the one that What is a Function already points out. Here each is worked through in full, with the wrong and the right working side by side.
Rejecting a shared output
When checking whether a rule is a function, two inputs with the same output are counted as a violation. The definition restricts each input to one output; it says nothing against an output being reached more than once.
Wrong working: for f(x)=x2, f(2)=4 and f(−2)=4, so one output comes from two inputs and f is declared not a function.
Right working: each input has exactly one output, 2↦4 and −2↦4, so f is a function. In the same way {(2,5),(3,7),(4,5)} is a function even though 5 appears twice.
Why it happens: the condition is remembered as "one input, one output" and then applied in both directions. The two-way version is a different, stronger property, being one-to-one, which matters later for inverses.
How to check: look only for a repeated input with different outputs. Repeated outputs never decide the question.
Testing with horizontal lines
The line test is run with horizontal lines instead of vertical ones. A horizontal line collects points with the same y-value, so two crossings mean two inputs share one output, which a function is allowed to do.
Wrong working: the line y=4 meets y=x2 at (−2,4) and (2,4); two crossings, so the graph is rejected.
Right working: a vertical line x=c meets y=x2 only at (c,c2), one point for every c, so y=x2 is a function.
Why it happens: the horizontal line test looks the same and is taught soon after, as the test for one-to-one functions.
How to check: ask what the line holds fixed. A vertical line fixes the input x, and the definition of a function is a statement about one input at a time.
Squaring a sum term by term
When a function is evaluated at an expression, the substitution is done correctly but the bracket is expanded as if (a+2)2 were a2+22.
Wrong working: f(a+2)=(a+2)2+1=a2+4+1=a2+5.
Right working: (a+2)2=(a+2)(a+2)=a2+2a+2a+4=a2+4a+4, so f(a+2)=a2+4a+5.
Why it happens: squaring does pass through products, (2a)2=4a2, and the same move is carried over to sums, where it fails.
How to check: substitute a number. At a=1 the input is 3 and f(3)=32+1=10; the right result gives 1+4+5=10, the wrong one gives 1+5=6.
Dropping the negative root
To test an equation, it is solved for y, but an even root is taken with only its positive value, so the equation seems to give one y per x.
Wrong working: y2=x gives y=x, one value for each x, so the equation is declared a function.
Right working: y2=x gives y=±x. At x=9 both y=3 and y=−3 satisfy y2=9: one input, two outputs, so y is not a function of x. The equation y=x on its own is a function; it describes only the upper half of the curve.
Why it happens: the radical sign means the non-negative root, so writing x quietly discards the second solution.
How to check: pick one x>0 and substitute both candidate values of y into the original equation. If both work, the equation is not a function of x.
Confusing zeros with the y-intercept
Both ideas involve zero. Asked for the zeros, f(0) is computed, which sets the input to zero instead of the output.
Wrong working: for f(x)=x2−5x+6, f(0)=0−0+6=6, so the zero is given as 6.
Right working: solve x2−5x+6=0. Factoring gives (x−2)(x−3)=0, so x=2 or x=3; indeed f(2)=4−10+6=0 and f(3)=9−15+6=0. The value 6 is the y-intercept, the point (0,6).
Why it happens: the word "zero" appears in both definitions, once for the output and once for the input.
How to check: a zero is an input, and substituting it must give 0. Here f(6)=36−30+6=12, not 0, so 6 is not a zero.
Reading function values backwards
In a statement such as d(4)=12 from a real context, the two numbers are swapped: the output is read as the input and the other way round.
Wrong working: d(4)=12 is read as "after 12 seconds the object has gone 4 meters", which is the statement d(12)=4.
Right working: the number inside the parentheses is the input, t=4 seconds, and the value of the function is the output, 12 meters. So after 4 seconds the object has gone 12 meters. In the same way C(100)=450 says that 100 items cost 450 dollars.
Why it happens: in everyday speech the quantity being asked about often comes first, and once both are plain numbers nothing on the page says which is which.
How to check: attach the units. The input of d is measured in seconds and its output in meters, so d(4)=12 reads "at 4 seconds, 12 meters". The domain helps too: if the motion is observed on [0,10], a time of 12 seconds is not even an allowed input.
The Landscape of Function Topics
The concept of function branches into interconnected topics, each exploring a different aspect of how functions behave and how they relate to one another.
Domain and range describe what goes in and what comes out — the allowed inputs and the resulting outputs.
Graphs provide visual representation, turning algebraic rules into geometric objects that can be seen, traced, and compared.
Analyzing functions means systematically describing behavior: where the function increases, where it decreases, where it reaches extreme values.
Properties characterize functions by their features — symmetry, monotonicity, boundedness, continuity, and more.
Arithmetic combines functions through addition, subtraction, multiplication, and division, building new functions from existing ones.
Transformations shift, stretch, compress, and reflect graphs, showing how changes to the formula affect the picture.
Composition chains functions together, using the output of one as the input to another.
Inverse functions reverse the process, recovering input from output when such reversal is possible.
Piecewise functions use different rules on different intervals, capturing relationships that change behavior at boundaries.
Function families group functions by shared structure — linear, quadratic, exponential, and others — each with characteristic shapes and properties.
The table below gives the same listing in scannable form, with a link to the dedicated page for each topic — useful as navigation or as a study reference when arriving at this hub from elsewhere.
Domain and range come first: what goes in and what comes out. The rest build on them.
The function topics in four groups·/functions/basicsLearn Math Class
Functions FAQ
Does f(x) mean f multiplied by x?
+
No. The brackets signal function application, not multiplication: f(x) names the output produced when x is fed in. Reading it as a product is one of the most persistent beginner errors, and it makes expressions like f(x + 2) look as though they can be expanded. They cannot; the whole of x + 2 is the input.Read more →
Can one input give two different outputs?
+
No, and this is the entire rule that separates functions from relations. Each input must produce exactly one output. A rule assigning two values to a single input is still a relation, but it is not a function. Nothing else about the assignment matters, including whether it can be written as a formula.Read more →
Can two different inputs give the same output?
+
Yes. Functions restrict outputs per input, not inputs per output. Squaring sends both 3 and −3 to 9, and that is perfectly legitimate. Only when a function never repeats an output is it called one-to-one, which is a stronger and separate condition needed for inverses to exist.Read more →
What is the difference between the independent and dependent variable?
+
The independent variable is the input you choose freely, usually written x. The dependent variable is the output the rule produces, usually written y or f(x), and its value depends on the choice made. Which is which is a statement about the direction of the relationship, not about the letters used.Read more →
Is a circle the graph of a function?
+
No. A vertical line through the inside of a circle meets it twice: on x2+y2=4 the line x=1 hits y=3 and y=−3, so one input has two outputs. Cutting the circle along the x-axis fixes this. The upper half y=4−x2 and the lower half y=−4−x2 each pass the vertical line test and are functions.Read more →
Does every function have a formula?
+
No, almost none do. A formula is a finite string of symbols, so all formulas can be listed one after another, but the functions from R to R are far too many to list. Nearly every function pairs inputs with outputs in a way no formula can write. A table, a graph or a rule in words, such as each person → their birthday, defines a function just as well.Read more →
Is f(x + 1) the same as f(x) + 1?
+
No, not in general. f(x+1) feeds the new input x+1 into the rule, while f(x)+1 runs the rule on x and adds 1 to the result. For f(x)=x2+1, f(x+1)=(x+1)2+1=x2+2x+2, but f(x)+1=x2+2, and the two agree only at x=0. The brackets mean application, so nothing distributes over them.Read more →