Domain and Range Calculator (Free, with Graph)

AlgebraFreeNo sign-up

A domain and range calculator finds the allowed inputs and possible outputs. For f(x) = (2x + 1)/(x − 3), the denominator cannot be 0, so the domain is all real numbers except 3: (−∞, 3) ∪ (3, ∞). Solving y = f(x) for x gives x = (3y + 1)/(y − 2), which fails only at y = 2, so the range is (−∞, 2) ∪ (2, ∞).

Domain and range calculator
Use ^ for powers, sqrt( ), cbrt( ), abs( ) or |x|, ln( ), log( ) for base 10, log_2( ), e^x, sin( ), cos( ). Write 2x for 2×x.
Try:
Domain and range
Domain: (−∞, 3) ∪ (3, ∞)

Range: (−∞, 2) ∪ (2, ∞)

For f(x) = (2x + 1)/(x − 3), the domain is all real numbers except x = 3 and the range is all real numbers except y = 2.

Domain (interval notation)(−∞, 3) ∪ (3, ∞)
Range (interval notation)(−∞, 2) ∪ (2, ∞)
Domain (set-builder){x ∈ ℝ | x ≠ 3}
Range (set-builder){y ∈ ℝ | y ≠ 2}
Vertical asymptotesx = 3
Horizontal asymptotey = 2
y-intercept(0, −1/3)
246−448Green curve: f(x). Green band on the x-axis: the domain. Gold band on the y-axis: the range. Red dashed: vertical asymptotes. Blue dashed: horizontal asymptote. Open circles: excluded points.
Show steps
  1. Domain: look for the parts of f(x) = (2x + 1)/(x − 3) that limit x: denominators (cannot be 0), even roots (need a value ≥ 0) and logarithms (need a value > 0).
  2. A denominator cannot be 0: x − 3 ≠ 0. Solve x − 3 = 0: x = 3. So x ≠ 3.
  3. So the domain is (−∞, 3) ∪ (3, ∞), or {x ∈ ℝ | x ≠ 3}.
  4. Range: set y = (2x + 1)/(x − 3) and multiply both sides by the denominator: y(x − 3) = 2x + 1. Collect powers of x: (−y + 2)x + (3y + 1) = 0.
  5. This is linear in x, so x = −(3y + 1)/(−y + 2). It fails only when −y + 2 = 0, that is y = 2. So y = 2 is never reached: it is the horizontal asymptote.
  6. So the range is (−∞, 2) ∪ (2, ∞), or {y ∈ ℝ | y ≠ 2}.

Numeric check: f was evaluated at 2,998 points across the domain. The values ran from about −1,310.4938 to about 1,314.4938, and every one lies inside the range shown. ✓

Domain and Range Calculator (Free, with Graph)
Embed this calculator on your site

Free to use on class pages, blogs and course pages. Copy the code below and paste it into your page:

How to use the domain and range calculator

  1. Type a function of x, such as sqrt(x – 3) + 2, (x + 1)/(x^2 – 4) or ln(x – 1). You can also choose Function family and enter a, h and k for linear, quadratic, absolute value, square root, cube root, rational, exponential and logarithmic functions.
  2. Read the domain and range in interval notation and in set-builder notation. Rational functions also show vertical and horizontal (or slant) asymptotes and any holes.
  3. Check the graph: the green band on the x-axis is the domain and the gold band on the y-axis is the range.
  4. Open Show steps to see each restriction solved and how the range was found, followed by a numeric check.

How to find the domain of a function

The domain is the set of inputs x for which f(x) is a real number. Start with all real numbers and remove the values that break one of three rules:

  • Denominators cannot be 0. For 1/(x − 2), x ≠ 2.
  • Even roots need a value of at least 0. For √(x − 3), x − 3 ≥ 0, so x ≥ 3.
  • Logarithms need a positive input. For ln(x − 1), x − 1 > 0, so x > 1.

When a condition is a polynomial or a fraction of polynomials, find where it is 0 or undefined, mark those x-values on a number line, and test one x in each interval. If a function has several restrictions, the domain is where all of them hold at once. Polynomials, cube roots, |x|, e^x, sin x and cos x have no restrictions of their own.

How to find the range of a function

The range is harder because you must know which outputs actually occur. These methods cover most school functions:

  • Quadratics: find the vertex. f(x) = x² − 4x + 1 has its vertex at x = −b/(2a) = 2, where f(2) = −3. The parabola opens up, so the range is [−3, ∞).
  • Rational functions: set y = f(x), solve for x, and see which y-values have no solution. For (2x + 1)/(x − 3) that value is y = 2, the horizontal asymptote. When x² appears, use the discriminant: a real x exists only when b² − 4ac ≥ 0.
  • Transformed functions: work from the inside out. For √(4 − x²), the inside 4 − x² takes values up to 4; the square root only accepts 0 to 4, so it returns 0 to 2. The range is [0, 2].
  • Exponentials and logarithms: b^x is always positive, so 2^x − 3 has range (−3, ∞). A logarithm such as ln(x − 1) takes every real value.

Domain and range of common functions

Function Domain Range
f(x) = mx + b, m ≠ 0 (−∞, ∞) (−∞, ∞)
f(x) = a(x − h)² + k, a > 0 (−∞, ∞) [k, ∞)
f(x) = a|x − h| + k, a > 0 (−∞, ∞) [k, ∞)
f(x) = a√(x − h) + k, a > 0 [h, ∞) [k, ∞)
f(x) = a∛(x − h) + k (−∞, ∞) (−∞, ∞)
f(x) = a/(x − h) + k x ≠ h y ≠ k
f(x) = a·b^(x − h) + k, a > 0 (−∞, ∞) (k, ∞)
f(x) = a·log_b(x − h) + k (h, ∞) (−∞, ∞)
f(x) = sin x or cos x (−∞, ∞) [−1, 1]

If a is negative, the graph flips: the square root, absolute value and quadratic ranges become (−∞, k], and the exponential range becomes (−∞, k).

Worked examples

Example 1: a rational function with two excluded values

For f(x) = (x + 1)/(x² − 4), the denominator is 0 when x = −2 or x = 2. The domain is (−∞, −2) ∪ (−2, 2) ∪ (2, ∞), or {x ∈ ℝ | x ≠ −2, x ≠ 2}. Solving y(x² − 4) = x + 1 gives yx² − x − (4y + 1) = 0, whose discriminant 1 + 4y(4y + 1) = 16y² + 4y + 1 is always positive. Every y is reached, so the range is (−∞, ∞).

Example 2: a square root of a quadratic

For f(x) = √(4 − x²), we need 4 − x² ≥ 0. The zeros are x = −2 and x = 2, and testing x = 0 gives 4 > 0, so the domain is [−2, 2]. On that interval 4 − x² runs from 0 to 4, so the square root runs from 0 to 2: the range is [0, 2]. The graph is the top half of a circle with radius 2.

Example 3: a hole changes the range

f(x) = (x² − 1)/(x − 1) equals x + 1 after cancelling, but x = 1 is still excluded. The domain is all real numbers except 1. The line y = x + 1 would reach y = 2 only at x = 1, so 2 is missing: the range is (−∞, 2) ∪ (2, ∞). The graph has a hole at (1, 2).

Interval notation and set-builder notation

Interval notation lists the pieces of the set. A square bracket [ ] includes the endpoint and a parenthesis ( ) excludes it. Infinity always gets a parenthesis, and ∪ joins separate pieces. Set-builder notation describes the rule instead: {x ∈ ℝ | x ≥ 3} reads “all real x such that x is at least 3”. Both describe the same set, so use whichever your teacher asks for.

Words Interval notation Set-builder notation
x is at least 3 [3, ∞) {x ∈ ℝ | x ≥ 3}
x is any number except 2 (−∞, 2) ∪ (2, ∞) {x ∈ ℝ | x ≠ 2}
x is from −2 to 2, inclusive [−2, 2] {x ∈ ℝ | −2 ≤ x ≤ 2}
x is less than −3 or greater than 3 (−∞, −3) ∪ (3, ∞) {x ∈ ℝ | x < −3 or x > 3}

Common mistakes with domain and range

  • Cancelling first. Simplify (x² − 1)/(x − 1) to x + 1 only after you record x ≠ 1. The excluded value stays excluded.
  • Using a bracket next to ∞. Infinity is not a number you can reach, so write [3, ∞), never [3, ∞].
  • Using > 0 for a square root. √0 = 0 is allowed, so the inside must be ≥ 0. For a logarithm, the inside must be strictly > 0.
  • Assuming the range is all real numbers. Check for a vertex, a horizontal asymptote, or an outer function such as √ or b^x that limits the outputs.
  • Mixing up the two. The domain lives on the x-axis (inputs) and the range on the y-axis (outputs).

Domain and Range practice quiz: 10 questions

Test yourself with 10 multiple-choice questions. Choose an answer and press Submit to see if you are right and why. Your score appears at the end.

Question 1 of 10
1. What is the domain of f(x) = 1/(x − 7)?

Found a mistake? Let us know!

2. What is the domain of f(x) = √(x + 4)?

Found a mistake? Let us know!

3. What is the range of f(x) = (x − 3)² + 2?

Found a mistake? Let us know!

4. What is the domain of f(x) = ln(5 − x)?

Found a mistake? Let us know!

5. What is the range of f(x) = 3/(x + 1) − 4?

Found a mistake? Let us know!

6. What is the range of f(x) = 2^x + 1?

Found a mistake? Let us know!

7. What is the domain of f(x) = (x + 2)/(x² − 9)?

Found a mistake? Let us know!

8. What is the range of f(x) = −|x| + 5?

Found a mistake? Let us know!

9. Which is {x ∈ ℝ | x > −1} in interval notation?

Found a mistake? Let us know!

10. What is the domain of f(x) = 1/√(6 − 2x)?

Found a mistake? Let us know!

Frequently asked questions

What is interval notation?

Interval notation writes a set of numbers as intervals between endpoints. Brackets include an endpoint, parentheses exclude it, and ∪ joins pieces. For example, [3, ∞) means every number from 3 upward, and (−∞, 2) ∪ (2, ∞) means every number except 2.

Which function types are supported?

Polynomials, rational functions, square and cube roots, fractional powers, absolute value, exponentials, natural, common and base-b logarithms, sin and cos, and combinations of them. Polynomial and rational conditions are solved exactly. Other combinations are solved numerically and the result is marked with ≈.

Does it graph the function?

Yes. The graph shows the curve with the domain shaded on the x-axis and the range shaded on the y-axis. Rational functions also show vertical asymptotes, horizontal or slant asymptotes and holes.

How do you find the domain and range from a graph?

Read the domain from left to right: the x-values the graph covers. Read the range from bottom to top: the y-values it covers. An open circle means that point is not included, and an arrow means the graph keeps going.

What is the domain of a function with a square root in the denominator?

The inside must be strictly positive, because it must be at least 0 for the root and cannot be 0 in a denominator. For 1/√(x + 5), x + 5 > 0, so the domain is (−5, ∞).

Related calculators

More algebra calculators

Browse all 458 calculators

Related to This Article

What people say about "Domain and Range Calculator With Graph and Steps"?

No one replied yet.

Leave a Reply