Function Definition
Textbook Reference
| Primary source | OpenStax Calculus Volume 1, Section 1.1: “Review of Functions” |
| Book URL | https://openstax.org/details/books/calculus-volume-1 |
Freely available and openly licensed.
Try This First: A Machine with a Rule
A vending machine: you press a button (input), and one specific item comes out (output). The same button always produces the same item.
Now imagine a broken machine: you press B2 and sometimes get chips, sometimes get a granola bar. That is NOT a function -- one input gives multiple possible outputs.
Predict: Is the rule “assign each student their test score” a function? Is “assign each student their siblings” a function if students can have multiple siblings?
Think about these before reading the formal definition.
Quantity-First Framing
A function is a process that takes an input and gives back exactly one output. The “exactly one” is the core requirement. Given the input, the output is determined -- no ambiguity, no randomness, no choices.
Prerequisite Check
Quick Reference
Definition. A function $f$ from a set $A$ to a set $B$ is a rule that assigns to each element of $A$ exactly one element of $B$.
- Domain of $f$: the set $A$ -- all valid inputs.
- Range of $f$: the set of all outputs $f(x)$ as $x$ ranges over the domain.
- Codomain: the set $B$ (the range is contained in the codomain).
Vertical line test. A graph in the $xy$-plane represents $y$ as a function of $x$ if and only if every vertical line intersects the graph in at most one point.
Key Concepts
1. The Process View of a Function
A function $f$ is a process: input $x$ enters, the process is applied, output $f(x)$ exits. The notation $y = f(x)$ reads: “$y$ equals $f$ of $x$,” meaning $y$ is the output when $x$ is the input.
Example 1. $f(x) = 3x^2 - 1$.
| Input $x$ | Process | Output $f(x)$ |
|---|---|---|
| 2 | $3(4) - 1$ | 11 |
| $-1$ | $3(1) - 1$ | 2 |
| 0 | $3(0) - 1$ | $-1$ |
Each input gives exactly one output. This is a function.
Non-example. The rule $y^2 = x$: for $x = 4$, both $y = 2$ and $y = -2$ satisfy $y^2 = 4$. One input ($x = 4$) gives two outputs. Not a function.
2. Two Representations: Arrow Diagram and Graph
Arrow diagram. Draw two ovals: one for the domain (inputs), one for the range (outputs). Draw arrows from each input to its output. A function: each input has exactly one arrow leaving it.
Graph. Plot all $(x, f(x))$ pairs. The vertical line test: if a vertical line crosses the graph more than once, the graph represents a multi-valued relation -- not a function.
Translation prompt. For the graph of a circle $x^2 + y^2 = 4$: does it pass the vertical line test? No -- the line $x = 1$ crosses the circle at $(1, \sqrt{3})$ and $(1, -\sqrt{3})$. The circle is NOT a function $y = f(x)$.
3. Domain and Range
Domain. The natural domain is all input values for which the formula makes sense:
- No division by zero.
- No even root of a negative number.
- No logarithm of zero or a negative number.
| Function | Excluded inputs | Natural domain |
|---|---|---|
| $f(x) = \sqrt{x}$ | $x < 0$ | $[0, \infty)$ |
| $f(x) = 1/x$ | $x = 0$ | $(-\infty, 0) \cup (0, \infty)$ |
| $f(x) = \ln x$ | $x \leq 0$ | $(0, \infty)$ |
| $f(x) = x^2$ | none | $(-\infty, \infty)$ |
Range. The range is all actual outputs. Finding the range requires understanding what values $f(x)$ can take.
For $f(x) = x^2$: all outputs are $\geq 0$, so range $= [0, \infty)$. For $f(x) = \sin x$: range $= [-1, 1]$.
4. Ask Why: Why Does “Exactly One Output” Matter?
If a “function” could produce two different outputs for the same input, then $f(2) = 3$ and $f(2) = 5$ would both be valid -- a contradiction. Equations involving $f$ would have inconsistent solutions. The “exactly one” rule is not bureaucratic; it makes functions well-defined and equations solvable.
This is why the vertical line test works: a vertical line at $x = a$ shows all possible outputs at $x = a$. If there are two intersection points, the rule assigns two outputs to $a$ -- not a function.
Named Misconception: action-view-of-function
Students sometimes think of a function only as a formula: “$f$ is the formula $3x^2 - 1$.” This “action-view” misses that:
- A function can be defined by a table, a graph, or words -- not only by a formula.
- The formula is the rule; the function is the rule-plus-domain-plus-range package.
- Two different formulas can define the same function if they give the same outputs on the same domain.
One way to see the error breaks: $f(x) = x^2$ and $g(x) = |x|^2 \cdot (x^2/x^2)$ agree on every $x \neq 0$. Are they the same function? If the domain is all real numbers, no -- $g$ is undefined at $x = 0$ while $f$ is defined there. The domain is part of the function definition.
Common Errors
| Error | Specific example | Correction |
|---|---|---|
| Thinking every equation defines a function | $y^2 = x$ defines $y$ as a function of $x$ | Check: does each $x$ give exactly one $y$? For $x = 1$, $y = \pm 1$: two outputs, not a function |
| Confusing range and codomain | “Range of $\sin x$ is $\mathbb{R}$” | Range is $[-1, 1]$; codomain ($\mathbb{R}$) is the target set |
Common Misconceptions
a function is a formula or a sequence of steps to compute.
This is the action-view-of-function error. A function is a pairing rule that assigns to each input exactly one output -- it does not need a formula. A table of (day, high temperature) readings defines a valid function even with no algebraic rule. What makes it a function is the one-output-per-input property, not the presence of a computation procedure.
any smooth, connected graph represents a function.
This is the concept-image-conflicts-definition error. A smooth appearance is not the criterion; one-output-per-input is. A circle looks smooth and connected but fails the vertical line test: the vertical line $x = 0$ passes through both $(0, 1)$ and $(0, -1)$, giving two outputs for one input. The vertical line test is the definition in graphical form, not a visual rule of thumb.
Leveled Practice
Level 1 -- Is It a Function?
Problem 1. For each rule, determine whether it defines a function from $x$ to $y$.
(a) $y = x^2 - 3$. (b) $x = y^2$. (c) The rule: assign to each positive integer its prime factors.
Show answer
(a) Each $x$ gives exactly one $y = x^2 - 3$. Function.
(b) For $x = 4$: $y = \pm 2$. Two outputs. Not a function ($y$ is not a function of $x$).
(c) $12 \to \{2, 3\}$, $15 \to \{3, 5\}$. Each input gives a SET of primes. If the output is required to be a single prime, not a function. If the output is allowed to be a set, it is a function into the power set of primes.
Problem 2. Find the natural domain of $f(x) = \dfrac{x+1}{\sqrt{x-2}}$.
Show answer
Need $x - 2 > 0$ (square root defined and denominator nonzero): $x > 2$. Domain: $(2, \infty)$.
Level 2 -- Domain and Range
Problem 3. For $f(x) = -x^2 + 4$: state the domain and range.
Show answer
Domain: $(-\infty, \infty)$ (all real numbers). Range: the function has maximum $f(0) = 4$ and decreases without bound. Range: $(-\infty, 4]$.
Level 3 -- Low-Floor-High-Ceiling Extension
Problem 4 (Extension).
(a) (Floor) Is the graph of $x^2 + y^2 = 9$ a function? Can you split it into two functions?
(b) (Mid) Give an example of two different formulas that define the same function on $[0, \infty)$.
(c) (Ceiling) A function $f: A \to B$ is called injective (one-to-one) if different inputs give different outputs: $f(x_1) = f(x_2) \Rightarrow x_1 = x_2$. Is $f(x) = x^2$ injective on all of $\mathbb{R}$? On $[0, \infty)$?
Show answer
(a) No (fails vertical line test). Split: $f(x) = \sqrt{9-x^2}$ (upper semicircle, $y \geq 0$) and $g(x) = -\sqrt{9-x^2}$ (lower semicircle, $y \leq 0$). Both are functions on $[-3, 3]$.
(b) $f(x) = \sqrt{x^2} = x$ on $[0, \infty)$ and $g(x) = x$ on $[0, \infty)$ are the same function.
(c) Not injective on $\mathbb{R}$: $f(-2) = f(2) = 4$, so two different inputs give the same output. Injective on $[0, \infty)$: if $x_1, x_2 \geq 0$ and $x_1^2 = x_2^2$, then $(x_1 - x_2)(x_1 + x_2) = 0$; since both are non-negative, $x_1 = x_2$.
Mastery Checklist
Mental Model
A function is a reliable machine: the same input always produces the same output. No randomness, no ambiguity. The domain is the set of allowed inputs; the range is the set of all outputs the machine produces.
The vertical line test detects unreliability: if one input can produce two outputs, the machine is broken (not a function).
Thinking of a function as a process -- not just a formula -- opens the door to representing functions as tables (discrete data), as graphs (visual), or as formulas (algebraic). All four representations describe the same underlying idea.
Connections
Within MATH161
- Domain restrictions: Understanding the domain is essential for limits (the limit asks about $x$ near $a$, where $f$ must be defined) and for implicit functions.
- Derivative: The derivative $f'(a)$ is itself a number -- the output of the derivative function at input $a$. Thinking of functions as processes makes this natural: $f'$ is a new function built from $f$.