Domain and Range
The domain of a function is the set of all allowed inputs, and the range is the set of all outputs that the function actually produces. In brief: for f(x) = √(x − 2), the domain is x ≥ 2 and the range is y ≥ 0. The domain comes from restrictions such as no division by zero and no even root of a negative number.
Knowing the domain and range tells you where a function exists and which values it can take. They are needed to sketch graphs, to solve equations and to define inverse functions. This guide explains both sets, shows how to find them from formulas, graphs and tables, and uses interval notation throughout.
What are domain and range?
For a function f, the domain is the set of x-values for which f(x) is defined. The range is the set of all values f(x) that occur. A related idea is the codomain, the set in which the outputs are allowed to lie, which may be larger than the range. In school mathematics the codomain is usually the real numbers.
For example, if f(x) = x2 with domain all real numbers, the range is y ≥ 0, because squares are never negative. The number −4 is in the codomain of real numbers but not in the range.
How are domain and range written?
Three notations are in use. Inequality notation: x ≥ 2. Interval notation: [2, ∞). Set-builder notation: {x | x ≥ 2}. A square bracket means the endpoint is included and a round bracket means it is excluded. Infinity always gets a round bracket. The symbol ∪ joins intervals: all real numbers except 3 is (−∞, 3) ∪ (3, ∞).
How do you find the domain of a function?
Start with all real numbers and remove the values that cause problems.
- Denominators: exclude values that make a denominator zero.
- Even roots: require the radicand to be at least 0.
- Logarithms: require the argument to be positive.
- Context: in a word problem, exclude values that make no sense, such as negative lengths.
Example 1: f(x) = 3/(x − 5)
The denominator is zero at x = 5, so the domain is all real numbers except 5: (−∞, 5) ∪ (5, ∞).
Example 2: g(x) = √(6 − 2x)
Require 6 − 2x ≥ 0, so x ≤ 3. The domain is (−∞, 3].
Example 3: h(x) = √(x + 1)/(x − 3)
Two conditions apply: x + 1 ≥ 0 gives x ≥ −1, and x ≠ 3. The domain is [−1, 3) ∪ (3, ∞).
How do you find the range of a function?
The range is harder, because it depends on the behaviour of the whole function. Useful methods:
- Think about the smallest and largest outputs, using shapes such as the vertex of a parabola.
- Sketch or imagine the graph and read the lowest and highest y-values.
- Solve y = f(x) for x and see for which y a solution exists.
Example 4: f(x) = x2 − 4x + 7
Complete the square: f(x) = (x − 2)2 + 3. The square is at least 0, so f(x) ≥ 3. The range is [3, ∞).
Example 5: f(x) = 2/(x + 1)
The fraction 2/(x + 1) can be any nonzero number but never 0. The range is all real numbers except 0: (−∞, 0) ∪ (0, ∞).
Domain and range of common functions
| Function | Domain | Range |
|---|---|---|
| f(x) = x | All real numbers | All real numbers |
| f(x) = x2 | All real numbers | [0, ∞) |
| f(x) = x3 | All real numbers | All real numbers |
| f(x) = √x | [0, ∞) | [0, ∞) |
| f(x) = 1/x | x ≠ 0 | y ≠ 0 |
| f(x) = |x| | All real numbers | [0, ∞) |
| f(x) = 2x | All real numbers | (0, ∞) |
| f(x) = sin x | All real numbers | [−1, 1] |
How do you read domain and range from a graph?
The domain is the horizontal extent of the graph: project every point onto the x-axis. The range is the vertical extent: project every point onto the y-axis. An open circle at an end means that the endpoint is excluded, and an arrow means the graph continues forever.
For the graph of y = √(x − 2) + 1, the leftmost point is (2, 1) and the graph extends to the right and upward. The domain is [2, ∞) and the range is [1, ∞).
Where do these terms come from?
The word “domain” for the set of inputs and “range” for the set of outputs became common only in the nineteenth and twentieth centuries as set theory made the definition of a function precise. Earlier mathematicians described the same ideas as the values of the independent and dependent variable. The word “range” has also been used in some texts for what is now called the codomain, so textbooks differ.
Where do domain restrictions matter in practice?
A function for the area of a square of side s is A(s) = s2. As a pure formula its domain is all real numbers, but in context s > 0, so the practical domain is (0, ∞). A formula for temperature in kelvin cannot go below 0. Spreadsheets and programs return errors when a domain is violated, as when a division by zero or a square root of a negative number appears.
Which mistakes are common?
Confusing domain and range
Domain is for x and range is for y. Remember: x comes first in an ordered pair (x, y), and so does domain.
Forgetting a denominator condition after simplifying
f(x) = (x2 − 9)/(x − 3) simplifies to x + 3, but x = 3 is still excluded from the domain of f.
Using wrong brackets
Use a round bracket for an excluded endpoint and always for ∞.
Assuming range equals all real numbers
Squares, absolute values, roots and exponentials have limited ranges. Check it with a graph or the vertex.