Sub topic 2
Domain and Range: Which Inputs Work and Which Outputs Appear
This chapter assumes you can solve linear and quadratic equations and inequalities, handle absolute values, and recall that a logarithm is defined only for positive arguments. It also assumes you can read function notation such as f(x), which the previous chapter covers.
The working model
The domain of a function is the set of inputs x for which the rule produces a real number. The range is the set of outputs f(x) that actually occur as x moves through the domain. The codomain is the set the outputs are allowed to land in, usually all real numbers. CAT questions ask about domain and range, not codomain.
Unless a question restricts the inputs, the domain is the natural domain. That means every real x except those that break an arithmetic rule. Finding the domain is a process of elimination. Finding the range is usually harder, because you have to show which outputs are reachable.
Finding the domain: three things that break
Only three situations remove values from the real domain at this level.
| Situation | Condition for a valid input |
|---|---|
| Denominator | The denominator is not 0 |
| Even root, such as a square root | The expression under the root is 0 or more |
| Logarithm | The argument is strictly greater than 0, and the base is positive and not 1 |
Polynomials, exponentials like 2^x, and the absolute value |x| have domain of all real numbers. Floor and ceiling functions also accept every real x.
When several restrictions apply, the domain is the intersection of all of them. Every condition must hold at once.
Worked example 1: root and denominator
Find the domain of f(x) = sqrt(x - 2) / (x - 5).
- The root requires x - 2 ≥ 0, so x ≥ 2.
- The denominator requires x ≠ 5.
- Combine them: x ≥ 2 with x = 5 removed. In interval form this is [2, 5) ∪ (5, ∞).
Worked example 2: root of a quadratic
Find the domain of f(x) = sqrt(6 - x - x²).
The condition is 6 - x - x² ≥ 0. Multiply by -1 and flip the inequality: x² + x - 6 ≤ 0. This factors as (x + 3)(x - 2) ≤ 0, so -3 ≤ x ≤ 2. The domain is [-3, 2].
Worked example 3: logarithm
Find the domain of f(x) = log(x² - 4x + 3).
We need x² - 4x + 3 > 0, which factors as (x - 1)(x - 3) > 0. A parabola that opens upward is positive outside its roots, so x < 1 or x > 3. The points x = 1 and x = 3 are excluded because the logarithm needs a strictly positive argument.
Finding the range: four methods
There is no single recipe. Choose the method that matches the shape of the function.
- Use the vertex or a known shape. For a quadratic with a > 0, the minimum sits at x = -b/(2a) and the range extends upward from there. For |x - 2| + |x - 5|, the minimum is 3 (the gap between 2 and 5), so the range is [3, ∞).
- Solve for x in terms of y. Write y = f(x), solve for x, and ask which y values give a valid x. This works well for rational functions.
- Chain the ranges. Find the range of the inner expression, then pass it through the outer function.
- Restrict a graph to the domain. If the domain is an interval, evaluate at the endpoints and at any turning point inside it.
Worked example 4: solving for x
Find the range of f(x) = (2x + 1) / (x - 3).
Set y = (2x + 1)/(x - 3). Then y(x - 3) = 2x + 1, so yx - 3y = 2x + 1, which gives x(y - 2) = 3y + 1. Therefore x = (3y + 1)/(y - 2). This expression is undefined only when y = 2, so y = 2 is never an output. The range is all real numbers except 2.
The excluded value matches the horizontal asymptote y = 2, the value the graph approaches but never reaches. For (ax + b)/(cx + d), the excluded output is a/c.
Worked example 5: chaining ranges
Find the range of f(x) = sqrt(6 - x - x²).
The domain is [-3, 2] from example 2. Complete the square: 6 - x - x² = 25/4 - (x + 1/2)². The largest value is 25/4 at x = -1/2. At the domain endpoints the expression equals 0. So the inner expression takes every value in [0, 25/4], and the square root maps this to [0, 5/2].
Worked example 6: restricted domain
Find the range of f(x) = x² - 6x + 5 on [0, 5].
The vertex is at x = 3, which lies inside the interval, and f(3) = -4. The endpoints give f(0) = 5 and f(5) = 0. The smallest value is -4 and the largest is 5, so the range is [-4, 5]. On all real numbers the range would be [-4, ∞). Changing the domain changes the range.
Checking with code
A quick numeric check can confirm a range you derived by hand. It samples the function and cannot prove anything, but it catches arithmetic slips.
import math
def f(x):
return math.sqrt(x - 2) / (x - 5)
for x in [1, 2, 5, 6]:
try:
print(x, "->", f(x))
except (ValueError, ZeroDivisionError):
print(x, "-> outside the domain")
def g(x):
return x ** 2 - 6 * x + 5
xs = [i / 100 for i in range(0, 501)] # 0.00, 0.01, ..., 5.00
ys = [g(x) for x in xs]
print(min(ys), max(ys))The first loop reports x = 1 (negative under the root) and x = 5 (zero denominator) as outside the domain. The last line prints -4.0 and 5.0, matching example 6.
A decision flow
The diagram below summarizes how to approach a domain-and-range question.
Special cases worth memorizing
- Floor and ceiling. The domain is all reals, but the range is the integers only. For floor(x), outputs such as 2.5 never occur.
- Even powers. x² has range [0, ∞). Any expression of the form (something)² + c has range [c, ∞).
- Exponentials. 2^x has range (0, ∞). It never reaches 0 or goes negative.
- Logarithms. log(x) has domain (0, ∞) and range all reals.
- Constant functions. f(x) = 5 has range {5}, a single value.
Common errors
- Forgetting to intersect conditions. In example 1, stopping at x ≥ 2 and ignoring x ≠ 5 gives a wrong answer.
- Cancelling before finding the domain. For f(x) = (x² - 9)/(x - 3), the simplified form x + 3 suggests every real x works. The original function is undefined at x = 3, so the domain excludes it. Its range is all reals except 6, because x = 3 would have produced 6.
- Treating the root's output as negative. sqrt(x) means the nonnegative root, so its range is never negative.
- Using the whole-line range on a restricted domain. Always check whether the vertex lies inside the given interval.
- Strict versus non-strict inequalities. The root allows 0 but the logarithm and the denominator do not.
Practice
Exercise
Find the domain of f(x) = sqrt(x + 1) / (x² - 9) + log(4 - x).
Show answer
Root: x ≥ -1. Denominator: x² - 9 ≠ 0, so x ≠ 3 and x ≠ -3. Logarithm: 4 - x > 0, so x < 4. Intersecting these gives -1 ≤ x < 4 with x = 3 removed. The point x = -3 is already outside the interval. The domain is [-1, 3) ∪ (3, 4).
Exercise
Find the range of f(x) = x² - 4x + 7 on all real numbers, and then on the interval [3, 6].
Show answer
Complete the square: f(x) = (x - 2)² + 3. On all reals the range is [3, ∞). On [3, 6] the vertex x = 2 lies outside the interval, so f increases throughout. f(3) = 4 and f(6) = 19, so the range is [4, 19].
Exercise
Find the range of f(x) = (3x - 2) / (x + 4).
Show answer
Set y = (3x - 2)/(x + 4). Then yx + 4y = 3x - 2, so x(y - 3) = -2 - 4y, and x = (-2 - 4y)/(y - 3). This is undefined only when y = 3. The range is all real numbers except 3.