What Goes In, and What Comes Out?

Suppose a relation is

\[ R=\{(1,4),(2,4),(3,7),(5,9)\}. \]

The first components are

\[ 1,2,3,5. \]

These form the domain.

\[ \operatorname{Dom}(R)=\{1,2,3,5\}. \]

The second components are

\[ 4,4,7,9. \]

Because a set records distinct elements, the range is

\[ \operatorname{Ran}(R)=\{4,7,9\}. \]

This gives us the basic idea:

\[ \boxed{ \text{domain}=\text{first components}, \qquad \text{range}=\text{second components that occur} } \]

For functions, we often describe this more informally as inputs and outputs.

Domain

For a relation \(R\), the domain is the set of all first components that appear in its ordered pairs.

\[ \boxed{ \operatorname{Dom}(R) = \{x\mid \text{there exists some }y\text{ with }(x,y)\in R\} } \]

The phrase “there exists some \(y\)” simply means that \(x\) participates in at least one ordered pair.

Example

Let

\[ R=\{(2,a),(4,b),(4,c),(7,c)\}. \]

The first components are

\[ 2,4,4,7. \]

As a set,

\[ \operatorname{Dom}(R)=\{2,4,7\}. \]

The repeated \(4\) is listed only once.

Range

The range of a relation is the set of second components that actually occur.

\[ \boxed{ \operatorname{Ran}(R) = \{y\mid \text{there exists some }x\text{ with }(x,y)\in R\} } \]

Using

\[ R=\{(2,a),(4,b),(4,c),(7,c)\}, \]

the second components are

\[ a,b,c,c. \]

Therefore,

\[ \operatorname{Ran}(R)=\{a,b,c\}. \]

Again, repeated values appear only once because the range is a set.

Domain, Codomain, and Range

These three terms are closely related but should not be treated as interchangeable.

Suppose a function is declared

\[ f:A\to B. \]

Then \(A\) is the domain and \(B\) is the codomain.

The range is the set of outputs the function actually produces.

Therefore,

\[ \operatorname{Ran}(f)\subseteq B. \]

The range may equal the entire codomain, but it does not have to.

Example

Let

\[ f:\mathbb{R}\to\mathbb{R} \]

be defined by

\[ f(x)=x^2. \]

The declared domain is

\[ \mathbb{R}, \]

and the codomain is also

\[ \mathbb{R}. \]

But the actual outputs satisfy

\[ f(x)\geq0. \]

So the range is

\[ [0,\infty). \]

Thus

\[ \operatorname{Ran}(f) = [0,\infty) \subsetneq \mathbb{R}. \]

This distinction will matter later when we study surjective functions.

Finding Domain and Range from Ordered Pairs

When a relation is given explicitly as ordered pairs, the process is direct.

Consider

\[ R=\{(-2,5),(0,1),(3,5),(8,10)\}. \]

Collect the first components:

\[ -2,0,3,8. \]

Therefore,

\[ \operatorname{Dom}(R)=\{-2,0,3,8\}. \]

Collect the second components:

\[ 5,1,5,10. \]

Remove repetition:

\[ \operatorname{Ran}(R)=\{1,5,10\}. \]

A Useful Habit

Read each ordered pair as

\[ (\text{domain value},\text{range value}). \]

That habit will transfer directly into function notation and graphing.

Finding Domain and Range from Tables

A two-column table is another way to display ordered pairs.

\(x\) \(y\)
\(-2\) \(4\)
\(0\) \(1\)
\(3\) \(4\)
\(5\) \(9\)

The domain is the set of \(x\)-values:

\[ \{-2,0,3,5\}. \]

The range is the set of distinct \(y\)-values:

\[ \{1,4,9\}. \]

The same relation could have been written as

\[ \{(-2,4),(0,1),(3,4),(5,9)\}. \]

Changing the representation does not change the relation.

Finding Domain and Range from Graphs

A graph is a set of points, and every point has coordinates

\[ (x,y). \]

So the domain consists of the horizontal coordinates that occur, while the range consists of the vertical coordinates that occur.

Think Horizontally for Domain

To read the domain from a graph, ask:

Which \(x\)-values are reached by at least one point on the graph?

Think Vertically for Range

To read the range, ask:

Which \(y\)-values are reached by at least one point on the graph?

Example: A Line

For the line

\[ y=2x+1, \]

every real \(x\)-value is allowed, so

\[ \operatorname{Dom}(f)=\mathbb{R}. \]

The line also reaches every real \(y\)-value, so

\[ \operatorname{Ran}(f)=\mathbb{R}. \]

Example: A Parabola

For

\[ y=x^2, \]

every real \(x\) is allowed:

\[ \operatorname{Dom}(f)=\mathbb{R}. \]

But outputs cannot be negative:

\[ \operatorname{Ran}(f)=[0,\infty). \]

Finding Domain from a Formula

When a relation or function is defined by a formula, the first question is:

Which input values make the formula mathematically meaningful?

Unless the problem gives another restriction, the natural domain consists of all real inputs for which the expression is defined.

Polynomial Expressions

For example,

\[ f(x)=3x^2-5x+7 \]

is defined for every real number.

Therefore,

\[ \operatorname{Dom}(f)=\mathbb{R}. \]

Restrictions Usually Come from Operations

Two common sources of restrictions in early algebra are:

Later, logarithms and other functions will introduce additional domain conditions.

Radicals and Domain Restrictions

For a real-valued square root,

\[ \sqrt{x} \]

the radicand must satisfy

\[ x\geq0. \]

Consider

\[ f(x)=\sqrt{x-3}. \]

Require

\[ x-3\geq0. \]

Therefore,

\[ x\geq3. \]

The domain is

\[ \boxed{[3,\infty)}. \]

Another Example

For

\[ g(x)=\sqrt{10-2x}, \]

require

\[ 10-2x\geq0. \]

Solving gives

\[ x\leq5. \]

So

\[ \operatorname{Dom}(g)=(-\infty,5]. \]

Rational Expressions and Domain Restrictions

Division by zero is undefined.

Consider

\[ f(x)=\frac{1}{x-4}. \]

The denominator cannot equal zero:

\[ x-4\neq0. \]

Therefore,

\[ x\neq4. \]

The domain is

\[ (-\infty,4)\cup(4,\infty). \]

Factored Denominators

Suppose

\[ g(x)=\frac{x+1}{(x-2)(x+5)}. \]

The denominator is zero at

\[ x=2 \]

and

\[ x=-5. \]

So the domain is

\[ \mathbb{R}\setminus\{-5,2\}. \]

In interval notation,

\[ (-\infty,-5)\cup(-5,2)\cup(2,\infty). \]

Finding Range from a Formula

Finding a range from a formula can require more reasoning than finding a domain.

The question is:

Which output values can the formula actually produce?

Example: \(f(x)=x^2\)

Squares are never negative:

\[ x^2\geq0. \]

Every nonnegative real value can occur, so

\[ \operatorname{Ran}(f)=[0,\infty). \]

Example: \(f(x)=x^2+4\)

Since

\[ x^2\geq0, \]

we have

\[ x^2+4\geq4. \]

Therefore,

\[ \operatorname{Ran}(f)=[4,\infty). \]

Example: \(f(x)=\sqrt{x}\)

The square root symbol denotes the nonnegative real root, so

\[ f(x)\geq0. \]

Thus

\[ \operatorname{Ran}(f)=[0,\infty). \]

Example: \(f(x)=\frac{1}{x}\)

No input produces the output \(0\):

\[ \frac1x\neq0. \]

Every other real output is possible, so

\[ \operatorname{Ran}(f) = (-\infty,0)\cup(0,\infty). \]

Writing Domain and Range

Domain and range can be represented in several familiar forms.

Roster Notation

\[ \{1,2,3,5\}. \]

Use roster notation when the set contains a manageable number of distinct values.

Interval Notation

\[ [-2,7) \]

describes all real numbers from \(-2\), included, up to \(7\), excluded.

Set-Builder Notation

\[ \{x\in\mathbb{R}\mid x\geq3\}. \]

This is equivalent to

\[ [3,\infty). \]

Using \(\mathbb{R}\)

If every real value is allowed, simply write

\[ \mathbb{R}. \]

Being comfortable translating among these forms will make later work with functions much easier.

Practical Applications

Time and Production

Suppose \(P(t)\) gives the number of units produced after \(t\) hours.

In a real process, negative time may have no meaning, so the practical domain might be

\[ t\geq0. \]

If the machine is observed only during an 8-hour shift, the practical domain may instead be

\[ 0\leq t\leq8. \]

The formula may accept more values algebraically than the application permits.

Pricing

Suppose \(C(q)\) represents the cost of producing \(q\) units.

If \(q\) counts physical products, the meaningful domain may be nonnegative integers:

\[ q\in\{0,1,2,\ldots\}. \]

This is different from allowing every real number.

Temperature Sensors

A sensor may have a technical input range such as

\[ -40\leq T\leq125. \]

Values outside that domain may be physically possible temperatures but not valid inputs for that device.

Databases

A relation connecting employees to departments may have a domain consisting of employees who actually have department assignments and a range consisting of departments that actually have employees.

Unused employees or unused departments may still exist in the larger source sets without appearing in the relation's domain or range.

Worked Examples

Example 1: Ordered Pairs

Let

\[ R=\{(-3,2),(0,4),(5,2),(7,9)\}. \]

Then

\[ \operatorname{Dom}(R)=\{-3,0,5,7\} \]

and

\[ \operatorname{Ran}(R)=\{2,4,9\}. \]

Example 2: Polynomial

Find the domain of

\[ f(x)=x^3-4x+1. \]

Polynomial expressions are defined for every real \(x\), so

\[ \boxed{\operatorname{Dom}(f)=\mathbb{R}}. \]

Example 3: Square Root

Find the domain of

\[ f(x)=\sqrt{2x+6}. \]

Require

\[ 2x+6\geq0. \]

Then

\[ 2x\geq-6 \]

and

\[ x\geq-3. \]

Therefore,

\[ \boxed{\operatorname{Dom}(f)=[-3,\infty)}. \]

Example 4: Rational Expression

Find the domain of

\[ g(x)=\frac{x+4}{x^2-9}. \]

Factor the denominator:

\[ x^2-9=(x-3)(x+3). \]

Exclude

\[ x=3 \]

and

\[ x=-3. \]

So

\[ \boxed{ \operatorname{Dom}(g) = (-\infty,-3)\cup(-3,3)\cup(3,\infty) }. \]

Example 5: Range of a Shifted Square

Find the range of

\[ f(x)=x^2-5. \]

Because

\[ x^2\geq0, \]

we have

\[ x^2-5\geq-5. \]

Therefore,

\[ \boxed{\operatorname{Ran}(f)=[-5,\infty)}. \]

Example 6: Practical Domain

A parking garage charges according to

\[ C(h)=4+2h, \]

where \(h\) is the number of hours parked. The garage permits stays from \(0\) through \(12\) hours.

Although the formula itself accepts all real \(h\), the practical domain is

\[ \boxed{0\leq h\leq12}. \]

Context can therefore restrict a domain beyond purely algebraic restrictions.

Common Errors

1. Reversing Domain and Range

For ordered pairs

\[ (x,y), \]

the domain comes from first components and the range from second components.

2. Listing Repeated Values More Than Once

If

\[ R=\{(1,4),(2,4),(3,4)\}, \]

then

\[ \operatorname{Ran}(R)=\{4\}, \]

not \(\{4,4,4\}\).

3. Confusing Codomain with Range

The codomain is the declared target set. The range is what the relation or function actually reaches.

4. Forgetting to Exclude Zero from a Denominator

For

\[ \frac{1}{x-2}, \]

the value

\[ x=2 \]

must be excluded.

5. Allowing Negative Radicands in Real Square Roots

For real-valued

\[ \sqrt{g(x)}, \]

require

\[ g(x)\geq0. \]

6. Ignoring Context

A formula may be algebraically defined for inputs that make no sense in the real application.

Negative quantities, fractional counts, or values beyond physical limits may need to be excluded.

7. Assuming Range Is Always Easy to Read Algebraically

Domain often follows directly from restrictions on inputs. Range asks which outputs are attainable and can require graphing, algebra, inequalities, or other reasoning.

Practice

Ordered Pairs

Let

\[ R=\{(1,5),(2,7),(4,5),(8,10)\}. \]

Find the domain and range.

Check Answer \[ \operatorname{Dom}(R)=\{1,2,4,8\} \]

and

\[ \operatorname{Ran}(R)=\{5,7,10\}. \]

Domain of a Radical

Find the domain of

\[ f(x)=\sqrt{7-x}. \]
Check Answer

Require

\[ 7-x\geq0. \]

Therefore,

\[ x\leq7. \]

So

\[ \boxed{(-\infty,7]}. \]

Domain of a Rational Expression

Find the domain of

\[ g(x)=\frac{2x}{(x-1)(x+4)}. \]
Check Answer

Exclude

\[ x=1 \]

and

\[ x=-4. \]

Thus

\[ \boxed{ (-\infty,-4)\cup(-4,1)\cup(1,\infty) }. \]

Range

Find the range of

\[ h(x)=x^2+2. \]
Check Answer

Since

\[ x^2\geq0, \]

we have

\[ x^2+2\geq2. \]

Therefore,

\[ \boxed{[2,\infty)}. \]

Practical Domain

A factory can produce between \(0\) and \(500\) complete units per day. If \(q\) represents daily unit production, write a reasonable practical domain.

Check Answer

Because units are complete counted objects,

\[ \boxed{ q\in\{0,1,2,\ldots,500\} }. \]

The Deeper Idea

Domain and range identify the parts of a relation that actually participate.

If

\[ R\subseteq A\times B, \]

then the domain collects the first components used by \(R\), while the range collects the second components reached by \(R\).

For functions, this becomes the familiar input-output picture:

\[ \boxed{ \text{domain} \longrightarrow \text{rule} \longrightarrow \text{range} } \]

But the set-theoretic viewpoint is more precise. It reminds us that a function does not merely contain a formula. It is a structured relation with a specified domain, often a codomain, and a set of actual outputs.

That precision will matter when we study function notation, injective and surjective functions, inverses, compositions, and transformations.

Summary

Domain and range give precise boundaries to a relation. Before asking what a function does, it is worth knowing where it is allowed to begin and which values it can actually reach.

Sets, Relations, and Functions