Mathematics · Article
Functions, domains and ranges
Describe a function as a rule assigning exactly one output to every declared input. Read notation, tables and graphs; distinguish the chosen domain, the declared output target and the outputs actually attained; and justify exact domains and ranges for familiar real formulas.
Useful background article: Word problems, constraints and checking solutions
Back to MathematicsAfter reading, you can
- Identify the input and output of a function, evaluate function notation and test whether every declared input has exactly one output.
- Distinguish a function's domain, its declared output target and its actual range, including formula restrictions and narrower context domains.
- Use tables, graphs and algebra together, and prove complete ranges for simple square, square-root and reciprocal rules instead of relying on a few sampled values.
A function gives every declared input exactly one output
A function pairs each input in its declared domain with exactly one output. Think of an input, a specified rule and the resulting output. For the rule double the input and add 1, input 3 gives output 7. The rule must determine an output for every input it declares, and it cannot assign two different outputs to the same input.
Different inputs may share an output. The square rule gives both input −2 and input 2 the output 4, and it is still a function: each input has its own single answer. Inputs can also be labels rather than numbers. A fixed list assigning one delivery zone to each parcel code can define a function without an algebraic formula. Decide what the input is before testing uniqueness; reversing the direction can change the answer.
Read f(x) as the output at input x
In y = f(x), f names the function, x names its input and y is the corresponding output. Read f(x) as f of x. The parentheses indicate the input to the rule; f(x) does not mean f multiplied by x. For f(x) = 2x + 1, evaluating f(−3) means replacing x with −3 everywhere: 2(−3) + 1 = −5.
The input is often called the independent variable and the output the dependent variable, because the rule determines the output once a permitted input is chosen. These names describe their roles; they do not by themselves establish cause and effect in a real situation. The input letter is a placeholder: writing f(t) = 2t + 1 describes the same rule if the domain is unchanged. An expression can be an input too: f(a + 1) = 2(a + 1) + 1 = 2a + 3, whenever a + 1 is permitted.
Separate permitted inputs, the output target and actual outputs
The domain is the complete collection of permitted inputs. The range is the complete collection of outputs actually produced as those inputs run through the rule. List repeated outputs only once when describing a range. A table with inputs −2, 0 and 2 and outputs 4, 0 and 4 has domain {−2, 0, 2} and range {0, 4}. Braces here enclose a list of distinct values, rather than an interval between its endpoints.
A definition may also declare an output target, called the codomain: a collection in which all the outputs must lie. The target need not be fully reached. If that table declares the target {0, 4, 9}, it still produces only 0 and 4; 9 belongs to the target but not to the range. Similarly, the square rule with all real inputs can have all real numbers as its target even though its range contains only nonnegative real numbers. In this lesson, range always means the outputs actually attained.
| Part | Question it answers | Finite square-rule example |
|---|---|---|
| Domain | Which inputs are permitted? | {−2, 0, 2} |
| Output target (codomain) | Where are the outputs declared to belong? | {0, 4, 9} |
| Range | Which outputs does the rule actually produce? | {0, 4} |
Check both coverage and uniqueness in a complete table
A relation records input–output pairings; being a function requires a further check. For a table stated to be the complete definition on domain {−2, 0, 2}, inspect all three declared inputs. The pairs (−2, 4), (0, 0) and (2, 4) pass: every declared input appears with exactly one output, even though 4 is shared. Repeating the identical pair (2, 4) adds no second output; adding (2, 9) does.
If the complete table omits input 2, it fails to define a function on the declared domain {−2, 0, 2}. The two remaining pairs can define a function on the smaller domain {−2, 0}; changing the domain changes the claim. Distinguish a complete finite definition from a sample table drawn from a wider rule. A missing sample row does not show that the wider function is undefined there, and a few successful sample rows do not prove the wider rule is a function.
Use vertical lines to test output uniqueness
A point (x, y) on a function's graph says that input x produces output y. A vertical line fixes one input x. If it contains two distinct graph points, that input has two different outputs, so the graph cannot represent y as a function of x. This is the vertical line test. For a stated domain, there must also be a graph point at every declared input: passing the uniqueness test alone does not fill an omitted input.
A horizontal line fixes an output, not an input. It may meet a function graph more than once: the line y = 4 meets y = x² at x = −2 and x = 2 without violating the function rule. The full graph's horizontal extent describes the domain and its vertical extent describes the range, including endpoint inclusions and any gaps. A cropped plotting window or a few plotted points may show only part of those collections; use the stated definition and algebra to establish the complete answer.
A formula's available inputs may exceed a problem's domain
Unless a narrower domain is stated, an elementary real formula is usually considered on its natural real domain: all real inputs at which the original expression gives a defined real output. Addition, multiplication and squaring permit every real input, so f(x) = x² and g(x) = 2x + 1 each have all real numbers available. Here real numbers include whole numbers, fractions and irrational values such as √2.
The domain is part of the function's definition, however. If C(n) = 3n + 2 models the euro cost of n items for orders of at most five items, its stated context might allow only n = 0, 1, 2, 3, 4, 5. Its range is then {2, 5, 8, 11, 14, 17}, not every real number. The formula can be calculated at n = 1/2 or n = 8, but those inputs are outside that model's domain. Being excluded by a chosen domain is different from making a formula undefined.
Find restrictions in the original real formula
Division requires a nonzero denominator. Thus r(x) = 1/x has natural real domain x ≠ 0, while p(x) = 1/(x − 3) excludes x = 3. Inspect every original denominator, including restrictions that would disappear after cancellation. For (x² − 1)/(x − 1), the original formula still excludes x = 1 even though it equals x + 1 at every permitted input.
A real square root requires its radicand, the expression under the root, to be nonnegative. For s(x) = √(x − 1), solve x − 1 ≥ 0, obtaining x ≥ 1. Zero is allowed under a root: s(1) = 0. But 1/√(x − 1) requires x > 1 because the root is also a denominator. Combine all restrictions when several operations occur. A valid function domain may be narrower than these conditions, but it cannot include an input at which its original real formula is undefined.
| Formula | Domain condition | Boundary check |
|---|---|---|
| x² | All real x | Zero and negative inputs are allowed |
| 1/x | x ≠ 0 | At zero the denominator is zero |
| √(x − 1) | x ≥ 1 | At 1 the output is zero |
| 1/√(x − 1) | x > 1 | At 1 the denominator is zero |
Prove both directions of a claimed range
To establish a complete range, show both that every output obeys the claimed restriction and that every value allowed by that restriction is actually produced. For f(x) = x² on all real inputs, every output is nonnegative. Conversely, for any real y ≥ 0, choose x = √y. This input is allowed and x² = y. Therefore the exact range is all real y ≥ 0. Checking outputs 0, 1 and 4 alone would miss, for example, output 2 at input √2.
For q(x) = (x − 2)² + 1 on all real inputs, the square is nonnegative, so q(x) ≥ 1, with q(2) = 1. To attain an arbitrary y ≥ 1, choose x = 2 + √(y − 1). Then (x − 2)² + 1 = y, proving that the exact range is y ≥ 1. This argument uses the given expression directly. Reaching a minimum does not by itself prove that every larger value is reached; the constructed input supplies that second part.
Use permitted inputs to establish root and reciprocal ranges
For s(x) = √(x − 1) on x ≥ 1, every output is nonnegative because √ denotes the principal, nonnegative root. Given any y ≥ 0, the input x = y² + 1 is at least 1 and produces √(y²) = y. Thus the exact range is y ≥ 0. A negative proposed output, such as −1, fails even though squaring it gives an algebraic input candidate: x = 2 produces +1, not −1.
For r(x) = 1/x on x ≠ 0, the output cannot equal zero: 1/x = 0 would imply 1 = 0 after multiplying by the permitted nonzero x. Conversely, any real y ≠ 0 is attained by choosing x = 1/y, which is nonzero and gives 1/(1/y) = y. The exact range is all real y except zero. Neither a large graph window nor many nonzero sample outputs establishes that complete statement on its own.
Recheck the range when the domain is restricted
Restrict the square rule to the closed interval −2 ≤ x ≤ 3. A closed interval includes both endpoints and every real value between them. Throughout this domain, |x| ≤ 3, so 0 ≤ x² ≤ 9. The lower value 0 is attained at x = 0 and the upper value 9 at x = 3. To prove that there are no missing values between them, take any y with 0 ≤ y ≤ 9 and choose x = √y. Then 0 ≤ x ≤ 3, so this input belongs to the stated domain and produces y. The exact range is 0 ≤ y ≤ 9.
If instead the domain is 1 ≤ x < 3, every square output satisfies 1 ≤ y < 9. Every y in that interval is attained at x = √y, which satisfies 1 ≤ x < 3. The range is therefore 1 ≤ y < 9: 1 is included and 9 is excluded. Carry endpoint conditions through the proof. A domain containing only the three inputs −2, 0 and 3 would instead have the finite range {0, 4, 9}; it would not contain all intermediate outputs.
Compare an independent input and output with the full definition
The explorer offers seven cases: the complete finite table with pairs (−2, 4), (0, 0), (2, 4); that table with the extra pair (2, 9); that table with input 2 omitted; the square rule on all real inputs; the square rule on −2 ≤ x ≤ 3; √(x − 1) on x ≥ 1; and 1/x on x ≠ 0. Each finite case declares inputs {−2, 0, 2} and output target {0, 4, 9}. Check coverage and uniqueness separately before treating a finite case as a function on that declared domain.
Choose an input and a proposed output independently. The input check asks whether that input is permitted and what it produces; the output check asks whether any permitted input produces the proposed output. The proposed output need not equal the output at your selected input. A finite list of controls can inspect exact examples but cannot represent every real possibility. Use the complete table for a finite relation and the algebraic range proofs for real formulas; distinguish an undefined formula input, an input excluded by the chosen domain and an output that is never reached.
Check inputs, outputs and the whole range
Choose a table or formula, then choose an input and a proposed output independently. An input check asks what this input produces. A range check asks whether any allowed input produces the proposed output.
Declared domain: A = {−2, 0, 2}.
Codomain: B = {0, 4, 9}. Actual range: {0, 4}.
In f(x), f names the function and x is its input. The parentheses mean that the function is evaluated at x; they do not mean multiplication. Every input in the declared domain must have exactly one output. Different inputs may share an output.
The codomain is the declared target set. The range contains the values actually produced from the domain. A codomain value can be unused. Here every formula has real codomain, even when its range is smaller.
Does this define a function on the declared domain? Yes: every declared input has exactly one output.
The inputs −2 and 2 both produce 4. This is permitted: each input still has only one output. The codomain also contains 9, which is unused.
Inputs actually present in the relation: {−2, 0, 2}. Declared inputs with no output: ∅. Declared inputs with more than one distinct output: ∅.
| Input | Output |
|---|---|
| −2 | 4 |
| 0 | 0 |
| 2 | 4 |
Check the selected input: x = 2
Exactly one output. The relation associates this input with: {4}.
Check whether the proposed output is in the range: y = 4
The proposed output is independent of the selected input. It may be in the range even when this selected input does not produce it.
This value belongs to the codomain.
Read every matching pair in the complete relation
Complete algebraic or listed candidate set: {−2, 2}.
| Derived input | Domain eligibility | Output from the original rule or relation | Produces the proposed output? |
|---|---|---|---|
| −2 | Allowed by the declared domain | {4} | Allowed preimage |
| 2 | Allowed by the declared domain | {4} | Allowed preimage |
All allowed preimages of this proposed output: {−2, 2}.
A table with a shared output. x = 2: Exactly one output; Assigned output set: {4}. y = 4: This value is in the range: at least one allowed input produces it. All allowed preimages of this proposed output: {−2, 2}. Does this define a function on the declared domain? Yes: every declared input has exactly one output.
| Input | Domain eligibility | Assigned output set | Input verdict |
|---|---|---|---|
| −3 | Excluded from the declared domain | Not evaluated outside the declared domain | Excluded from the declared domain |
| −2 | Allowed by the declared domain | {4} | Exactly one output |
| −1/2 | Excluded from the declared domain | Not evaluated outside the declared domain | Excluded from the declared domain |
| 0 | Allowed by the declared domain | {0} | Exactly one output |
| 1 | Excluded from the declared domain | Not evaluated outside the declared domain | Excluded from the declared domain |
| 2 | Allowed by the declared domain | {4} | Exactly one output |
| 3 | Excluded from the declared domain | Not evaluated outside the declared domain | Excluded from the declared domain |
| 4 | Excluded from the declared domain | Not evaluated outside the declared domain | Excluded from the declared domain |
Why this is the whole range: {0, 4}
The entire pair list has outputs 0 and 4 and no others. The pairs (0, 0), (−2, 4) and (2, 4) show that both values are attained. Thus the range is {0, 4}, while the codomain is {0, 4, 9}.
The eight input checks illustrate evaluation. They do not prove a continuous range. The range argument below rules out every value outside the stated range and constructs an allowed input for every value inside it. For a finite relation, the complete pair list gives its whole range.
Fractions are reduced exactly. Principal roots are nonnegative and retained as exact radicals when necessary. Preimage signs, domain comparisons and output equality use integer arithmetic, including comparisons at interval boundaries. Decimal approximations do not decide a verdict.
Worked examples
Test a complete table against its declared domain
A complete table declares inputs {−1, 1, 3} and output target {2, 5, 8}. Its pairs are (−1, 2), (1, 2) and (3, 5). Does it define a function on that domain, and what is its range? What changes if the last pair is omitted or if (1, 8) is added?
- Inspect all three declared inputs. Each of −1, 1 and 3 has exactly one output. Sharing output 2 between two inputs is allowed.
- Collect the outputs actually attained: 2 and 5. The target also contains 8, but the original table never produces it.
- Omitting (3, 5) leaves a declared input without an output. The remaining pairs define a function on the smaller domain {−1, 1}, but not on the original declared domain.
- Adding (1, 8) assigns input 1 two distinct outputs, 2 and 8. That new complete relation fails the uniqueness condition.
The original table defines a function with range {2, 5}. The omitted-row version fails coverage on the declared domain; the added-pair version fails uniqueness.
Evaluate a square rule and prove its complete range
Let q(x) = (x − 2)² + 1 for every real x, with all real numbers as the declared output target. Find q(−1) and q(5), determine the exact range, and decide whether outputs 1/2 and 5 can be attained.
- Substitute separately:
q(−1) = (−3)² + 1 = 10andq(5) = 3² + 1 = 10. Different inputs sharing 10 do not violate the function condition. - For every real input,
(x − 2)² ≥ 0, so q(x) ≥ 1. Input 2 attains the lower value 1. - For an arbitrary real y ≥ 1, choose
x = 2 + √(y − 1). This is an allowed real input and gives q(x) = y. Both parts prove that the complete range is y ≥ 1. - Output 1/2 is below the proved lower bound and cannot occur. For output 5, solve
(x − 2)² = 4: inputs x = 0 and x = 4 are permitted, and both give 5.
q(−1) = q(5) = 10; the exact range is all real y ≥ 1. Output 1/2 is unattained, while output 5 occurs at inputs 0 and 4.
Keep the root condition and the nonzero denominator
For the original real formula h(x) = 1/√(x − 1), find its natural domain and complete range. Evaluate h(5) and explain why x = 1 is excluded.
- The real root requires x − 1 ≥ 0, and the denominator must be nonzero. Together these give x − 1 > 0, so the natural domain is x > 1.
- At x = 5, the radicand is 4 and its principal square root is 2. Thus h(5) = 1/2. At x = 1, the root exists but equals zero, making the division undefined.
- On the domain, the denominator is positive, so every output is strictly positive. Zero and negative values cannot be outputs.
- For any real y > 0, choose
x = 1 + 1/y². Then x > 1 and√(x − 1) = √(1/y²) = 1/y, since y is positive. Hence h(x) = y, proving that every positive real value is attained.
The natural real domain is x > 1 and the exact range is y > 0. h(5) = 1/2; x = 1 is excluded because it gives a zero denominator.
Try it yourself
Let
f(x) = 3x − 2on all real inputs. Find f(−2) and f(a + 1). Explain what the parentheses mean.Show the answer and reasoning
f(−2) = −8 and f(a + 1) = 3a + 1. The parentheses specify the input to the function.
Replace every x with the stated input:
3(−2) − 2 = −8and3(a + 1) − 2 = 3a + 1. f is the function's name; f(x) is its output, not a product of f and x.Each complete relation declares domain {0, 1, 2}. A has pairs (0, 7), (1, 7), (2, 8); B has (0, 7), (1, 7); C has (0, 7), (1, 7), (1, 8), (2, 8). Which define functions on that domain? Explain each failure.
Show the answer and reasoning
Only A. B omits declared input 2; C assigns input 1 two different outputs.
A covers every input and allows 0 and 1 to share output 7. B is a function if its domain is changed to {0, 1}, but fails the stated complete definition on {0, 1, 2}. C fails output uniqueness even though every declared input is present.
A function declares inputs {−3, 0, 3}, output target {0, 9, 16}, and rule f(x) = x² on those inputs. State its domain and range. Is 16 an output of this function? Is f(4) part of this definition?
Show the answer and reasoning
Domain {−3, 0, 3}; range {0, 9}. Output 16 is not attained, and f(4) is outside this function's definition.
The permitted inputs produce 9, 0 and 9. A value's presence in the declared target does not make it an actual output. The formula 4² can be calculated, but input 4 is excluded by the chosen domain; it does not make the formula undefined.
The graph of y = x² has points (−2, 4) and (2, 4). Do these points disqualify it as a function of x? What if a relation contains points (2, 4) and (2, 5)?
Show the answer and reasoning
The square graph still represents a function. The second relation cannot represent y as a function of x.
The first two points have different inputs and a shared output, which is permitted; a horizontal line meets them. The second pair puts two distinct outputs above the same input 2, so a vertical line meets both and the uniqueness test fails.
Find the natural real domains of
p(x) = 1/(x − 4),s(x) = √(2 − x)andh(x) = 1/√(2 − x). Explain whether x = 2 is permitted for each root formula.Show the answer and reasoning
p: x ≠ 4; s: x ≤ 2; h: x < 2. Input 2 is permitted for s but excluded for h.
The fraction denominator excludes 4. For s,
2 − x ≥ 0allows x ≤ 2 and gives s(2) = 0. For h, the real root must also be nonzero, so2 − x > 0is required; input 2 would give division by zero.The table for f(x) = x² lists inputs −2, −1, 0, 1, 2 and outputs 4, 1, 0, 1, 4. If the declared domain is all real numbers, is its range {0, 1, 4}? Give a complete range proof and an input producing output 2.
Show the answer and reasoning
No. The complete range is all real y ≥ 0; input √2 produces output 2.
Every square output is nonnegative. Conversely, for every real y ≥ 0, the allowed input x = √y produces y. The table gives samples from an infinite domain, so its few distinct outputs are not the entire range.
For f(x) = x², prove the exact range when the stated domain is −2 ≤ x ≤ 3. Then prove the range when the domain is 1 ≤ x < 3. Do not rely only on checking endpoints.
Show the answer and reasoning
For −2 ≤ x ≤ 3, the range is 0 ≤ y ≤ 9. For 1 ≤ x < 3, it is 1 ≤ y < 9.
On the first domain, |x| ≤ 3 gives 0 ≤ x² ≤ 9, and every y in [0, 9] is attained at x = √y in [0, 3]. On the second, 1 ≤ x < 3 gives 1 ≤ x² < 9, and every y in [1, 9) is attained at x = √y in [1, 3). The constructed inputs prove there are no gaps and preserve endpoint inclusions.
What to carry forward
- A function assigns exactly one output to every declared input. Different inputs may share an output; a missing declared input or two distinct outputs for one input fail different parts of the definition.
- f(x) denotes the function's output at input x. Evaluate it by substituting the whole input throughout the rule.
- The domain contains permitted inputs, the codomain is the declared output target, and the range contains only outputs actually attained.
- A chosen problem domain can be narrower than a formula's natural real domain. Distinguish a defined but excluded input from an undefined original formula input.
- Original denominators must be nonzero and real square-root radicands must be nonnegative. A square root used as the entire denominator requires a strictly positive radicand.
- Vertical lines test whether one input has multiple outputs. Horizontal lines meeting a graph more than once do not by themselves disqualify a function.
- Prove a complete range in both directions: restrict every possible output, then produce an allowed input for every claimed output. Recheck that proof when the domain or its endpoint conditions change.
References
Sources for the concepts and teaching approaches in this article.