Calculating Domain and Range of a Function
The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.
To calculate a function’s domain, find every input value for which the rule is defined; to calculate its range, find every output value the function can produce from those allowed inputs. Enter the function and its conditions to get the domain and range in interval or set notation.
Formula
This calculator applies to a quadratic function in vertex form, f(x) = ax² + bx + c, when a > 0 and the domain is restricted to the interval between its two real roots, inclusive. The default coefficients give f(x) = x², whose real roots coincide at zero.
The domain endpoints are the roots, found with the quadratic formula: x = (−b ± √(b² − 4ac)) / (2a). The range minimum is the vertex’s y-coordinate, c − b²/(4a). Here, a, b, and c are real coefficients, and x and f(x) are real input and output values; they have no fixed physical units. The calculator’s endpoint outputs describe this specific restricted-domain setup, not the domain and range of every possible function.
Worked Example
With the default values a = 1, b = 0, and c = 0, the function is f(x) = x².
- Calculate the discriminant: b² − 4ac = 0² − 4(1)(0) = 0.
- Find both roots: (−0 ± √0) / 2 = 0. The restricted domain is the single point [0, 0], or simply {0}.
- Calculate the minimum: 0 − 0² / (4 × 1) = 0. On this restricted domain, the only output is zero, so the range is also {0}.
The calculator displays both domain endpoints as 0.00 and the range minimum as 0.00. Because this example has a zero-width interval, it is useful for checking the formula but does not illustrate a range containing several values.
What Domain and Range Mean
A function assigns an output to each allowed input. The domain is the set of inputs, often written as x-values; the range is the set of outputs the function actually attains, often written as y-values. For example, if the rule is f(x) = x² and its domain is all real numbers, its range is [0, ∞): squaring never gives a negative result, and zero is attained at x = 0.
Do not confuse the range with the codomain, a set of possible outputs specified as part of a function’s definition. The range includes only outputs that occur for the chosen domain. Changing the domain can change the range without changing the rule. For x², restricting the domain to [1, 3] changes the range to [1, 9].
A Reliable Method for Finding the Domain
Start with the values the problem allows. If no restriction is given, check the rule for inputs that make an operation invalid over the real numbers. A useful checklist is:
- Denominators: exclude inputs that make a denominator zero. For f(x) = 1/(x − 2), the domain is all real numbers except 2.
- Even roots: require the expression under a square root or other even root to be nonnegative. For √(x − 3), require x ≥ 3.
- Logarithms: require the logarithm’s argument to be strictly positive. For ln(x + 4), require x > −4.
- Given context: a model may specify a limited interval, such as time from 0 to 10 seconds, even if the formula itself works beyond it.
Apply all relevant conditions at once. For example, √(x − 1)/(x − 3) requires x ≥ 1 and x ≠ 3, so its domain is [1, 3) ∪ (3, ∞).
Ways to Find the Range
To determine the range, track what happens to the output as the input runs through the domain. A graph makes this intuitive: inspect its vertical extent, including whether endpoints are reached. Algebra is often needed to prove the exact result.
- Use known shapes. The unrestricted parabola x² has minimum 0, so its range is [0, ∞). The unrestricted sine function has range [−1, 1].
- Find turning points. For a quadratic, the vertex occurs at x = −b/(2a). Check whether that input belongs to the domain, then compare its output with any endpoint outputs.
- Rewrite in terms of the output. Set y = f(x) and ask which y-values allow a real, domain-valid solution for x. For y = x² + 1, this requires y − 1 ≥ 0, giving range [1, ∞).
- Check boundaries and asymptotes. A value approached but never attained belongs to neither endpoint of a closed interval. For 1/x, zero is approached as the magnitude of x grows but is never an output.
Notation, Graphs, and Common Mistakes
Interval notation uses brackets for included endpoints and parentheses for excluded ones: [2, 5) includes 2 but not 5. Infinity always takes parentheses, as in (−∞, 4]. Use a union symbol, ∪, when the set has separate intervals. A single allowed value can be written as a set, such as {3}.
On a graph, the domain is the horizontal extent and the range is the vertical extent. Read the plotted curve, not just the axes: an open circle marks a point that is excluded, while a filled circle marks one that is included. A graphing window may hide distant parts of a curve, so visual inspection alone can miss an endpoint or asymptote.
Common errors include assuming every function has all real numbers as its domain, treating a limiting value as an attained output, and overlooking restrictions inherited from a stated context. Also distinguish the range on the specified domain from the range of the same formula on all real inputs.
Frequently Asked Questions
How do I find the domain from an equation?
Start with all real inputs, then remove values that make a denominator zero or make an even-root radicand negative, and require logarithm arguments to be positive. Intersect these conditions with any restrictions stated in the question.
How can I find the range without a graph?
Use algebra to characterize possible outputs: write y = f(x) and determine which y-values permit a valid input in the domain. For familiar functions, use their shape and check endpoints and turning points.
Can two functions have the same domain but different ranges?
Yes. For instance, f(x) = x and g(x) = x² both have all real numbers as their domain, but their ranges are respectively all real numbers and [0, ∞).
Does a range include a value at a horizontal asymptote?
Not merely because the graph approaches it. Include that value only if the function actually equals it for some allowed input. For example, 1/x never equals zero, so zero is excluded from its range.
What is the domain and range of a function’s inverse?
If an inverse function exists, its domain is the original function’s range, and its range is the original function’s domain. The original function must be one-to-one on the chosen domain for its inverse to be a function.
Related
Formula used
in a | Coefficient a | - | 1 | in b | Coefficient b | - | 0 | in c | Coefficient c | - | 0 | out domain_start | Domain lower bound | - | -b / (2 * a) - sqrt(b^2 - 4 * a * c) / (2 * a) | 2 out domain_end | Domain upper bound | - | -b / (2 * a) + sqrt(b^2 - 4 * a * c) / (2 * a) | 2 out range_min | Range minimum | - | c - b^2 / (4 * a) | 2
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.