Range of a Function
The range of a function, also called the image, is the set of all values taken by the dependent variable—that is, the set of all outputs produced by the function when evaluated at every element in its domain. For a function f, its range is denoted as Rf or Im(f).
Every function assigns to each element of an input set \(A\) (called the domain) a unique element of a target set \(B\) (called the codomain). Because all output values must belong to the target set, the range is always a subset of the codomain (\(R_f \subseteq C_f\)).
In the case of real-valued functions of a real variable, the range is always a subset of the real numbers. If \(f\) is a real function with domain \(D_f,\) its range is formally defined as:
$$R_f = \{y \in \mathbb{R} \mid y = f(x) \land x \in D_f\}$$
In practice, the ranges of real functions are typically expressed using intervals (open, closed, half-open, finite, or infinite), unions of intervals, or set differences. Furthermore, when no explicit domain is specified for a real function, its range is determined by its natural domain.
Unlike the domain, which is essential to find in order to know where the function is defined, finding the range is not always required in an introductory analysis. However, knowing the range is indispensable for determining whether a function is onto (surjective) and, above all, for working with the inverse function \(f^{-1}:\) when a function has an inverse, its sets swap symmetrically, so that the range of \(f\) becomes the domain of \(f^{-1}\) (\(D_{f^{-1}} = R_f\)) and the domain of \(f\) becomes the range of \(f^{-1}\) (\(R_{f^{-1}} = D_f\)).
Table of Contents
Difference Between Range and Codomain
Although both sets are associated with the outputs of a function, the range and the codomain serve distinct roles: whereas the codomain (Cf) encompasses all possible output values defined in advance for the function, the range or image (Rf) collects exclusively the values that the function actually reaches when applying its rule of correspondence across the domain.
Because of this distinction, the range is always contained within the codomain (\(R_f \subseteq C_f\)), though the two sets do not have to be identical. It is common for the codomain to contain leftover elements that are not the output of any value in the domain. When both sets coincide (\(R_f = C_f\)), the function is called onto (or surjective).
A simple way to visualize this idea is to picture a classroom with 25 desks attended by 20 students. If each student sits at a single desk, a functional relationship is established in which 20 seats are occupied and 5 remain empty. In this scenario, the 20 students represent the domain, the 25 available desks form the codomain, and only the 20 occupied desks make up the range.
In the following diagram, we can visualize another functional relationship between two sets:
Looking at the mapping diagram above, we can clearly distinguish the three sets involved in the function:
- The domain consists of the elements in the input set: \(D_f = \{a, b, c, d\}.\)
- The codomain is the entire target set: \(C_f = \{1, 2, 3, 4, 5, 7\}.\)
- The range or image includes only the elements that receive an arrow: \(R_f = \{4, 5, 7\}.\)
Here we can see that the numbers \(1,\) \(2,\) and \(3\) belong to the codomain \(C_f,\) but remain outside the range \(R_f\) because no element in \(D_f\) maps to them.
How to Find the Range of a Function
To determine the range of a function, we must identify which real values the dependent variable \(y = f(x)\) can take as \(x\) varies over the entire domain \(D_f.\) When we have the graph in the Cartesian plane, the range is read by projecting the curve horizontally onto the vertical axis (the \(y\)-axis): the interval or set of vertical heights covered by this projection corresponds exactly to \(R_f.\)
However, when we only have the algebraic equation, we need to deduce those possible output values using analytical reasoning. Because there is no single universal formula for finding the range of every expression, we rely primarily on two complementary strategies depending on the structure of the function: solving for the independent variable or bounding the expression starting from the domain.
Method 1: Solving for the Independent Variable
This procedure is especially practical when the equation allows us to isolate the variable \(x\) in terms of \(y\) directly and without sign ambiguities, as happens with linear, linear rational, exponential, or logarithmic functions. It consists of reversing the operational roles to analyze which values of \(y\) produce valid values of \(x:\)
- Set the function expression equal to the dependent variable: \(y = f(x).\)
- Solve for the variable \(x\) in terms of \(y.\)
- Analyze the algebraic restrictions of the resulting expression (nonzero denominators, nonnegative radicands for even roots, or positive arguments for logarithms) to determine the real values that \(y\) can take.
When applying this method, caution is needed: if during the algebraic manipulation we square both sides or perform operations that alter the original sign of the expression, extraneous values of \(y\) that do not actually belong to the range may appear. For this reason, we must always cross-check the result against the inherent restrictions of the original formula and its domain.
Example 1
Find the range of the rational function \(f(x) = \dfrac{2x + 1}{x - 3}.\)
To find the range, we write \(y = \dfrac{2x + 1}{x - 3}\) and solve for \(x.\) We multiply both sides by \((x - 3)\) (with \(x \neq 3\)) and group the terms containing \(x:\)
$$y(x - 3) = 2x + 1$$
$$xy - 3y = 2x + 1$$
$$xy - 2x = 3y + 1$$
$$x(y - 2) = 3y + 1$$
We divide by \((y - 2)\) to isolate \(x:\)
$$x = \dfrac{3y + 1}{y - 2}$$
Notice that the resulting expression is a fraction whose denominator cannot be zero, so we require \(y - 2 \neq 0,\) meaning \(y \neq 2.\) Since any other real number assigned to \(y\) yields a valid value for \(x\) (and no \(x\) makes \(f(x) = 2\)), we conclude that the range is \(R_f = \mathbb{R} \setminus \{2\}.\)
Example 2
Find the range of the shifted exponential function \(g(x) = 3^x - 2.\)
We set up the equation \(y = 3^x - 2\) and begin solving for \(x\) by adding \(2\) to both sides:
$$y + 2 = 3^x$$
We apply the base-\(3\) logarithm to both sides of the equation to bring down the exponent:
$$x = \log_3(y + 2)$$
Since a logarithm is defined in the real numbers only when its argument is strictly positive, we impose the condition \(y + 2 > 0.\) Solving this inequality gives \(y > -2,\) which means the range of the function is \(R_g = (-2, \infty).\)
Example 3
Determine the range of the radical function \(h(x) = \sqrt{x - 2}.\)
If we start from \(y = \sqrt{x - 2}\) and square both sides to solve for \(x,\) we obtain:
$$y^2 = x - 2 \implies x = y^2 + 2$$
At first glance, the expression \(y^2 + 2\) accepts any real number for \(y.\) However, the principal square root outputs only nonnegative values, so the original equation \(y = \sqrt{x - 2}\) imposes the implicit condition \(y \ge 0.\) Intersecting all real numbers with the restriction \(y \ge 0\) shows that the actual range is \(R_h = [0, \infty).\)
Method 2: Bounding the Expression from the Domain
When a function involves even powers, square roots, absolute values, or an explicitly restricted domain, solving for \(x\) often introduces double signs (\(\pm\)) or requires extra casework. In these situations, it is safer to build the expression for \(f(x)\) step by step starting from the known values of the domain:
- Identify the interval or inequality describing the domain \(D_f\) (or start from a guaranteed basic bound, such as \(x^2 \ge 0\) or \(\sqrt{x} \ge 0\)).
- Apply successive algebraic operations to both sides of the inequality (adding, multiplying, raising to a power) while respecting inequality rules until \(f(x) = y\) is reconstructed.
Example 1
Find the range of the quadratic function \(f(x) = x^2.\)
The natural domain of this function is the entire set of real numbers (\(D_f = \mathbb{R}\)). We know that the square of any real number is never negative, so the following inequality holds:
$$x^2 \ge 0$$
Since \(y = x^2,\) we substitute directly and obtain \(y \ge 0.\) This indicates that the function takes values from \(0\) upward with no upper bound, so its range is \(R_f = [0, \infty).\)

Example 2
Determine the range of the function \(g(x) = \sqrt{x} + 4.\)
We begin by identifying the natural domain: the radicand must be nonnegative, so \(x \ge 0,\) meaning \(D_g = [0, \infty).\) Since the square root of a nonnegative number is also greater than or equal to zero, we start with the base inequality:
$$\sqrt{x} \ge 0$$
To rebuild the complete formula of the function, we add \(4\) to both sides of the inequality:
$$\sqrt{x} + 4 \ge 0 + 4$$
$$\sqrt{x} + 4 \ge 4$$
Replacing \(\sqrt{x} + 4\) with \(y,\) we arrive at \(y \ge 4.\) Consequently, the dependent variable takes only values greater than or equal to \(4,\) which determines the range \(R_g = [4, \infty).\)
Example 3
Calculate the range of the quadratic function \(h(x) = (x - 1)^2 + 3\) restricted to the domain \(D_h = [-1, 2].\)
We start from the inequality defining the restricted domain \(x \in [-1, 2]\) and build the expression for \(h(x)\) from the inside out. First, we subtract \(1\) from all three parts:
$$-1 \le x \le 2$$
$$-2 \le x - 1 \le 1$$
Next, we square the expression. Since the interval \([-2, 1]\) contains \(0,\) the minimum value of the square is \(0^2 = 0,\) while the maximum comes from the endpoint with the larger absolute value, which is \((-2)^2 = 4:\)
$$0 \le (x - 1)^2 \le 4$$
Finally, we add \(3\) to all parts to complete the function formula:
$$3 \le (x - 1)^2 + 3 \le 7$$
$$3 \le y \le 7$$
Thus, the range of the function over the given interval is \(R_h = [3, 7].\)
Range of a Piecewise Function
When a function is defined by different algebraic expressions depending on the subinterval of the domain, its total range is found by calculating the range of each piece separately and taking the union of all those results. If the function \(f\) consists of \(n\) pieces with partial ranges \(R_{f_1}, R_{f_2}, \dots, R_{f_n},\) then:
$$R_f = R_{f_1} \cup R_{f_2} \cup \dots \cup R_{f_n}$$
When combining the resulting subsets, it is important to check carefully whether the endpoints of each interval are open or closed, since an open endpoint from one branch may be covered by another or, conversely, leave a visible gap in the final range.
Example
Determine the range of the following piecewise function:
$$f(x) = \begin{cases} x + 1 & \text{if } -2 \le x < 1 \\ x^2 + 2 & \text{if } x \ge 1 \end{cases}$$
To find the complete range, we analyze each branch starting from the inequalities that define its subdomain:
- First piece: For \(-2 \le x < 1,\) the rule is \(y = x + 1.\) Adding \(1\) to all three parts of the inequality yields \(-1 \le x + 1 < 2,\) so the range of this branch is the half-open interval \(R_{f_1} = [-1, 2).\)
- Second piece: For \(x \ge 1,\) the rule is \(y = x^2 + 2.\) Since \(x\) takes values greater than or equal to \(1,\) its square satisfies \(x^2 \ge 1.\) Adding \(2\) to both sides gives \(x^2 + 2 \ge 3,\) so the range of this branch is \(R_{f_2} = [3, \infty).\)
When combining both subsets, we observe that there is a jump between \(2\) and \(3\) with no output values, so the range of the entire function is expressed as the union of two disjoint intervals:
$$R_f = [-1, 2) \cup [3, \infty)$$
Ranges of Elementary Functions
Knowing the behavior of the most common families of functions allows you to identify their ranges directly without repeating the full algebraic derivation every time. Below, we review the ranges of the main elementary functions over their natural domains.
Constant Functions
The range of a constant function is the singleton set containing only the constant value itself. That is, for the function \(f(x) = c,\) where \(c\) is a real number, the range is \(R_f = \{c\}.\)
Examples
- The range of \(f(x) = 5\) is \(R_f = \{5\}.\)
- The range of \(g(x) = -8\) is \(R_g = \{-8\}.\)
Linear Functions
Nonconstant linear functions have the entire set of real numbers as their range. That is, the function \(f(x) = mx + b,\) where \(m\) and \(b\) are real numbers and \(m \neq 0,\) has range \(R_f = \mathbb{R}.\)
Examples
- The range of \(f(x) = -6x\) is \(R_f = \mathbb{R}.\)
- The range of \(y = 20x - 3\) is \(\mathbb{R}.\)
Quadratic Functions
The range of a quadratic function \(f(x) = ax^2 + bx + c\) (with \(a \neq 0\)) is determined by the \(y\)-coordinate \(k\) of its vertex \(V(h, k),\) where \(h = \dfrac{-b}{2a}\) and \(k = f(h).\) If the leading coefficient \(a\) is positive, the parabola opens upward and \(k\) is its minimum value; if \(a\) is negative, it opens downward and \(k\) is its maximum value:
If \(a > 0,\) \(R_f = [k, \infty)\)
If \(a < 0,\) \(R_f = (-\infty, k]\)
Examples
- The range of \(y = -2x^2 + 3x + 1\) is \((-\infty, \frac{17}{8}].\)
- The range of \(f(x) = x^2 + 9\) is \(R_f = [9, \infty).\)
Cubic Functions
The range of every cubic function is the set of real numbers. That is, any third-degree polynomial \(f(x) = ax^3 + bx^2 + cx + d,\) where \(a, b, c, d \in \mathbb{R}\) and \(a \neq 0,\) satisfies \(R_f = \mathbb{R}.\)
Examples
- The range of \(f(x) = 3x^3 - 4\) is \(\mathbb{R}.\)
- The range of \(y = -x^3 + 2x^2 + 3\) is \(\mathbb{R}.\)
Polynomial Functions
In general, for any polynomial function of degree \(n \ge 1,\) the structure of its range depends on whether the degree is even or odd:
- If the degree is odd, the ends of the graph extend in opposite directions without bound, so its range is always \(R_f = \mathbb{R}.\)
- If the degree is even, both ends point in the same direction, meaning the function reaches an absolute minimum \(y_{\min}\) (if the leading coefficient is positive, \(R_f = [y_{\min}, \infty)\)) or an absolute maximum \(y_{\max}\) (if the leading coefficient is negative, \(R_f = (-\infty, y_{\max}]\)).
Examples
- The range of \(f(x) = x^5 - 4x^2 + 1\) is \(\mathbb{R}\) because its degree is odd.
- The range of \(g(x) = x^4 + 2\) is \([2, \infty),\) since \(x^4 \ge 0\) for all real numbers.
Absolute Value Functions
The basic absolute value function \(f(x) = |x|\) always returns nonnegative distances, so its range is \(R_f = [0, \infty).\) In its transformed form \(f(x) = a|x - h| + k\) (with \(a \neq 0\)), the vertex is located at \((h, k)\) and the range is determined by the sign of \(a:\)
If \(a > 0,\) \(R_f = [k, \infty)\)
If \(a < 0,\) \(R_f = (-\infty, k]\)
Examples
- The range of \(f(x) = |x - 3| + 5\) is \([5, \infty).\)
- The range of \(g(x) = -2|x + 1| + 4\) is \((-\infty, 4].\)
Rational Functions
The range of a rational function may coincide with all real numbers or have exclusions and bounds depending on the degrees of its numerator and denominator. In the specific case of nondegenerate linear rational functions \(f(x) = \dfrac{ax + b}{cx + d}\) (with \(c \neq 0\) and \(ad - bc \neq 0\)), the range consists of all real numbers except the value of its horizontal asymptote \(y = \dfrac{a}{c}.\)
Examples
- The range of \(y = \dfrac{1}{x}\) is \(\mathbb{R} \setminus \{0\}.\)
- The range of \(y = \dfrac{2x + 1}{x + 3}\) is \(\mathbb{R} \setminus \{2\}.\)
Note: The rule of excluding only the horizontal asymptote applies exclusively to linear rational functions of the form \(\frac{ax+b}{cx+d}.\) In other rational functions where the numerator or denominator has degree greater than \(1,\) the curve can cross or touch its horizontal asymptote at finite values of \(x,\) meaning that \(y\)-value is included in the range (for example, for \(f(x) = \dfrac{x}{x^2 + 1},\) the horizontal asymptote is \(y = 0,\) but the graph crosses it at \(x = 0\) and its range is \(\left[-\frac{1}{2}, \frac{1}{2}\right]\)). Likewise, if common factors cancel out upon simplification, additional holes may appear in the range.
Radical Functions
The range of a simple radical function \(f(x) = \sqrt[n]{x}\) depends on whether the root index \(n\) is even or odd. When \(n\) is even, the principal root yields only nonnegative values; when \(n\) is odd, it accepts any real number as an output.
Examples
- The range of \(y = \sqrt{x}\) is \([0, \infty).\)
- The range of \(y = \sqrt[3]{2x + 1}\) is \(\mathbb{R}.\)
Exponential Functions
The range of a basic exponential function with a positive base not equal to one is the set of positive real numbers. That is, for \(f(x) = a^x\) with \(a > 0\) and \(a \neq 1,\) the range is \(R_f = (0, \infty).\)
Examples
- The range of the natural exponential function \(y = e^x\) is \((0, \infty).\)
- The range of \(y = \left(\frac{1}{2}\right)^x\) is \((0, \infty).\)
- The range of \(y = 2^x\) is \((0, \infty).\)
Logarithmic Functions
The range of every basic logarithmic function is the set of real numbers. That is, the function \(f(x) = \log_a(x),\) where \(a > 0\) and \(a \neq 1,\) has range \(R_f = \mathbb{R}.\)
Examples
- The range of the natural logarithm \(f(x) = \ln(x)\) is \(R_f = \mathbb{R}.\)
- The range of the common logarithm \(y = \log(x)\) is \(\mathbb{R}.\)
Trigonometric Functions
The following table summarizes the standard formulas and the range of the trigonometric functions over their natural domains:
| Function | Formula | Range |
|---|---|---|
| Sine | f(x) = sin(x) | \([-1, 1]\) |
| Cosine | f(x) = cos(x) | \([-1, 1]\) |
| Tangent | f(x) = tan(x) | \(\mathbb{R}\) |
| Cosecant | f(x) = csc(x) | \((-\infty, -1] \cup [1, \infty)\) |
| Secant | f(x) = sec(x) | \((-\infty, -1] \cup [1, \infty)\) |
| Cotangent | f(x) = cot(x) | \(\mathbb{R}\) |
Inverse Trigonometric Functions
For the trigonometric functions to have inverses, their domains are restricted to standard intervals; consequently, the principal ranges of the inverse trigonometric functions are bounded as follows:
| Function | Formula | Range |
|---|---|---|
| Arcsine | f(x) = arcsin(x) | \(\left[-\dfrac{\pi}{2}, \dfrac{\pi}{2}\right]\) |
| Arccosine | f(x) = arccos(x) | \([0, \pi]\) |
| Arctangent | f(x) = arctan(x) | \(\left(-\dfrac{\pi}{2}, \dfrac{\pi}{2}\right)\) |
| Arccosecant | f(x) = arccsc(x) | \(\left[-\dfrac{\pi}{2}, 0\right) \cup \left(0, \dfrac{\pi}{2}\right]\) |
| Arcsecant | f(x) = arcsec(x) | \(\left[0, \dfrac{\pi}{2}\right) \cup \left(\dfrac{\pi}{2}, \pi\right]\) |
| Arccotangent | f(x) = arccot(x) | \((0, \pi)\) |
Did you find this useful? Rate it!
Leave a Reply




Related Articles