Functions
A function is one of the most powerful ideas in all of mathematics: a reliable machine that takes an input, does something definite to it, and hands back exactly one output. Feed it the same input tomorrow and you get the same answer. That reliability is what lets us describe how one quantity depends on another — how a car's distance depends on time, how a phone bill depends on data used, how the area of a circle depends on its radius.
Once you learn to see the world in terms of functions, algebra stops being a bag of tricks and becomes a language for describing relationships. This page will build the idea carefully — from the plain-English "rule" to the precise definition, the notation, domain and range, how to read graphs, and how to bend and slide graphs with transformations.
Learning Objectives
By the end of this page, you should be able to:
- Define a function as an input-output relation with exactly one output per input.
- Use function notation fluently: evaluate, substitute, and interpret it.
- Find the domain and range of a function from a formula or a graph.
- Apply the vertical line test to decide whether a graph represents a function.
- Read information off a graph (intercepts, values, where it increases or decreases).
- Predict how shifts, stretches, and reflections change a graph and its equation.
Quick Answer
A function is a rule that assigns to each input exactly one output. We usually write it , read "f of x," where is the input and is the resulting output. The set of allowed inputs is the domain; the set of outputs actually produced is the range. The defining condition — one output per input — is what the vertical line test checks on a graph: if any vertical line crosses the graph more than once, it is not a function. Simple changes to a formula move its graph in predictable ways: shifts it up, shifts it right, and a factor in front stretches it. Master these and you can understand almost any curve you meet.
Where It Came From
The word "function" was born from a very practical need: calculus. In the late 1600s, Gottfried Wilhelm Leibniz was studying curves and needed a word for quantities that changed along with a moving point — the length of a tangent, the slope, the area swept out. Around 1673 he used functio (Latin for "performance" or "carrying out") to name such varying quantities. At that stage a "function" was tied to geometry, not yet a clean abstract rule.
The person who turned it into an everyday tool was Leonhard Euler. In the 1700s Euler introduced the notation and treated a function as an analytic expression — a formula built from a variable using arithmetic, powers, roots, logarithms, and so on. This is the intuition most students start with: "a function is a formula." Euler's notation was so convenient that physics and engineering adopted functions as the native language for describing motion, heat, and forces.
But a crisis arrived in the early 1800s. Studying how heat spreads, Joseph Fourier claimed that even jagged, discontinuous shapes could be built from sums of sine waves. That forced mathematicians to ask: does a function have to be a single tidy formula? In 1837 Peter Gustav Lejeune Dirichlet gave the answer we still use today. A function, he said, is simply any rule that pairs each input with exactly one output — no formula required. His famous example assigns to every rational number and to every irrational number, a "function" impossible to draw yet perfectly well-defined.
This is the deep point: the modern definition was not invented for elegance but forced into existence by the needs of calculus and physics. We needed a concept general enough to include wild objects, and precise enough to reason about. That is exactly what "one input, one output" delivers.
The Core Idea: One Input, One Output
Picture a vending machine. You press B4 and you always get the same snack. You never press one button and receive two different snacks depending on the machine's mood. That "always the same result for the same button" property is the function property.
Formally, a function from a set (the domain) to a set assigns to each element in exactly one element in . Two things can go wrong and disqualify a relation from being a function:
- An input produces no output (the machine jams for that button) — then that input simply is not in the domain.
- An input produces two outputs (one button, two different snacks) — this is fatal; it is not a function at all.
Note the rule is not symmetric. Two different inputs are allowed to share the same output. In , both and give . That is fine — many buttons may dispense the same snack. What is forbidden is one button giving two snacks.
Worked example — testing a relation. Consider the set of pairs , written as (input, output). Is this a function?
Look at the input . It appears twice, paired once with and once with . One input, two outputs — so this is not a function. If we deleted the pair , the remaining set would be a function, because every input now has a single output.
Function Notation, Evaluation, and Domain and Range
The notation names three things at once: the function (), the input (), and the output (the whole symbol ). Crucially, does not mean multiplied by ; it means "the value produces from ."
To evaluate, substitute the input everywhere appears.
Worked example — evaluating. Let .
You can substitute expressions too:
Let me check that middle step: , then gives . Adding: . Correct.
Domain is the set of legal inputs; range is the set of outputs you actually get. When a formula is given without extra context, we take the domain to be every real number for which the formula makes sense. Two operations commonly break:
- Division by zero — the denominator may not be .
- Even roots of negatives — the inside of a square root must be (over the real numbers).
Worked example — finding a domain. Find the domain of .
The square root needs , so . The denominator needs , so . Combining: the domain is all with except . In interval form, .
Worked example — finding a range. Find the range of . Since for every real , the smallest value of is (at ), giving . As moves away from , grows without bound. So the outputs are all numbers ; the range is .
Reading Graphs and the Vertical Line Test
A graph of is the picture of all pairs . Because a function has one output per input, no vertical line can hit the graph twice — every gets one height. This gives us the vertical line test: if you can draw a vertical line that crosses a curve at two or more points, the curve is not the graph of a function.
Worked example — the circle. The circle is not a function of . At the equation gives , so and . A vertical line at hits the circle at and — two outputs, test failed. The upper half alone, , is a function, because we chose the single non-negative output.
Reading a graph, you can extract a lot without any formula:
- Value at a point: to find , go to on the horizontal axis, move up or down to the curve, and read the height.
- Zeros / x-intercepts: where the curve crosses the x-axis, .
- y-intercept: the height at , i.e. .
- Increasing / decreasing: where the curve rises left-to-right the function is increasing; where it falls it is decreasing.
Worked example — reading values. Suppose a graph passes through , , and , rising after . Then (the y-intercept), is a zero because , and the function is increasing on the interval from to since the height climbs from to .
Transformations: Shifting, Stretching, Reflecting
Once you know the graph of a basic function, you can produce whole families of related graphs by simple edits to the formula. Let be the original. Here are the moves (with ):
| Change to formula | Effect on graph | Direction |
|---|---|---|
| vertical shift | up by | |
| vertical shift | down by | |
| horizontal shift | right by | |
| horizontal shift | left by | |
| , | vertical stretch | taller by factor |
| , | vertical compression | shorter |
| reflection | across the x-axis | |
| reflection | across the y-axis |
The one that trips everyone up is horizontal shifts: moves right, even though it looks like subtraction. The reason: to get the same output the original had at input , you now need , i.e. — the feature has moved to the right.
Worked example — building a parabola. Start with , whose vertex is at the origin. Consider . Read it as three edits to : replace by (shift right ), multiply by (stretch vertically, twice as steep), then add (shift up ). The vertex moves from to .
Check with a point. At : . That is the point , which sits unit right of the vertex and units up — exactly what a right-shift-by-3, stretch-by-2, up-by-1 predicts (on the parent, one unit right of the vertex rises ; doubled gives ). Consistent.
Real-World Applications
- Physics — motion: Position as a function of time, , is the backbone of kinematics. Its rate of change (a derivative) is velocity — the very problem that made Leibniz coin the word.
- Economics — cost and revenue: A cost function gives total cost for producing units; profit is revenue minus cost, another function. Finding where profit is largest is an optimization of a function.
- Medicine — drug dosing: Concentration of a drug in the blood is a function of time, often decaying exponentially. Domain restrictions matter: negative time is meaningless.
- Computing: Every function you write in code (
f(x)) is this exact idea — deterministic input to output. "Pure functions" in programming are literally mathematical functions. - Everyday life: Currency conversion, a taxi's fare as a function of distance, or the temperature reading as a function of the time of day are all functions you use without naming them.
Common Mistakes
-
Thinking means times . It does not. is a single quantity, the output of at . Writing is usually wrong: for , but . Always substitute the whole input into the formula.
-
Confusing "one input, one output" with "one output, one input." Functions forbid one input giving two outputs, but they happily allow two inputs sharing one output. sends both and to , and it is still a perfectly good function. Do not reject it.
-
Shifting horizontally the wrong way. Students read and shift left because of the minus sign. It shifts right. Anchor yourself with a point: the feature that was at now needs , so it lives at — to the right.
-
Forgetting to restrict the domain. With people happily plug in and get nonsense. Always scan for division by zero and even roots of negatives before declaring the domain "all reals."
Comparison and Connections
| Concept | What it is | Function? |
|---|---|---|
| Function | Each input has exactly one output | Yes, by definition |
| Relation | Any set of input-output pairs | Not always |
| Equation | A statement two expressions are equal | Sometimes defines a function |
| Expression | A formula with no equals sign, e.g. | Becomes a function when named |
A relation is the broader idea: any pairing of inputs and outputs. Every function is a relation, but not every relation is a function — the circle is a relation that fails the vertical line test. An equation like often defines a function (here ), but an equation like does not define as a single function of . Functions connect forward to composition and inverses, and they are the object that calculus differentiates and integrates.
Practice Questions
Recall
State the defining property of a function in one sentence, and say what "domain" means.
Answer: A function assigns to each input exactly one output. The domain is the set of all allowed inputs.
Understanding
Is a function? Explain.
Answer: No. The input is paired with both and — one input, two outputs — so it fails the definition. (The fact that and share the output is fine and irrelevant.)
Application
For , find the domain and compute .
Answer: The denominator is zero at and , so the domain is all reals except . Then .
Analysis
The graph of is transformed into . Describe every transformation and give the vertex.
Answer: Replace by : shift left . Multiply by : vertical compression (flatter). The minus sign: reflect across the x-axis (opens downward). The vertex moves from to . Check: , confirming the vertex at .
FAQ
Is every equation a function? No. An equation defines a function only if solving for gives exactly one for each . does; does not, because it gives two -values for many .
Can a function have two inputs give the same output? Yes, absolutely. That is allowed and common — sends and both to . The only forbidden thing is one input giving two outputs.
What is the difference between range and codomain? The codomain is the set we declare the outputs live in (say, all real numbers). The range is the set of outputs actually achieved. The range is always inside the codomain, and may be smaller — has codomain but range .
Why do horizontal shifts go the "wrong" way? Because the input is transformed, not the output. To reproduce the value the graph had at input , you now need , forcing — so features slide right. It feels backwards because we are compensating for a change inside the function.
Does a function have to be given by a formula? No — that was the whole point of Dirichlet's definition. A function is any rule pairing each input with one output. It can be a formula, a graph, a table, or even a verbal rule like "round to the nearest integer."
How do I quickly tell if a graph is a function? Use the vertical line test: imagine sweeping a vertical line across the graph. If it ever touches the curve at two points at once, it is not a function.
Quick Revision
- Function: each input → exactly one output. One input, two outputs = not a function.
- Notation: is the output at , not multiplication.
- Evaluate: substitute the whole input everywhere appears.
- Domain: legal inputs. Watch for division by zero and even roots of negatives.
- Range: the outputs actually produced.
- Vertical line test: a vertical line hitting the graph twice ⇒ not a function.
- Transformations: up; right; stretch; flip over x-axis; flip over y-axis.
- History: Leibniz named it (~1673), Euler gave , Dirichlet (1837) defined the modern "any rule" version.