Reading position, not mastery.
Reading settings
Line spacing
Text width
Saved only in this browser. Theme and colors are in Appearance.
Explore, understand, practice

Functions, domain and range: what does each input produce?

Mathematics roadmap · فارسی

A cost rule lets us predict a bill from consumption. Before calculating, we must decide which inputs are allowed and whether each has a definite output. Separate table entries for a few purchases do not determine every purchase. A function assigns exactly one output to each member of its domain. Its rule may be given by a formula, table, graph or description.

Goal: distinguish functions from general relations; separate domain, codomain and range; retain algebraic and modeling restrictions. Prerequisites: substitution and inequalities.

1. Starting question

Is {(1,4),(2,4),(3,7)} a function? What if (2,9) is added?

Diagnostic answer

The original is a function: different inputs may share an output. Adding the pair gives input 2 two different outputs, so the new relation is not a function. Repeating an identical pair would not create another output.

2. Naming a rule

In f(x)=3x+2, f names the rule and x is an input placeholder. f(4) means evaluate at 4: first 3×4, then add 2, giving 14. It is not f multiplied by 4. Finding an input that produces 14 instead requires solving 3x+2=14; that differs from evaluating f(14).

Historically, the function concept developed alongside the study of varying quantities; today's definition does not require one formula. MacTutor's notation history records Euler's use of f(x) in 1734. That dates the notation, rather than claiming the entire concept was invented in one moment. Notation history.

3. Three different sets

In f:A→B, A is the domain of allowed inputs and B the declared codomain containing outputs. The range contains only outputs actually attained and is a subset of B. For f(x)=x² with real domain and real codomain, the range is [0,∞). Squares of real numbers cannot be negative; every y≥0 is attained by input √y.

Arrows map 1 and 2 to 4, and 3 to 7; codomain member 9 is never reached.

Here the domain is {1,2,3}, codomain {4,7,9}, and range {4,7}. No input has two outgoing arrows. Two arrows arriving at 4 are allowed.

The notation [a,b] includes endpoints; (a,b) excludes them. In [a,∞), infinity is not an endpoint number to include, so it always takes a parenthesis. ℝ denotes all real numbers.

4. Find the domain before simplifying

For h(x)=√(x+2)/(x−1), a real square root requires x+2≥0 and division requires x≠1. Their intersection is [-2,1) ∪ (1,∞); the union symbol means either interval is allowed. These restrictions concern inputs. They do not automatically give the range.

For q(x)=(x²−1)/(x−1), first exclude x=1. Factoring and canceling gives q(x)=x+1 only on that restricted domain. Its range is all real numbers except 2: the sole input that could produce 2 was the excluded input 1. The complete line x+1 is a different function.

5. A story restricts inputs too

In the invented notebook-cost model C(n)=5+2n, n is a nonnegative integer count. The algebraic formula permits every real number, but negative or 1.5 notebooks are disallowed under this contract. The range is {5,7,9,…}. If the fixed charge applies only when a purchase occurs, the rule at n=0 must be separately specified. The formula cannot decide a shop's contract.

6. Independent practice

  1. Is {(-1,2),(0,2),(1,2)} a function? Give domain and range.
Answer 1

Yes: each input has one output. Domain {-1,0,1}, range {2}. A constant function is still a function.

  1. For f(x)=x²−3, find f(-2) and every input producing 1.
Answer 2

f(-2)=4−3=1. Solving x²−3=1 gives x=±2. Multiple inputs sharing an output do not violate the definition.

  1. Find the real domain of √(5−x)/(x+1).
Answer 3

x≤5 and x≠−1, giving (-∞,−1) ∪ (−1,5]. Input 5 is allowed: a zero numerator is fine and its denominator is 6.

  1. Find domain and range of f(x)=x² with declared domain [-2,1].
Answer 4

Domain [-2,1], range [0,4]. Zero is attained at input zero; the greatest square is at -2. Merely evaluating the two domain endpoints would miss the minimum.

  1. Which output of the complete line x+2 is missing from r(x)=(x²−4)/(x−2)?
Answer 5

Simplification retains x≠2, removing output 4 because x+2=4 requires exactly input 2. Both domain and range must respect cancellation restrictions.

7. Continue and retrieve later

Continue to basic graphs when you can explain the difference between one output per input and one input per output, and justify exercises 3–5. Repair inequalities and root restrictions if domain finding is difficult. Later, without notes, find the domain of 1/√(x−3): it is x>3, since the root is now a denominator.

Sources and authorship

Explanations, invented exercises and diagram are original. Definition checks and further reading: OpenStax, functions and notation, domain and range. Online references checked 2026-11-17. Diagram provenance.