Domain and Range Calculator
Domain and range of a function in interval notation, with steps
The domain of a function is every x you can put in; the range is every output y that comes out. To find the domain, remove the x-values that make a denominator 0, put a negative number under an even root, or give a logarithm an input of 0 or less. For f(x) = โ(9 โ xยฒ) the domain is [โ3, 3] and the range is [0, 3].
Last updated October 2026
Method: The function is parsed into an expression tree and checked node by node: denominators โ 0, even roots โฅ 0, logarithms > 0, arcsine and arccosine inputs in [โ1, 1], and the periodic exclusions of tan, sec, csc and cot. Zeros come from exact algebra (rational roots, the quadratic and cubic formulas) or numeric root finding. Ranges are exact for polynomials, rational functions and chains of standard functions, and a labeled estimate otherwise.
Included: Domain and range in interval and set-builder notation, a step for every restriction, a number line, exact endpoints such as โ2, ฯ/2 or 1/4 where they exist, and a two-way converter between inequalities and interval notation.
Not included: Complex numbers, piecewise definitions, floor and other step functions, implicit relations, trig functions with non-linear arguments inside tan, sec, csc or cot, and domains that split into infinitely many unevenly spaced pieces, such as ln(sin(xยฒ)). Angles are in radians.
โ๏ธ Domain, range and interval notation
Read as: f(x) = โ(9 โ xยฒ)
How to type a function
- Use x as the variable. Powers with ^ (x^2), roots with sqrt(x), cbrt(x) or nthRoot(x, 4).
- log(x) is the common log (base 10), ln(x) the natural log, log(x, 2) a log with base 2.
- Trig: sin, cos, tan, sec, csc, cot, asin, acos, atan. Angles are in radians; pi is ฯ.
- Absolute value: abs(x - 1) or |x - 1|. e^x or exp(x) for the exponential.
- 2x and 3(x + 1) work without a times sign, but 1/2x means (1/2)ยทx. Write 1/(2x) for one over 2x.
โ๏ธ Domain of f(x) = โ(9 โ xยฒ)
{x | โ3 โค x โค 3}
RangeExact
{y | 0 โค y โค 3}
๐ Domain on the number line
๐ How the domain was found
- 1. Square root needs a nonnegative argument: 9 โ xยฒ โฅ 0 โ โ3 โค x โค 3
- 2. Keep the x-values that pass every test: [โ3, 3]
๐งฎ How the range was found
- 9 โ xยฒ takes the values (โโ, 9].
- Applying the square root to [0, 9], the part of (โโ, 9] where it is defined, gives [0, 3].
Domain and range calculator: rules, worked examples and interval notation
A domain and range calculator answers two questions: which inputs are allowed, and which outputs actually occur? The first is mechanical once you know the few rules that forbid an input; the second depends on the shape of the graph. This page covers both in the interval notation most courses expect, with steps you can reproduce on paper.
What domain and range mean
Think of a function as a machine. The domain is the set of numbers it accepts without breaking, and the range is the set of numbers it can hand back. Unless a problem states otherwise, the domain is the natural one: every real number for which the formula gives a real result. On a graph, the domain is the curve's shadow on the x-axis and the range its shadow on the y-axis. f(x) = xยฒ โ 4x + 1 accepts every real number, so its domain is (โโ, โ), but it never dips below โ3, so its range is [โ3, โ).
The rules that restrict a domain
Only a few operations can reject a real input. Everything else (sums, products, integer powers, odd roots, |x|, eหฃ, sin and cos) accepts every real number. Write one condition for each restricted operation, solve it, and keep the x-values that pass all of them:
p(x)/q(x): q(x) โ 0 โu, โดโu, u^(1/2): u โฅ 0 ln u, log u: u > 0 arcsin u, arccos u: โ1 โค u โค 1 tan u, sec u: u โ ฯ/2 + kฯ cot u, csc u: u โ kฯ The inequality signs matter: โ0 is fine, so roots use โฅ, while ln 0 is undefined, so logarithms use >. When operations combine, every condition applies at once: f(x) = 1/โ(4 โ x) needs 4 โ x โฅ 0 for the root and โ(4 โ x) โ 0 for the denominator, which together leave x < 4.
Worked example: the domain and range of (x + 1)/(x โ 2)
Domain. The only restriction is the denominator. Setting x โ 2 = 0 gives x = 2, so the domain is every real number except 2:
x โ 2 โ 0 โ x โ 2 โ (โโ, 2) โช (2, โ) Range. Write y = (x + 1)/(x โ 2) and solve for x. Multiplying out gives yx โ 2y = x + 1, so x(y โ 1) = 2y + 1 and x = (2y + 1)/(y โ 1). That formula produces a valid x for every y except y = 1, where it would divide by zero. So the function never outputs 1, and every other value is reached:
x = (2y + 1)/(y โ 1) โ y โ 1 โ (โโ, 1) โช (1, โ) The missing value is the horizontal asymptote, the ratio of the leading coefficients (1 รท 1 = 1). A few spot checks agree: f(0) = โ1/2, f(3) = 4 and f(5) = 2, and no input lands exactly on 1. The calculator reports the same domain and range and lists the vertical asymptote x = 2 and the horizontal asymptote y = 1 as its reasoning.
Worked example: the domain and range of โ(9 โ xยฒ)
Domain. The expression under the square root must not be negative:
9 โ xยฒ โฅ 0 โ xยฒ โค 9 โ โ3 โค x โค 3 โ [โ3, 3] Both endpoints are included because โ0 = 0 is a perfectly good output, so the interval uses brackets.
Range. On its own, 9 โ xยฒ takes every value up to its maximum of 9 at x = 0, that is (โโ, 9]. The square root only sees the part from 0 to 9, and it turns [0, 9] into [0, 3]. So the range is [0, 3]: f(0) = 3 is the top, f(โ3) = f(3) = 0 is the bottom, and values in between such as f(โ5) = 2 fill the gap. The graph is the upper half of the circle xยฒ + yยฒ = 9, which makes both answers easy to see. This is the calculator's default example.
Domain and range of 17 common functions
Every row comes from the calculator above; paste any function from the first column to check the other two.
| f(x) | Domain | Range |
|---|---|---|
| xยฒ โ 4x + 1 | (โโ, โ) | [โ3, โ) |
| โ2(x โ 1)ยฒ + 8 | (โโ, โ) | (โโ, 8] |
| โ(x โ 3) + 2 | [3, โ) | [2, โ) |
| โ(9 โ xยฒ) | [โ3, 3] | [0, 3] |
| 1/โ(4 โ x) | (โโ, 4) | (0, โ) |
| 1/x | (โโ, 0) โช (0, โ) | (โโ, 0) โช (0, โ) |
| (x + 1)/(x โ 2) | (โโ, 2) โช (2, โ) | (โโ, 1) โช (1, โ) |
| 1/(xยฒ โ 4) | (โโ, โ2) โช (โ2, 2) โช (2, โ) | (โโ, โ1/4] โช (0, โ) |
| x/(xยฒ + 1) | (โโ, โ) | [โ1/2, 1/2] |
| (xยฒ โ 1)/(x โ 1) | (โโ, 1) โช (1, โ) | (โโ, 2) โช (2, โ) |
| |x โ 1| + 2 | (โโ, โ) | [2, โ) |
| 2^x โ 3 | (โโ, โ) | (โ3, โ) |
| e^(โxยฒ) | (โโ, โ) | (0, 1] |
| ln(xยฒ โ 9) | (โโ, โ3) โช (3, โ) | (โโ, โ) |
| 3sin(2x) + 1 | (โโ, โ) | [โ2, 4] |
| tan(x) | (โฯ/2 + kฯ, ฯ/2 + kฯ), k any integer | (โโ, โ) |
| asin(2x โ 1) | [0, 1] | [โฯ/2, ฯ/2] |
Three rows deserve a second look. In 1/(xยฒ โ 4) the range splits into two pieces because the outputs between โ1/4 and 0 never occur. In x/(xยฒ + 1) the horizontal asymptote y = 0 is still part of the range, since f(0) = 0. And (xยฒ โ 1)/(x โ 1) loses exactly one output, 2, because of a hole at x = 1.
How to find the range of a function
A range of a function calculator has to pick a method that fits the formula, and so do you. Four methods cover most homework:
- Quadratics: use the vertex. For f(x) = axยฒ + bx + c the vertex sits at x = โb รท (2a). For xยฒ โ 4x + 1 that is x = 2 with f(2) = โ3, so the range is [โ3, โ) because a > 0.
- Rational functions: solve for x. As in the first example, rearrange y = f(x) into x in terms of y and look for forbidden y-values. Then check whether the turning points limit the range further, as they do for x/(xยฒ + 1).
- Transformed parent functions: follow the range. โu always gives [0, โ), eแต gives (0, โ) and sin u gives [โ1, 1]. Multiplying stretches the range and adding shifts it: 3 sin(2x) + 1 runs from 3(โ1) + 1 = โ2 to 3(1) + 1 = 4.
- Everything else: find the turning points. Set the derivative to 0, evaluate f at those points and at the ends of the domain, and include any values approached near asymptotes. That is what the calculator does numerically when no exact method applies.
Interval notation, set-builder notation and inequalities
An interval notation calculator converts between three ways of writing the same set. A parenthesis means the endpoint is left out, a bracket means it is included, โช joins separate pieces, and โ always gets a parenthesis because infinity is not a number you can include. Set-builder notation describes the set by a condition, as in {x | x โฅ 3}. The converter tab in the calculator handles all three in both directions; these rows come straight from it:
| Inequality | Interval notation | Set-builder notation |
|---|---|---|
| โ2 < x โค 5 | (โ2, 5] | {x | โ2 < x โค 5} |
| x โฅ 3 | [3, โ) | {x | x โฅ 3} |
| 0 โค x < 1 | [0, 1) | {x | 0 โค x < 1} |
| โ3 โค x โค 3 | [โ3, 3] | {x | โ3 โค x โค 3} |
| x < โ1 or x > 4 | (โโ, โ1) โช (4, โ) | {x | x < โ1 or x > 4} |
| x โ 0 | (โโ, 0) โช (0, โ) | {x โ โ | x โ 0} |
| x = 4 | {4} | {x | x = 4} |
| any real number | (โโ, โ) | {x | x โ โ} |
Trig functions: domains that repeat
Sine and cosine accept every real number, but tan x = sin x รท cos x and sec x = 1 รท cos x break wherever cos x = 0, at x = ฯ/2 + kฯ for every integer k. Those exclusions repeat forever, so the domain is a rule rather than a list: the calculator writes the domain of tan(x) as (โฯ/2 + kฯ, ฯ/2 + kฯ) for every integer k, or {x โ โ | x โ ฯ/2 + kฯ, k โ โค}. A coefficient changes the spacing: tan(2x) excludes x = ฯ/4 + kฯ/2. Cotangent and cosecant divide by sin x, so they exclude x = kฯ. Arcsine and arccosine only accept inputs from โ1 to 1, which is why asin(2x โ 1) has domain [0, 1] and range [โฯ/2, ฯ/2].
How to use this calculator
Type the right-hand side of f(x) into the box. Use ^ for powers, sqrt() or โ for square roots, cbrt() for cube roots, abs() or vertical bars for absolute value, and pi for ฯ. log(x) is the common logarithm, ln(x) the natural logarithm and log(x, 2) a base-2 logarithm. You can write 2x or 3(x + 1) without a times sign, but note that 1/2x is read as (1/2)x, following the parser's documented rules; type 1/(2x) for one over 2x. The "Read as" line repeats your function in standard notation so you can catch a misreading before trusting the answer.
The result card shows the domain and range in interval notation with set-builder notation underneath, and marks the range as Exact or Estimate. Below it come a number line, one line per restriction and an explanation of the range. The converter tab turns an inequality such as โ2 < x โค 5 into interval notation or back. Students use it to check algebra and precalculus homework; teachers use the step list for answer keys.
Key terms
- Domain: all inputs x for which the function gives a real output.
- Range: all outputs y the function actually produces.
- Natural domain: the largest domain the formula allows, used when no domain is stated.
- Vertical asymptote: an excluded x where the function grows without bound, as at x = 2 for (x + 1)/(x โ 2).
- Hole: an excluded x where the function approaches a finite value instead, as at (1, 2) for (xยฒ โ 1)/(x โ 1).
- Interval notation: a set written with parentheses, brackets and โช, such as (โโ, 2) โช (2, โ).
- Set-builder notation: a set written as a condition, such as {x โ โ | x โ 2}.
Tips for checking your answer
- Find the domain from the original formula, before you simplify anything.
- Test one value just inside and one just outside each endpoint of the domain.
- For the range, try to solve y = f(x) for x; forbidden y-values usually show up immediately.
- Sketch the graph and read both shadows: x-axis for the domain, y-axis for the range.
Limitations: when the range is an estimate
Domains are found with exact rules. The only approximations appear when a boundary has no closed form, such as the single real root of xยณ + x + 1, which is shown as โโ0.6823. Ranges are exact for polynomials, rational functions and single chains of standard functions. For mixed expressions such as xยทeหฃ or x โ ln x, the calculator samples thousands of points, refines every turning point and studies the behavior near asymptotes and at infinity. That works well for smooth functions, but a numeric search cannot prove that a value is never reached, so those ranges carry an Estimate label. A function such as ln(sin(xยฒ)) has a domain made of infinitely many pieces that shrink and never repeat evenly; no list of intervals can hold it, so the calculator says so instead of printing a partial list.
Related calculators
- To solve the inequalities that domain conditions produce, use the Inequality Calculator.
- For the vertex that bounds a quadratic's range, use the Vertex Calculator.
- For the zeros of a denominator or of the expression under a root, use the Quadratic Formula Calculator or the Factoring Calculator.
- To find where a graph crosses the axes, use the X and Y Intercept Calculator.
- For values of logarithms and trig functions, use the Logarithm Calculator and the Trigonometry Calculator.
Sources
Domain and range follow from the definitions of the functions themselves, so every result on this page is computed rather than looked up. The definitions behind the rules:
- NIST Digital Library of Mathematical Functions, ยง4.2, Definitions: ln x is real for positive x, and log base a is ln z รท ln a.
- NIST Digital Library of Mathematical Functions, ยง4.14, Definitions and Periodicity: tan, csc, sec and cot as quotients of sin and cos, and their periods.
- NIST Digital Library of Mathematical Functions, ยง4.23, Inverse Trigonometric Functions: the principal values of arcsin, arccos and arctan.
- math.js documentation, Expression syntax: how typed input is parsed, including the implicit multiplication rule behind 1/2x.
โ ๏ธ Common mistakes & edge cases
Simplifying before finding the domain
(xยฒ โ 1)/(x โ 1) simplifies to x + 1, whose domain is every real number. The original function is still undefined at x = 1, so its domain is (โโ, 1) โช (1, โ). Read restrictions off the formula as given.
Putting a bracket next to infinity
[3, โ] is not valid interval notation. Infinity is not a number that can be included, so it always takes a parenthesis: [3, โ).
Using > for roots or โฅ for logarithms
โ(x โ 3) is defined at x = 3, so its domain is [3, โ), not (3, โ). ln(x โ 3) is not defined at x = 3, so its domain is (3, โ). The difference is a single point, but graders look for it.
Assuming the range is all real numbers
A domain of (โโ, โ) says nothing about the range. xยฒ โ 4x + 1 accepts every x but only produces values from โ3 upward, and 1/(xยฒ โ 4) never outputs anything between โ1/4 and 0.
Excluding every horizontal asymptote from the range
The asymptote of (x + 1)/(x โ 2) is missing from its range, but x/(xยฒ + 1) reaches its asymptote y = 0 at x = 0. Check whether f(x) equals the asymptote value for some x before removing it.
Typing 1/2x when you mean 1/(2x)
This calculator reads 1/2x as (1/2)x, which has domain (โโ, โ). One over 2x needs parentheses: 1/(2x) has domain (โโ, 0) โช (0, โ).
❓ Frequently asked questions
How do you find the domain of a function?
Start with all real numbers and remove every x that breaks a rule: a denominator cannot be 0, an even root needs a nonnegative input, a logarithm needs a positive input, and arcsine or arccosine need an input from โ1 to 1. For f(x) = 1/โ(4 โ x), the root needs 4 โ x โฅ 0 and the denominator needs โ(4 โ x) โ 0, so the domain is x < 4, written (โโ, 4).
How do you find the range of a function?
Match the method to the formula. For a quadratic, use the vertex. For a rational function such as (x + 1)/(x โ 2), solve y = f(x) for x: x = (2y + 1)/(y โ 1) fails only at y = 1, so the range is (โโ, 1) โช (1, โ). For a transformed parent function, follow the range through each step: โ(x โ 3) + 2 shifts the root's [0, โ) up to [2, โ).
What are the domain and range of a quadratic function?
The domain of every quadratic is all real numbers, (โโ, โ). The range starts or ends at the vertex. For f(x) = xยฒ โ 4x + 1 the vertex is at x = 2 with f(2) = โ3, and the parabola opens upward, so the range is [โ3, โ). For f(x) = โ2(x โ 1)ยฒ + 8 it opens downward from the vertex (1, 8), so the range is (โโ, 8].
How do you write domain and range in interval notation?
Write each piece as (a, b) with a parenthesis for an endpoint that is excluded and a bracket for one that is included, and join separate pieces with the union symbol โช. Infinity always gets a parenthesis. The inequality โ2 < x โค 5 becomes (โ2, 5], x โฅ 3 becomes [3, โ), and x โ 0 becomes (โโ, 0) โช (0, โ).
What is the domain of a square root function?
Set the expression under the root greater than or equal to 0 and solve. For โ(x โ 3) + 2 that gives x โฅ 3, so the domain is [3, โ) and the range is [2, โ). For โ(9 โ xยฒ) it gives โ3 โค x โค 3, so the domain is [โ3, 3]. A cube root has no restriction: โ(x + 8) accepts every real number.
What is the domain of a rational function?
All real numbers except the zeros of the denominator. For 1/(xยฒ โ 4), the denominator is 0 at x = โ2 and x = 2, so the domain is (โโ, โ2) โช (โ2, 2) โช (2, โ). A denominator with no real zeros, such as xยฒ + 1, removes nothing: x/(xยฒ + 1) is defined for every x.
Why is the value 2 missing from the range of (xยฒ โ 1)/(x โ 1)?
The function equals x + 1 everywhere except x = 1, where it is undefined. The graph is the line y = x + 1 with a hole at the point (1, 2). Because x = 1 is the only input that would produce the output 2, that output never appears, and the range is (โโ, 2) โช (2, โ) even though the domain only loses one point.
What is the domain of tan(x)?
tan(x) = sin(x)/cos(x), so it is undefined wherever cos(x) = 0, which happens at x = ฯ/2 + kฯ for every integer k. The domain is every real number except those points, often written as the repeating intervals (โฯ/2 + kฯ, ฯ/2 + kฯ). sec(x) has the same domain; cot(x) and csc(x) exclude x = kฯ instead.
Why does the calculator say the range is an estimate?
Ranges are exact for polynomials, rational functions and chains of standard functions such as 3 sin(2x) + 1. A mixed expression like xยทeหฃ needs calculus, so the calculator finds its turning points numerically. It reports [โ1/e, โ), matching the exact minimum โ1/e โ โ0.3679 at x = โ1, but labels the result as an estimate.
Does log(x) mean base 10 or the natural log?
In this calculator log(x) is the common logarithm (base 10), ln(x) is the natural logarithm and log(x, b) uses base b. For domain and range the base does not matter: both log(x) and ln(x) have domain (0, โ) and range (โโ, โ).
๐ก Good to know
Odd roots never restrict the domain
A cube root of a negative number is a real number: โ(โ8) = โ2. That is why โ(x + 8) and x^(1/3) both have domain (โโ, โ), while โx and x^(1/2) stop at 0.
Nested functions shrink the domain
ln(ln(x)) needs ln(x) > 0, so its domain is (1, โ), not (0, โ). Likewise โ(โx โ 1) needs โx โฅ 1, which leaves [1, โ). Each layer adds its own condition.
The range of a function is the domain of its inverse
Solving y = (x + 1)/(x โ 2) for x gives the inverse x = (2y + 1)/(y โ 1). Its domain, y โ 1, is exactly the range of the original function, which is why solving for x is such a reliable way to find a range.