Tutorials › Calculus I › Domain and Range as Sets

Function Notation and Representations · Tutorial 9 of 1495

Domain and Range as Sets

Understand how a function’s domain and range are sets, and find both from formulas with specified inputs and from finite data.

Beginner 9 min read

What You'll Learn

  • Define a function’s domain, codomain, and range using set notation.
  • Distinguish the inputs a function is allowed to take from the outputs it actually produces.
  • Find a range by evaluating a formula at every input in a specified finite domain.
  • Identify the domain and range represented by a finite list of input-output pairs.
  • Explain why the range is contained in the codomain and why repeated outputs appear only once in a range set.

Inputs and Outputs Are Sets

A function can be described by a rule such as “square the input,” but the rule alone does not tell the whole story. We also need to know which inputs are allowed. And after applying the rule, we need to know which outputs actually occur.

These questions are answered by the function’s domain and range. Both are sets, but they describe different sides of the input-output relationship: the domain records the permitted inputs, while the range records the outputs the function produces from those inputs.

Key idea: The domain is the set of allowed inputs. The range is the set of outputs actually attained by those inputs.

Domain, Codomain, and Range

A function is often written \(f:A\to B\). This notation says that \(f\) takes inputs from the set \(A\) and assigns an output in the set \(B\) to each input. The set \(A\) is the domain, and \(B\) is the codomain. The range consists only of the outputs that are actually attained.

Definition: For a function \(f:A\to B\), the domain is \(A\). The range is the set of all values \(f(x)\) as \(x\) runs through \(A\): $$ \operatorname{Range}(f)=\{f(x):x\in A\}. $$ The range is a subset of the codomain \(B\), because every output of \(f\) must belong to \(B\).

The colon in \(\{f(x):x\in A\}\) means “such that”: this notation describes the set of values \(f(x)\) such that \(x\) belongs to \(A\). If the domain is finite, we can often find the range by evaluating the function at each allowed input and collecting the results.

The codomain and the range need not be equal. The codomain states where outputs are allowed to lie; the range states which of those outputs this particular function actually produces. For example, a function may have codomain \(\mathbb{R}\), the set of real numbers, even though it produces only a few values from that set.

Why the Range Is a Set of Actual Outputs

Suppose \(f:A\to B\). Each input \(x\in A\) has an assigned output \(f(x)\), and because the function maps into \(B\), that output belongs to \(B\). The range collects exactly these outputs, no more and no fewer.

1
Start with an allowed input.
Choose any \(x\in A\), where \(A\) is the domain.
2
Apply the function.
The function assigns the output \(f(x)\), which belongs to \(B\).
3
Collect the outputs.
Doing this for every \(x\in A\) gives \(\{f(x):x\in A\}\), the range.

This also justifies the inclusion \(\operatorname{Range}(f)\subseteq B\). If \(y\) belongs to the range, then \(y=f(x)\) for some \(x\in A\), by the definition of range. Since \(f:A\to B\), the output \(f(x)\) belongs to \(B\). Therefore \(y\in B\). This proves that every range value lies in the codomain, although the codomain may contain values that never occur.

Finding a Range from a Formula and a Finite Domain

When a function is given by a formula and its domain is a finite set, evaluate the formula once for each member of the domain. The resulting output values form the range. If two inputs produce the same output, that output is listed only once in the range set: a set records which values occur, not how many times they occur.

Worked Example: Squaring Each Allowed Input

Let \(A=\{-2,-1,0,1,2\}\), and define \(f:A\to\mathbb{R}\) by \(f(x)=x^2\). Find the domain and range.

The domain is the set specified for the function, so \(\operatorname{Domain}(f)=A=\{-2,-1,0,1,2\}\).

Now evaluate the formula at every input:

$$ \begin{aligned} f(-2)&=(-2)^2=4,\\ f(-1)&=(-1)^2=1,\\ f(0)&=0^2=0,\\ f(1)&=1^2=1,\\ f(2)&=2^2=4. \end{aligned} $$

The outputs, in the order calculated, are \(4,1,0,1,4\). The range is the set of distinct outputs, so the repeated values \(1\) and \(4\) are each included only once:

$$ \operatorname{Range}(f)=\{0,1,4\}. $$

Check: every listed range value occurs as an output, since \(0=f(0)\), \(1=f(-1)=f(1)\), and \(4=f(-2)=f(2)\). The domain has five inputs, while the range has three distinct outputs.

This example makes a useful distinction visible. The domain records inputs, so the negative and positive inputs remain separate members. The range records output values, so repeated outputs do not create additional members.

Another Formula, Another Set of Outputs

A formula does not determine a range by itself when the function is specified only on part of a larger set. The allowed inputs matter. In the next example, the domain is given explicitly, so only those inputs are used to find the range.

Worked Example: A Linear Rule on a Specified Domain

Let \(A=\{1,2,4\}\), and define \(g:A\to\mathbb{R}\) by \(g(x)=3x+2\). Find the domain and range.

The domain is exactly the stated input set:

$$ \operatorname{Domain}(g)=\{1,2,4\}. $$

Evaluate the formula at each allowed input:

$$ \begin{aligned} g(1)&=3(1)+2=3+2=5,\\ g(2)&=3(2)+2=6+2=8,\\ g(4)&=3(4)+2=12+2=14. \end{aligned} $$

Each of these outputs is different, so the range is:

$$ \operatorname{Range}(g)=\{5,8,14\}. $$

Check: \(g(1)=5\), \(g(2)=8\), and \(g(4)=14\), so every member of the proposed range is attained. The codomain is \(\mathbb{R}\), which contains all three values, as required.

Finding Domain and Range in Finite Data

A finite set of input-output data can be represented by ordered pairs \((x,y)\), where \(x\) is an input and \(y\) is its corresponding output. For data that describe a function, the domain is the set of first coordinates and the range is the set of second coordinates that occur. Repeated coordinates are included only once in either set.

Worked Example: Extracting Sets from Ordered Pairs

Suppose a function is represented by the finite data \(\{(0,3),(1,5),(2,3),(3,7)\}\). Find its domain and range.

Read the first coordinate from each pair to identify the inputs. The inputs are \(0,1,2,3\), so:

$$ \operatorname{Domain}(f)=\{0,1,2,3\}. $$

Next, read the second coordinate from each pair. The outputs in order are \(3,5,3,7\). Since \(3\) occurs twice but a set contains each value only once, the range is:

$$ \operatorname{Range}(f)=\{3,5,7\}. $$

Check: the data include \((0,3)\), \((1,5)\), \((2,3)\), and \((3,7)\), so every listed input appears and every listed range value is produced. In particular, the repeated output \(3\) does not add a second \(3\) to the range.

A Common Mistake: Confusing the Codomain with the Range

Suppose the function in the first worked example is written \(f:A\to\mathbb{R}\), where \(A=\{-2,-1,0,1,2\}\) and \(f(x)=x^2\). A common error is to say that its range is \(\mathbb{R}\) simply because \(\mathbb{R}\) is written after the arrow.

$$ \text{Incorrect: }\operatorname{Range}(f)=\mathbb{R}. $$

This confuses the codomain with the range. The codomain is \(\mathbb{R}\), but the actual outputs for the allowed inputs are \(4,1,0,1,4\). Thus the corrected range is:

$$ \text{Correct: }\operatorname{Range}(f)=\{0,1,4\}. $$

The check is direct: every value in the range is produced by an input, and no other values are produced by the specified inputs. The distinction matters because a codomain can be larger than the set of values a function actually attains.

Why Domain and Range Matter

Domain and range give a compact description of the input-output possibilities of a function. The domain tells us which inputs belong to the function’s model; the range tells us what outputs result. In applications, this distinction can separate meaningful inputs from possible outcomes. In mathematical work, it prevents claims about a function that go beyond its specified inputs or actual outputs.

For a formula, always pay attention to the domain that accompanies it. For finite data, first identify the inputs and outputs from their roles in the pairs. In either case, the range is formed from outputs actually produced, not from every value that could belong to the codomain.

Check Your Understanding

Answer each question by identifying the relevant set and explaining how you know.

  1. If \(h:A\to B\), which set is the domain, and which set is the codomain?
  2. Let \(A=\{-1,0,1\}\) and \(p(x)=x+2\) for \(x\in A\). What are the domain and range?
  3. A function is represented by \(\{(2,4),(3,6),(5,4)\}\). What are its domain and range?
  4. Can a function’s range contain values that are not in its codomain? Explain using the definition of a function \(f:A\to B\).
  5. If two different inputs produce the same output, how should that output appear in the range set?

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon