Domain and Range Calculator
Type f(x), and if you like an interval for x, then press Find domain and range. The domain is worked out from the expression as you typed it: a denominator must not be 0, a square root needs its argument at least 0 and a logarithm needs its argument above 0. Each restriction is solved exactly and the answers are intersected, so sqrt(x - 2)/(x - 3) gives [2, 3) ∪ (3, ∞), and x/x keeps 0 out even though it simplifies to 1. Irrational endpoints stay exact, such as √2, with a labeled decimal approximation listed under the answer. The range comes from the formula, never from a graph, for the listed families: constants, lines and quadratics, fractional-linear functions such as (2x + 1)/(x - 3), and a square root, logarithm or exponential of a linear expression, scaled and shifted. x^2 over (-2, 1] gives [0, 4). Any other expression the page reads still gets its exact domain, and its range is marked unsupported rather than guessed. A number line shows the open and closed ends, and a sampled plot is drawn as an illustration only.
Your input
Example input
Optional. Write an interval such as (-2, 1], [0, inf) or (-inf, 3), or leave it blank for all real x. Ends are numbers such as -2, 1.5 or 1/3; inf and -inf are always open.
Reads polynomials in x with rational coefficients, their sums, products and quotients when each denominator has degree 2 or less, sqrt and logarithms of polynomials of degree 2 or less, and exponentials of polynomials, such as sqrt(x - 2)/(x - 3), ln(x^2 - 4), 1/sqrt(4 - x^2) and 3·2^(x - 1) + 5. Use x, numbers, + - * / ^ and brackets, with sqrt, ln, log (base 10), log2, log_b(x), exp and e^. 2x means 2 times x, and 1/2x is read as x/2.
Result
Domain
Range
Read as f(x) = (2x + 1)/(x - 3).
Domain on a number line
Text equivalent: Number line for the domain: shaded from -∞ to 3 (open dot at 3); then shaded from 3 (open dot at 3) on to ∞. Points are in order and evenly spaced, not to scale.
Range on a number line
Text equivalent: Number line for the range: shaded from -∞ to 2 (open dot at 2); then shaded from 2 (open dot at 2) on to ∞. Points are in order and evenly spaced, not to scale.
Sampled plot, illustration only
Text equivalent: Sampled plot, an illustration only: 362 points of f(x) = (2x + 1)/(x - 3) for x from -3 to 9, with y shown from -19 to 23. Dashed vertical lines mark excluded x: x = 3. Dashed horizontal lines mark values f never reaches: y = 2. The domain and range above are worked out algebraically, not from these samples.
Domain (-∞, 3) ∪ (3, ∞); range (-∞, 2) ∪ (2, ∞).
- Domain
- (-∞, 3) ∪ (3, ∞)
- Range
- (-∞, 2) ∪ (2, ∞)
- Restriction
- x - 3 ≠ 0
- Family
- fractional-linear (exact range)
Restrictions
| From | Condition | Allowed x |
|---|---|---|
| Denominator x - 3 | x - 3 ≠ 0 | (-∞, 3) ∪ (3, ∞) |
Endpoints
- x = 3 is excluded: the denominator x - 3 is 0 there.
Range
- f(x) = (2x + 1)/(x - 3) is fractional-linear: it is decreasing on each side of x = 3 and approaches 2 as x → ±∞ without reaching it.
- Solving y = f(x) gives x = (3y + 1)/(y - 2), which has no value at y = 2.
- x ∈ (-∞, 3) gives y ∈ (-∞, 2)
- x ∈ (3, ∞) gives y ∈ (2, ∞)
- y = 2 is excluded: f approaches 2 as x → -∞ but never equals it.
Worked examples
Common questions
- How do you find the domain of a function?
- List everything that limits x, solve each one, then keep the x values that pass all of them. A denominator must not be 0, a square root needs its argument at least 0 and a logarithm needs its argument above 0. For sqrt(x - 2)/(x - 3), x - 2 ≥ 0 allows [2, ∞) and x - 3 ≠ 0 removes 3, so the domain is [2, 3) ∪ (3, ∞). The page shows each restriction with the x values it allows, then says why each endpoint is in or out: x = 2 is included because sqrt(0) is defined, and x = 3 is excluded because the denominator is 0 there.
- Why is 0 not in the domain of x/x if it simplifies to 1?
- Because x/x divides by zero at x = 0, and cancelling is only valid where the denominator is not 0. The page takes every restriction from the expression as you typed it, before any cancellation, so x/x has domain (-∞, 0) ∪ (0, ∞) and range {1}, and the result says it simplifies to 1 wherever it is defined. A cancelled factor can also remove a value from the range: (x^2 - 1)/(x - 1) is x + 1 with x = 1 left out, so its range is (-∞, 2) ∪ (2, ∞).
- How is the range worked out?
- From the formula, for the listed families only. A constant gives just its value. Otherwise, on each piece of the domain the function only rises or only falls (a quadratic is split at its vertex first), so the values or limits at the two ends of the piece fix the range, and whether an end is included decides whether its value is. For (2x + 1)/(x - 3), solving y = f(x) gives x = (3y + 1)/(y - 2), which has no value at y = 2, so the range is (-∞, 2) ∪ (2, ∞). For x^2 over (-2, 1], the vertex gives 0 and the value 4 would need x = -2 or x = 2, which the interval leaves out, so the range is [0, 4).
- Which functions can it handle?
- For the domain: polynomials in x with rational coefficients, their sums, products and quotients when each denominator has degree 2 or less, sqrt and logarithms (ln, log for base 10, log2 and log_b) of polynomials of degree 2 or less, and exponentials of polynomials up to degree 32, such as e^(x^2) or 3·2^(x - 1). A denominator may also be a square root or logarithm, as in 1/sqrt(x) or 1/ln(x). For the range: constants, lines, quadratics, fractional-linear functions, and a·sqrt, a·log or a·b^ of a linear expression plus a constant, all with rational coefficients. Anything else, such as sin(x), abs(x), x^(1/2), sqrt(ln(x)) or 1/(x^3 - x), is refused with the reason instead of an approximate answer, and a supported expression outside the range families gets its domain with the range marked unsupported.
- How are irrational endpoints shown?
- Exactly, in the form the quadratic formula gives, with a labeled decimal beside them. sqrt(x^2 - 2) has domain (-∞, -√2] ∪ [√2, ∞), listed with √2 ≈ 1.41421, and 1/(x^2 - x - 1) leaves out (1 - √5)/2 and (1 + √5)/2 ≈ 1.61803. Endpoints are put in order by exact comparison, not by their decimals, so roots that agree to many decimal places still come out in the right order.
- What does the Restrict x to field do?
- It limits x to an interval you choose, such as (-2, 1], [0, inf) or (-inf, 3), and the domain and range are then worked out on that interval. The result also shows the domain before the interval. An infinite end is always open, and [2, 2] gives the single value 2. Leave the field blank for all real x.
- Is the plot used to find the range?
- No. The sampled plot evaluates f at up to a few hundred points inside the domain and draws them as an illustration, with dashed lines at single x values the domain leaves out and at values f never reaches, such as x = 3 and y = 2 for (2x + 1)/(x - 3). The domain and range above it are worked out algebraically, and a function outside the range families gets Range: unsupported, never a range read off the curve. Clear Show sampled plot to hide it.
- Can I copy or keep the answer?
- Copy intervals puts f as it was read, the domain, the range or the reason it is unsupported, the family, every restriction, the endpoint reasons, the range working and the decimal approximations on the clipboard as text. If the browser refuses the clipboard, the same text appears in a box you can select. Everything is worked out in your browser, and the last function you worked out yourself is remembered on this device, not sent anywhere.
Exact algebraic constraints for supported rational-coefficient expressions; algebraic endpoints are shown symbolically with a labeled decimal approximation. Range is derived analytically only for the listed function families; any other input returns unsupported, never a range read from graph samples. Restrictions are taken from the expression as typed, before any algebraic cancellation.