Sub topic 10
Finding the range from a graph or an equation
This chapter assumes you can evaluate a function such as f(x) = 2x + 3, write intervals in interval notation, and find a domain by excluding division by zero and negative numbers under even roots. You should also be able to plot points and sketch a line or a parabola.
The range of a function is the set of all outputs that actually occur. Finding the domain asks which inputs are allowed. Finding the range asks which outputs are reached. The second question is usually harder, because an equation does not list its outputs the way it lists its restrictions.
What you are looking for
Range and codomain are different things. Suppose you say "f takes real numbers to real numbers." That says nothing about whether every real number is actually produced. The range holds only the values that some allowed input produces.
A value y is in the range of f exactly when the equation f(x) = y has at least one solution x in the domain. Every method in this chapter is a way of answering that question. You can read it off a graph, build it from transformations, or solve for x.
Reading the range from a graph
On a graph, the domain is the horizontal spread of the curve and the range is the vertical spread. To find the range, scan from the bottom of the graph to the top and record every y-value the curve touches.
Work through these steps:
- Find the lowest point on the graph and the highest point, if they exist.
- Check whether the curve goes on forever up or down. Arrows on the ends mean it does.
- Check whether each end point is included. A filled dot means included. An open dot means excluded.
- Look for gaps, where the curve skips a band of y-values.
- Write the result in interval notation.
Here are three typical cases.
| Graph | Lowest y | Highest y | Range |
|---|---|---|---|
| A line with a nonzero slope | none | none | (-∞, ∞) |
| A parabola opening up with vertex (0, 0) | 0, included | none | [0, ∞) |
| A segment from (1, 2) filled to (5, 8) open | 2, included | 8, excluded | [2, 8) |
The right-hand column depends on the vertical extent only. A graph can be very wide and still have a small range. A horizontal line y = 4 covers every x-value and produces only one output, so its range is {4}.
Common graph-reading mistakes
- Reading the x-axis. The range is about y. Project each point onto the y-axis, not the x-axis.
- Ignoring an open dot. If the curve approaches y = 8 but never reaches it, 8 is not in the range. Use a parenthesis.
- Ignoring a hole. A removed point, drawn as an open circle in the middle of a curve, removes its y-value only if no other input produces that same y-value.
- Assuming the visible window is the whole graph. If the curve has arrows, it continues. If it ends in a dot, it stops.
Finding the range of a linear function
A linear function f(x) = mx + b with m ≠ 0 takes every real value. To see why, pick any target y and solve mx + b = y. The solution is x = (y - b) / m, and it exists for every y because m is not zero. So the range is (-∞, ∞), provided the domain is all real numbers.
If m = 0, the function is constant. Then f(x) = b for every x, and the range is the single-element set {b}.
If the domain is restricted, the range shrinks with it. For f(x) = 2x + 3 on the domain [0, 4], the function is increasing, so the smallest output is f(0) = 3 and the largest is f(4) = 11. The range is [3, 11].
For a monotonic function on a closed interval (one that only rises or only falls), the endpoint values give the range directly.
Finding the range of a quadratic function
A quadratic f(x) = ax² + bx + c has a graph shaped like a parabola. Its extreme value is at the vertex, which sits at x = -b / (2a). The sign of a decides which way it opens.
- If a > 0, the parabola opens up, the vertex is the lowest point, and the range is [f(-b/(2a)), ∞).
- If a < 0, the parabola opens down, the vertex is the highest point, and the range is (-∞, f(-b/(2a))].
Worked example
Find the range of f(x) = x² - 6x + 5.
- Here a = 1, b = -6, c = 5. Since a > 0, the parabola opens up.
- The vertex has x = -(-6) / (2 · 1) = 3.
- Evaluate: f(3) = 9 - 18 + 5 = -4.
- The minimum output is -4 and the outputs grow without bound.
The range is [-4, ∞).
You can check this by completing the square: x² - 6x + 5 = (x - 3)² - 4. The squared term is never negative, so the output is never below -4, and it equals -4 at x = 3.
The next code block computes outputs on a grid of integers. A finite sample cannot prove a range, but it shows the pattern and the minimum.
def f(x):
return x ** 2 - 6 * x + 5
outputs = [f(x) for x in range(-2, 9)]
print(outputs) # [17, 10, 5, 2, -1, -3, -4, -3, -1, 2, 5]
print(min(outputs)) # -4Notice that outputs repeat on either side of x = 3. Two different inputs share an output, which is allowed for a function. It also means that sampling a few points is a weak way to find a range, since you may miss the extreme point.
A restricted quadratic
The vertex only matters when it lies in the domain. Take h(x) = x², with domain [1, 3]. The vertex is at x = 0, which is not allowed. On [1, 3] the function is increasing, so the range is [h(1), h(3)] = [1, 9].
For a restricted domain, compute the function at both endpoints and at any vertex that lies inside the domain. The smallest and largest of those values give the range, as long as the function is continuous on a closed interval.
Finding the range by solving for x
When you cannot sketch the graph easily, use the definition. Write y = f(x), solve for x in terms of y, and then ask which values of y make that solution valid.
Example with a rational function
Find the range of f(x) = (2x + 1) / (x - 3). The domain is every real number except 3.
- Set y = (2x + 1) / (x - 3).
- Multiply both sides by x - 3: y(x - 3) = 2x + 1.
- Expand: yx - 3y = 2x + 1.
- Collect the x terms: yx - 2x = 3y + 1, so x(y - 2) = 3y + 1.
- Solve: x = (3y + 1) / (y - 2).
This solution exists for every y except y = 2, where the denominator is zero. At y = 2 the equation x(0) = 7 has no solution. So 2 is not an output.
The range is (-∞, 2) together with (2, ∞).
The excluded value matches a horizontal asymptote at y = 2, a line the graph approaches but never touches here. Not every horizontal asymptote is excluded, though. Some curves cross their asymptote, so check by solving, as above.
Example with a square root
Find the range of g(x) = √(x - 2) + 1. The domain is [2, ∞).
- The square root is never negative, so √(x - 2) ≥ 0.
- Adding 1 gives g(x) ≥ 1.
- At x = 2 the output is exactly 1, and the output grows without bound as x grows.
The range is [1, ∞).
This is a quicker technique: build the output from simple pieces and track the bounds at each step. You start with the known range of the basic piece and apply each operation to it.
Building the range from transformations
Shifts, stretches, and reflections move the range in predictable ways. Start with a parent function whose range you know, then apply each change to the range.
| Change to f(x) | Effect on the range |
|---|---|
| Add k: f(x) + k | Shifts every bound by k |
| Multiply by a positive number a: a·f(x) | Scales every bound by a |
| Multiply by a negative number: -f(x) | Flips the interval and swaps its ends |
| Change inside: f(x - h) | No change to the range, only the domain shifts |
For example, take the parent x² with range [0, ∞). Then -2x² + 5 is built in three steps:
- Multiply by 2: the range is still [0, ∞).
- Negate: the range becomes (-∞, 0].
- Add 5: the range becomes (-∞, 5].
So the range of -2x² + 5 is (-∞, 5], and the maximum is 5 at x = 0.
Other forms to recognize
Some functions have ranges you can state from a short argument.
- Absolute value. |x| ≥ 0, so |x| has range [0, ∞). The function |x| + 3 has range [3, ∞).
- Square root. √x has range [0, ∞) because the radical sign means the nonnegative root.
- Reciprocal. 1/x never equals zero, since no x makes 1/x = 0. Its range is (-∞, 0) together with (0, ∞).
- Constant. The range is a single value.
- Even powers. x² and x⁴ are never negative. Odd powers such as x³ take every real value.
import math
def g(x):
return math.sqrt(x - 2) + 1
samples = [g(x) for x in [2, 3, 6, 11, 102]]
print(samples) # [1.0, 2.0, 3.0, 4.0, 11.0]Every output is at least 1, and 1 appears at the left endpoint, which matches the range [1, ∞).
Common errors
- Using the domain as the range. For √(x - 2) the domain is [2, ∞), but the range is [0, ∞). Keep the two apart.
- Forgetting the vertex is a boundary. For a parabola, the vertex value is the end of the range, not a point in the middle of it.
- Writing the range with a bracket at infinity. Infinity is not a number, so it always takes a parenthesis.
- Skipping the restricted domain. A quadratic with a limited domain may not reach its vertex.
- Trusting a sample. Evaluating at a few integers can miss the extreme value or a gap.
Choosing a method
Whichever method you use, finish by checking the result against the domain. A range that disagrees with the domain, such as a negative output from a function built from squares, signals an error.
Exercise
Find the range of f(x) = -(x + 1)² + 7 with domain all real numbers, and then find the range when the domain is restricted to [0, 2].
Show answer
For all real numbers, (x + 1)² ≥ 0, so -(x + 1)² ≤ 0 and f(x) ≤ 7. The value 7 occurs at x = -1, so the range is (-∞, 7]. On [0, 2], the vertex x = -1 is outside the domain, and the function is decreasing there. So f(0) = -1 + 7 = 6 is the largest output and f(2) = -9 + 7 = -2 is the smallest. The range is [-2, 6].
Exercise
Find the range of f(x) = (x + 4) / (x - 1) by solving for x.
Show answer
Set y = (x + 4) / (x - 1). Then y(x - 1) = x + 4, so yx - y = x + 4, so x(y - 1) = y + 4, and x = (y + 4) / (y - 1). This is defined for every y except y = 1, and at y = 1 the equation x(0) = 5 has no solution. The range is all real numbers except 1, which is (-∞, 1) together with (1, ∞).