๐Ÿ‡บ๐Ÿ‡ธ USC
Math & Conversion
โ†”๏ธ

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ยฒ)

Try:
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ยฒ)

[โˆ’3, 3]

{x | โˆ’3 โ‰ค x โ‰ค 3}

RangeExact

[0, 3]

{y | 0 โ‰ค y โ‰ค 3}

๐Ÿ“ Domain on the number line

โˆ’33
Filled dot = endpoint included, open dot = endpoint excluded. Points are spaced evenly, not to scale.

๐Ÿ“‹ How the domain was found

  1. 1. Square root needs a nonnegative argument: 9 โˆ’ xยฒ โ‰ฅ 0 โ†’ โˆ’3 โ‰ค x โ‰ค 3
  2. 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].
Everything is computed in your browser. The domain comes from the rules for denominators, even roots, logarithms, inverse sine and cosine, and tan, sec, csc and cot. Ranges are exact for polynomials, rational functions and chains of standard functions, and a labeled numeric estimate otherwise.

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

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:

โš ๏ธ 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, โˆž).

Note: Domains follow exact rules. A range marked Estimate comes from numeric analysis; confirm it with algebra or calculus when you need an exact answer.

❓ 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.

Related Calculators